I have a class which is derived from wx.Dialog in this
class I implemented an OnOK function.
The Dialog also has a button with an ID of wx.ID_OK.
But the OnOk function isn't called when I click on the button.
As far as I can tell OnOk should be called.
Anyone have an Idea why not?
Sample script attached.
WinXP, 2.5.1.5, with python 2.3.2
I have a class which is derived from wx.Dialog in this
class I implemented an OnOK function.
The Dialog also has a button with an ID of wx.ID_OK.
But the OnOk function isn't called when I click on the button. As far as I
can tell OnOk should be called. Anyone have an Idea why not?
Sample script attached.
WinXP, 2.5.1.5, with python 2.3.2
I have a class which is derived from wx.Dialog in this
class I implemented an OnOK function.
The Dialog also has a button with an ID of wx.ID_OK.
But the OnOk function isn't called when I click on the button.
As far as I can tell OnOk should be called.
Anyone have an Idea why not?
It takes extra work and runtime overhead to allow C++ methods to be overridable in Python derived classes, so it is only done when it is really needed to fullfil the design of the class. In this case however you can just bind EVT_BUTTON to your method.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I have a class which is derived from wx.Dialog in this
class I implemented an OnOK function.
The Dialog also has a button with an ID of wx.ID_OK.
But the OnOk function isn't called when I click on the button.
As far as I can tell OnOk should be called.
Anyone have an Idea why not?
It takes extra work and runtime overhead to allow C++ methods to be overridable in Python derived classes, so it is only done when it is really needed to fullfil the design of the class.
Ah ok. No Problem.
Shouldn't this be mentioned in the wxWidgets docs. As a wxPYthon specific thing.