Page 1 of 1

Order of events?

Posted: Wed Dec 16, 2009 3:08 pm
by jellyfish
Hi there,

I hope you don't mind me asking a question every day. ^^

As I've read in another thread, there is only one event handled at the time.
But where is decided in which order the events are handled, if an interaction triggers more than one?

(In my case, EVT_BUTTON and EVT_KILL_FOCUS - I want the button event to be handled first.)


Posted: Thu Dec 17, 2009 12:15 am
by Frank
As far as I understand it, wx just translates the events from the system (like WM_COMMAND, WM_FOCUS on Windows) into wxEvents (wxCommandEvent, wxFocusEvent).

This means, the order of the events is platform dependent.

Posted: Thu Dec 17, 2009 8:17 am
by jellyfish
...hmh, not so good news. Thank you very much, however.

So maybe the KILL_FOCUS event wasn't the best choice for my problem. I guess there is no such thing as waiting in an event handler for another event?


Edit: I've found wxApp::FilterEvent and wxApp::Pending ... is there anywhere an example how to use wxApp outside OnInit()?

Why not doing a Finite State Machine

Posted: Mon Dec 21, 2009 11:56 am
by wxuserbrest
do a FSM and you will do the behaviour of your system, and you will change state on event receptions.