The simple code below demonstrate a bug I found on Win2000/XP with python-2=
.2 and wxPython-2.3.3pre4-Py22.=0D
If you right click when the mouse positioned on the border of two cell (the=
cursor becomes a horizontal or vertical double arrow) python crashes after=
clicking on the OK button of the message box.=0D
=0D
=0D
from wxPython.wx import *=0D
from wxPython.grid import *=0D
=0D
class TestFrame(wxFrame):=0D
def __init__(self):=0D
wxFrame.__init__(self, None, -1, '',)=0D
grid =3D wxGrid(self, -1)=0D
=0D
grid.CreateGrid(2, 2)=0D
EVT_GRID_CELL_RIGHT_CLICK(grid, self.OnCellRightClick)=0D
=0D
def OnCellRightClick(self, evt):=0D
dlg =3D wxMessageDialog(None, 'test', '', wxOK)=0D
=0D
dlg.ShowModal()=0D
=0D
dlg.Destroy()=0D
evt.Skip()=0D
=0D
app =3D wxPySimpleApp()=0D
frame =3D TestFrame()=0D
frame.Show(true)=0D
app.MainLoop()=0D
=0D
···
__________________________________
This mail was sent through BRCNet WebAccess
The simple code below demonstrate a bug I found on Win2000/XP with
python-2=
.2 and wxPython-2.3.3pre4-Py22.=0D
If you right click when the mouse positioned on the border of two cell
(the=
cursor becomes a horizontal or vertical double arrow) python crashes
after=
clicking on the OK button of the message box.=0D
The crash happens when attempting to show one assert dialog causes another
assert dialog to be shown. There is a check for a nested call to wxOnAssert
and if so then it calls wxTrap(), which will drop you out to the debugger if
you are running within one.
The origional assert message in this case was about attempting to release
the mouse when the window doesn't have it captured. (Showing the dialog
releases the mouse capture.) You can work around it by checking if the
mouse is captured before showing the dialog:
if not wxWindow_GetCapture():
dlg = wxMessageDialog(None, 'test', '', wxOK)
dlg.ShowModal()
dlg.Destroy()
It should be fixable in wxGrid too, I'll take a look at that.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!