Is it permissible to bind one event from a given control to multiple
handlers? My tests indicate that the answer is no, but perhaps I am doing
something stupid (again).
···
--
Jeffrey Barish
Is it permissible to bind one event from a given control to multiple
handlers? My tests indicate that the answer is no, but perhaps I am doing
something stupid (again).
--
Jeffrey Barish
Is it permissible to bind one event from a given control to multiple
handlers? My tests indicate that the answer is no, but perhaps I am doing
something stupid (again).
--
Sort of yes and sort of no, but the easiest way is to only bind it
once to a dispatch method.
The more complicated way is that yes, you can have multiple handlers
but only one can "handle" it and once the event is handled no more
handlers are called. An event is "handled" by default but you can call
event.Skip() to let the next handler process it. This may or may not
work for you needs.
On 2/7/06, Jeffrey Barish <jeff_barish@earthlink.net> wrote:
Jeffrey Barish
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
Is not stupid but wrong... and if is any comfort, it is a common mistake.
What you're trying to do is something like this:
"when the user does this, the program should do X, Y, Z"
what you should is this
"when this event happens the program should react to it"
so instead of binding the event to Reaction1,Reaction2, Reaction3 bind it to
an EventHandler that will call Reaction1,Reaction2, Reaction3.
As a rule, if it feels you're writing too much code then write it
anyway. A lot of my problems derived from the fact that I didn't write
that extra piece of code...
Another advice is to create an inner language... especially if the
application you're trying to create is big... use something like MVP
and create words, commands and such to comunicate between
components...
On 2/7/06, Jeffrey Barish <jeff_barish@earthlink.net> wrote:
Is it permissible to bind one event from a given control to multiple
handlers? My tests indicate that the answer is no, but perhaps I am doing
something stupid (again).
--
Jeffrey Barish---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org