Things with built in event handling?

Hello everyone,

It seems like some controls like PyShell or the PythonSTC might handle their own events like Cut/Copy/Paste keyboard cuts and such, if they weren't being overridden. I was wondering what the best way to "give them back" their events is when they are selected. Current we bind ID_COPY/CUT/PASTE etc with either EVT_MENU or EVT_MENU_RANGE. I tried doing an Unbind(EVT_MENU_RAGE, id=wx.ID_LOWEST, id2=wx.ID_HIGHEST) but still things seem to be bound.

The other events can be gotten rid if that is the solution; we can just re-call the method that does our custom binding.

What is the common solution to this problem?

Thanks!
- Mike

Rooney, Mike (ext. 324) wrote:

Hello everyone,

It seems like some controls like PyShell or the PythonSTC might
handle their own events like Cut/Copy/Paste keyboard cuts and such,
if they weren't being overridden. I was wondering what the best way
to "give them back" their events is when they are selected. Current
we bind ID_COPY/CUT/PASTE etc with either EVT_MENU or EVT_MENU_RANGE.
I tried doing an Unbind(EVT_MENU_RAGE, id=wx.ID_LOWEST,
id2=wx.ID_HIGHEST) but still things seem to be bound.

The other events can be gotten rid if that is the solution; we can
just re-call the method that does our custom binding.

What is the common solution to this problem?

I usually just call the appropriate methods in the widget from my own event handlers, but I've also seen it done by resending the event to the widget. So I guess it all depends on what seems best for your situation.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!