sizers in wxpanels/notebooks

Astan Chee stanc at al.com.au
Fri Dec 7 21:52:36 EST 2007


Hi,
I have a wxNoteBook with a bunch of wxPanels attached to it as pages. 
Every page has its own GUI items.
What Im trying to do is on a certain page, a certain GUI (wxTextCtrl) to 
be resized every time the notebook or panel is resized. But everything 
else stays the same.
Now I know I can use sizers to solve this, but I have each GUI item's 
position hard-coded and they shouldnt move around or change size. I was 
thinking of putting this wxTextCtrl in a child wxPanel of these 
wxPanel/pages. So the hierarchy is wxNoteBook -> wxPanel -> wxPanel -> 
wxSizer.Add( wxTextCtrl)
is this possible? how do i get it working? are there other alternatives 
to what Im trying to do? because simply putting a wxPanel in a wxPanel 
and adding a sizer in a normal manner doesnt work for me.
below is a snippet of what Im doing (i dont want the button to change 
position or change size or be in any sizers, but I do want the textctrl 
to do so).

        self.tab12 = wxPanel(self.notebook,-1)
        self.s_test = wxButton(self.tab12,-1,"Clear",(20,20))
        self.tab12_child = wxPanel(self.tab12,-1,(0,0),self.tab12.GetSize())
        self.c_test =  
wxTextCtrl(self.tab12_child,-1,"",(130,270),wxSize(800,350),style=wxTE_MULTILINE|wxHSCROLL|wxTE_RICH2|wxTE_RICH)
        self.globalSizer = wx.BoxSizer(wxHORIZONTAL)
        self.globalSizer.Add(self.c_test)
        self.tab12.SetSizer(self.globalSizer)
        self.globalSizer.SetSizeHints(self)
       
        self.notebook.AddPage(self.tab12,"Test Sizers")


Thanks!
Astan



More information about the Python-list mailing list