wxPython - is order of multiple events arbitrary across platforms?

neptune321 at excite.com neptune321 at excite.com
Wed Aug 2 20:21:05 PDT 2006




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!






More information about the wxpython-users mailing list