According to the grid simple demo (GridSimple.py) it should be
possible to veto hiding the editor. The code certainly seems to
suggest as much.
def OnEditorHidden(self, evt):
if evt.GetRow() == 6 and evt.GetCol() == 3 and \
wx.MessageBox("Are you sure you wish to finish editing this cell?",
"Checking", wx.YES_NO) == wx.NO:
evt.Veto()
return
self.log.write("OnEditorHidden: (%d,%d) %s\n" %
(evt.GetRow(), evt.GetCol(), evt.GetPosition()))
evt.Skip()
When I run the demo, however, it asks the question and then simply
proceeds regardless of which option I choose. I am running the latest
version of wxPython (2.8.6.1) -- on Windows currently. I have seen one
other message (two years old) with a similar question but no response.
Any help on this appreciated.
What I'm really after (just to make sure there isn't some far better
solution to my problem) is to verify some data, and, if invalid,
display a message box and continue editing.
Thanks,
Anthony Tuininga