wx.NOTEBOOK

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.

Thanks,
Daniel

notebook_test.py (1.27 KB)

Platform and version?

···

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.

--
Robin Dunn
Software Craftsman

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.

Platform and version?

--
Robin Dunn
Software Craftsman
http://wxPython.org

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Q: Are you sure?

  >> A: Because it reverses the logical flow of conversation.
  >>> Q: Why is top posting annoying in email?

[[ Please do not use top-posting for replies to this group. See Top Posting and Bottom Posting and Why is Bottom-posting better than Top-posting ]]

···

A: Yes.

On 9/18/11 9:15 AM, Daniel Fontaine wrote:

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.

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.

--
Robin Dunn
Software Craftsman