listbook, how to add an event ?

Hello again :wink:

I did some experiments here and to solve my problem I added an empty
panel to the listbook, and did a bind to the event listbook
PageChanged.
So I get the user clicks on listbook and verify if it is on that empty
panel, if it is,
program exits.

But what I really wanted was to not need to create an empty panel, so
if someone can tell me a better way or the right way to do this it
would be nice =)

Guilherme Polo wrote:

Hello again :wink:

I did some experiments here and to solve my problem I added an empty
panel to the listbook, and did a bind to the event listbook
PageChanged.
So I get the user clicks on listbook and verify if it is on that empty
panel, if it is,
program exits.

But what I really wanted was to not need to create an empty panel, so
if someone can tell me a better way or the right way to do this it
would be nice =)

If you really want to (ab)use the wx.Listbook like this then you can get a reference to the listctrl it is using with GetListView, and add your own icon and catch the right events to see when it is selected.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!