wxPython - is order of multiple events arbitrary across platforms?

Greetings,

For user actions on a wxWidget that trigger multiple events for
that wxWidget, is the order those events are processed in
undefined, and therefore arbitrary from one platform (ie Windows)
to the next (ie Linux)?

Specifically, I have a convenience aggregate class that combines
a wxStaticText with a wxComboBox, as I often need those two at
the same time. The aggregate catches events from the wxComboBox
and stores them in it's own class. The parent then catches the
event, uses the stored values and set's any variables and does
any processing it needs.

But I had a slight bug, which I didn't catch until a recent upgrade.
Suddenly, this technique still worked under windows - and didn't
under Linux. The bug? the wxComboBox and the parents were catching
two different events - oops. (I was catching the EVT_COMBOBOX in
the child widget class - and EVT_TEXT in the parent methods -
thanks to cut'n'paste an error I managedto propagate through most of
my code. (Duh)

The reason the Windows version works, is because apparently the
EVT_COMBOBOX is processed first. By the time the parent catches
the EVT_TEXT evt, the aggregate widget has already caught the
EVT_COMBOBOX and set its local values. Under Linux, however, it
appears that the EVT_TEXT is processed first - before the aggregate
catches the EVT_COMBOBOX and has had a chance to set it's values -
boom.

Hence the above question.

I know that the event propagation for any single event is pretty
well defined, crawling up through the superclasses, and for
wxCommand-derived events, up through the container heirarchy. But
I really haven't found any docs that guarantee which events are
processed first when a user action fires multiple events.

My bug (at least this one) is fixed - but curiosity and coding go
hand in hand.

Cheers,

Conrad

···

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!

neptune321@excite.com wrote:

For user actions on a wxWidget that trigger multiple events for that wxWidget, is the order those events are processed in undefined, and therefore arbitrary from one platform (ie Windows) to the next (ie Linux)?

Yes, it's possible that they can come in different orders. Especially when low level native events are involved, wxWidgets can only send them when the platform sends them to us, and doesn't make any effort to reorder or to make the order consistent across platforms. The most that is done is in a few cases the native event may be suppressed if it is sent in a situation where there shouldn't be a wx event, such as when a programmatic change is made to a widget.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!