So I have three tabs/pages in a wx.Notebook and have bound the notebook to a wx.EVT_NOTEBOOK_PAGE_CHANGED event.
When I click on the 2nd or 3rd tab, the event is called and the function I have bound to it is executed.
However, when I click on the first tab, the event is not called.
I noticed that the event properly registers in the wxPython Demo, but I couldn't really see a difference between my code and the demo's.
I attached an example app with the status bar responding to the event function. If anyone can give advice as to why the first tab doesn't call the event, that would be great.
So I have three tabs/pages in a wx.Notebook and have bound the
notebook to a wx.EVT_NOTEBOOK_PAGE_CHANGED event. When I click on the
2nd or 3rd tab, the event is called and the function I have bound to
it is executed. However, when I click on the first tab, the event is
not called.
I noticed that the event properly registers in the wxPython Demo, but
I couldn't really see a difference between my code and the demo's. I
attached an example app with the status bar responding to the event
function. If anyone can give advice as to why the first tab doesn't
call the event, that would be great.
Mac OSX 10.6, Python 2.7.2, wxPython-cocoa 2.9.2.4
···
On Sep 17, 2011, at 8:48 PM, Robin Dunn wrote:
On 9/17/11 3:33 AM, Daniel Fontaine wrote:
So I have three tabs/pages in a wx.Notebook and have bound the
notebook to a wx.EVT_NOTEBOOK_PAGE_CHANGED event. When I click on the
2nd or 3rd tab, the event is called and the function I have bound to
it is executed. However, when I click on the first tab, the event is
not called.
I noticed that the event properly registers in the wxPython Demo, but
I couldn't really see a difference between my code and the demo's. I
attached an example app with the status bar responding to the event
function. If anyone can give advice as to why the first tab doesn't
call the event, that would be great.
So I have three tabs/pages in a wx.Notebook and have bound the
notebook to a wx.EVT_NOTEBOOK_PAGE_CHANGED event. When I click on the
2nd or 3rd tab, the event is called and the function I have bound to
it is executed. However, when I click on the first tab, the event is
not called.
I noticed that the event properly registers in the wxPython Demo, but
I couldn't really see a difference between my code and the demo's. I
attached an example app with the status bar responding to the event
function. If anyone can give advice as to why the first tab doesn't
call the event, that would be great.
Platform and version?
Mac OSX 10.6, Python 2.7.2, wxPython-cocoa 2.9.2.4
You need to call event.Skip() in your EVT_NOTEBOOK_PAGE_CHANGED event handler so the code in the default handler will still be executed.