If multiple events are posted using wxPostEvent/wxCallAfter from same thread e.g. on button click are they supposed to be processed in same order?
In the below example wx.Callafter is used to post events, which eventually will call the callback functions, will they be called in same order, in which they were passed to wx.CallAfter
def onbutton(self, event):
wx.CallAfter(func1)
# some more code
wx.CallAfter(func2)
rgds
Anurag
In general, yes. But there can be situations that can make it appear to
be done out of order. CallAfters and PostEvents are handled by the
app's pending event queue, and this queue is processed at the same time
that the app handles and sends idle events. So for example if something
that you do in one of your CallAfter functions triggers the processing
of idle events, (like calling a yield function or showing a modal
dialog) then the remainder of the queued CallAfters can actually be
executed before the first one is finished.
--
Robin Dunn
Software Craftsman
http://wxPython.org
It's probably just a difference of the priority assigned to timer events
on each platform.
That is usually the best approach to take, they can be problematic in
some situations.