Attached is an executable code sample (courtesy of you -- thanks!) which
I pulled from the mailing list archive. It demonstrates the use of a
custom wxPyGridCellEditor. I made two changes to see if I could apply
them to my own project:
1. Called Destroy() in the EndEdit method of the MyCellEditor class.
2. Added EVT_GRID_SELECT_CELL and EVT_MOTION events and handlers to the
GridEditorTest class.
Regarding #1, there is no problem unless <tab> is pressed when the
custom editor is open, which causes a segfault (instead of closing the
editor and advancing to the next cell). Regarding #2, the EVT_MOTION
event is not being processed by the grid.
1. Called Destroy() in the EndEdit method of the MyCellEditor class.
2. Added EVT_GRID_SELECT_CELL and EVT_MOTION events and handlers to the
GridEditorTest class.
Regarding #1, there is no problem unless <tab> is pressed when the
custom editor is open, which causes a segfault (instead of closing the
editor and advancing to the next cell).
Thanks, I think I've fixed this bug in the grid C++ code. Unfortunatly I
can't think of a workaround except for not destroying your control. The
good news however is that the editor object (and therefore the control it
creates) can be shared for all cells that use it, or that have the same data
type.
Regarding #2, the EVT_MOTION
event is not being processed by the grid.
The grid window actually has several child windows on top of it, so to catch
mouse events you have to bind the event handlers to those children as the
main grid window doesn't actually get the events. The problem however is
that there is currently no way to get a reference to those child windows.
ยทยทยท
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!