A question about event handlers with wxPython

Mike Driscoll kyosohma at gmail.com
Tue Jan 15 11:48:33 EST 2008


On Jan 15, 9:04 am, "Erik Lind" <el... at spamcop.net> wrote:
> > def HandleSomething(self, event):
> >    generating_control = event.GetEventObject()
> >    print generating_control
>
> > HTH,
>
> Thank you.That is what I was looking for, but as often seems the case, one
> thing exposes another. Is there any way to listen for events without
> specifically binding to a handler (it seems one cannot bind an event to two
> handlers?)? One could do so with globals, but I'm trying to avoid that.
>
> For example, "press any button to stop"
>
> def HandleSomething(self, event):
>     .................
>      while generating_control: == something:
>             run
>             else
>             stop

I forgot to provide a link to a fairly straight-forward explanation of
event propagation on the wxPython wiki: http://wiki.wxpython.org/EventPropagation

Hope that helps!

Mike



More information about the Python-list mailing list