First of all, you can not add the same page window to a book control more than once. Each page should be a new instance.
Secondly, it's not clear from your description above but I think you are saying that you want the other widgets to shown/hidden based on which page is selected in the listbook. IF that is the case then those widgets need to be children of the panels used as pages in the listbook. See the various book samples in the demo for examples.
If you want the same types of widgets on each page, but with different content, then that can still be done with a listbook, but you will have to duplicate the widgets on each page (or better yet, make a new class derived from wx.Panel that encapsulates those widgets and their behaviors, and use a new instance of that class for each page.)
Or you could not use the listbook and instead put just one set of the widgets on the main panel along with a normal listctrl, catch the selection events from the listctrl yourself and change the content of the other widgets as needed from there. That will save you the overhead of making so many instances of the widgets, and may simplify some other things as well.
I am new to wxPython and have read over the tutorial, but need help with
my program's layout. I have posted the code and screenshots.
On the left side, there exists a Listbook, that when an item is clicked
on, I want a new Panel which includes the 2nd and 3rd columns. Any help
would be greatly
appreciated.
I didn’t think about doing this: “one set of the widgets on the main panel along with a normal listctrl, catch the selection events from the listctrl yourself and change the content of the other widgets as needed from there. That will save you the overhead of making so many instances of the widgets, and may simplify some other things as well.”
This sounds a lot easier.
I also can’t wait to try out WIT.
Thanks!
-John
···
On Tuesday, September 11, 2012 2:43:42 PM UTC-4, Robin Dunn wrote:
On 9/11/12 10:52 AM, jftuga wrote:
I am new to wxPython and have read over the tutorial, but need help with
my program’s layout. I have posted the code and screenshots.
On the left side, there exists a Listbook, that when an item is clicked
on, I want a new Panel which includes the 2nd and 3rd columns. Any help
would be greatly
appreciated.
First of all, you can not add the same page window to a book control
more than once. Each page should be a new instance.
Secondly, it’s not clear from your description above but I think you are
saying that you want the other widgets to shown/hidden based on which
page is selected in the listbook. IF that is the case then those
widgets need to be children of the panels used as pages in the listbook.
See the various book samples in the demo for examples.
If you want the same types of widgets on each page, but with different
content, then that can still be done with a listbook, but you will have
to duplicate the widgets on each page (or better yet, make a new class
derived from wx.Panel that encapsulates those widgets and their
behaviors, and use a new instance of that class for each page.)
Or you could not use the listbook and instead put just one set of the
widgets on the main panel along with a normal listctrl, catch the
selection events from the listctrl yourself and change the content of
the other widgets as needed from there. That will save you the overhead
of making so many instances of the widgets, and may simplify some other
things as well.