SplitterWindow + Choicebook problems

Mike Driscoll wrote:

Hi,

I am trying to create an application where there's a set of checkboxes and
a couple of buttons on one the left and a "Choicebook" widget on the
right. After much finagling, I discovered Choicebook would need a window
of its own and so I went with the SplitterWindow, kind of like the demo.
Unfortunately, the splitter examples of the wiki appear to be only
partially working.

The splitter example itself doesn't refresh correctly on windows XP SP2
using the current wxPython implementation. The example is here:
http://wiki.wxpython.org/index.cgi/SplitterExample

The other example
(http://wiki.wxpython.org/index.cgi/ProportionalSplitterWindow) only works
if I comment out the call to the ProportionalSplitterWindow.

Anyway, I got the splitter to work using a combination of the demo and The
Book. However, I cannot get the Choicebook to appear on the right
correctly. It either shows up squashed or not at all. I currently import
the following class into my main app and I pass it a panel as its parent.
If I pass the frame, it takes over the entire app and nothing appears.

class InstallerCB(wx.Choicebook):
    def __init__(self, parent, id):
        wx.Choicebook.__init__(self, parent, id)

        panel = wx.Panel(self)
        message = 'Choose the install from the drop-down box above'
        messageTxt = wx.StaticText(panel, -1, message)
        bngPanel = wx.Panel(self)
        soPanel = wx.Panel(self)

When using any of the book controls you need to add the pages it is to manage using book.AddPage(panel, label)

I have attached the main code.

Thanks for any pointers.

In the future please ensure that the code you send to the list is runnable, otherwise it's a lot harder for people here to help you.

http://wiki.wxpython.org/index.cgi/MakingSampleApps

ยทยทยท

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