[wxPython] Notebook PROBLEMS with sizers

Hi,
Can anybody give me a short working example how I can use
sizers in Notebook?
I tried the code below but it does not work properly.

···

******************
from wxPython.wx import *
class Test(wxFrame):
    def __init__(self, parent, ID, title):
        wxFrame.__init__(self, parent, ID, title,
                         wxDefaultPosition, wxSize(640, 480))
########################################################
## First page
################

class Description(wxPanel):
    def __init__(self, parent, ID):
        wxPanel.__init__(self, parent, -1)
        self.LDescription = wxStaticText(self, -1,
"Description:",wxPoint(20,60))
        self.Description = wxTextCtrl(self, 11, "Please describe in
details", wxPoint(80, 60), wxSize(250,90), wxTE_MULTILINE)
        self.POST =wxButton(self, 40, "POST", wxPoint(500, 350))
   
########################################################
##
## Second page
##
########################################################

class WriteResults(wxPanel):
    def __init__(self, parent,log):
        self.log = log
        wxPanel.__init__(self, parent, -1)
        self.Results = wxTextCtrl(self, 503,'', wxPoint(10, 70),
wxSize(600, 320), wxHSCROLL |wxTE_MULTILINE

wxTE_READONLY )

        self.READ =wxButton(self, 50, "READ", wxPoint(500, 350))

########################################################
##############
##
## Main LOOP
##
########################################################
##############

class MyApp(wxApp):
    def OnInit(self):
        TestFrame = Test(NULL, -1, "TEST - PROJECT: ")
        self.sizer = wxBoxSizer(wxVERTICAL)
        self.nb = wxNotebook(TestFrame,-1)
        nbSizer = wxNotebookSizer(self.nb)
        self.sizer.Add(nbSizer, 1,wxGROW)

        #Add first page
        DescriptionInstance = Description(TestFrame, -1)
        self.nb.AddPage(DescriptionInstance,"Description")
        self.sizer.Add(DescriptionInstance, 1,wxGROW)
        
        # Add second page
        WriteResultsI = WriteResults(TestFrame, -1)
        self.nb.AddPage(WriteResultsI,"Posting progress")
        self.sizer.Add(WriteResultsI, 1,wxGROW)
        
        TestFrame.SetSizer(self.sizer)
        TestFrame.SetAutoLayout(TRUE)
        TestFrame.Show(true)
        return true
    
app = MyApp(0)
app.MainLoop()

******************************
Thank you very much for help.
Ladislav

Hi,
Can anybody give me a short working example how I can use
sizers in Notebook?

Each page should have its own sizer and since your notebook is the only thin in the frame then you don't need a wxNotebookSizer since the frame will automatically keep its only child resized to fill the frame.

···

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