wxPython - Event processing order arbitrary across platforms?

C

Conrad

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 convience 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 calling 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 - and EVT_TEXT in the parent methods - thanks to
cut'n'paste an error I managed to 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 is fixed - but curiosity and coding go hand in hand.

Cheers,

Conrad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top