Hi,
to continue the discussion we had last week about the different ways to us
Bind() I'd like to add that I found a situation where you can't live without the
third parameter. If you have nested notebooks and you want to catch the
NOTEBOOK_PAGE_CHANGED event of the topmost notebook, you will have to Bind()
like this:
self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.OnPageChanged, self)
If you ommit the last argument, you will recieve the events from the child
notebooks, too.
More generally this case applies to every container widget that creates
CommandEvents.
Christian
Hi Christian,
I appreciate all the clarifications in this area!
But I must not be understanding correctly, I had thought that command events did not travel up the windows hierarchy, and wouldn't NOTEBOOK_PAGE_CHANGED a windows sort of event? But it does seem there are indeed situations where the three-parameter form is required, I encountered a situation in the EditableListBox where I had to get the Delete button and map the event with that object as the third parameter, its button event did not travel (apparently) past the EditableListBox.
Lee
···
Hi,
to continue the discussion we had last week about the different ways to us
Bind() I'd like to add that I found a situation where you can't live without the
third parameter. If you have nested notebooks and you want to catch the
NOTEBOOK_PAGE_CHANGED event of the topmost notebook, you will have to Bind()
like this:
self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.OnPageChanged, self)
If you ommit the last argument, you will recieve the events from the child
notebooks, too.
More generally this case applies to every container widget that creates
CommandEvents.
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
“There is nothing remarkable about it. All one has to do is press the right keys at the right time and the computer programs itself.” (ala J.S. Bach)
Unless otherwise stated, any views presented in this e-mail are solely those of the author and do not necessarily represent those of the company.
Lee Merrill wrote:
Hi Christian,
I appreciate all the clarifications in this area!
But I must not be understanding correctly, I had thought that
command events did not travel up the windows hierarchy, and wouldn't
No. It's the opposite. CommandEvents do travel up the hierarchy.
Regards, Christian
Christian Kristukat wrote:
No. It's the opposite. CommandEvents do travel up the hierarchy.
yup.
However, they only keep going until they are handled. Then they stop, unless the handler calls event.Skip()
However, how you call Bind() won't effect this.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov