> Hi,
> Can anybody give me a short working example how I can use=20
> 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.
Dear Robin,
Thank you for your reply. I removed wxNotebookSizer and it works
well until I maximize window(frame). If I maximize window then
child does NOT fill the frame.
Here is the code
···
*****************************
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.nb = wxNotebook(TestFrame,-1)
#Add first page
DescriptionInstance = Description(TestFrame, -1)
self.nb.AddPage(DescriptionInstance,"Description")
# Add second page
WriteResultsI = WriteResults(TestFrame, -1)
self.nb.AddPage(WriteResultsI,"Posting progress")
TestFrame.SetAutoLayout(TRUE)
TestFrame.Show(true)
return true
app = MyApp(0)
app.MainLoop()
*******************************
Can you please let me know where I make a mistake?
Thanks.
Ladislav