It seems that GetSizer always returns None
for a wxNotebook, even if the notebook has
a sizer. Run the code below for an example.
(Note that this only works with the recent
fix for GetSizer() in windows.py. I.e.,
insert "from sizers import wxSizerPtr"
after line 484.) Is this because notebook
sizers are special? Could this be changed?
I am trying to do recursive SetItemMinSize()
by way of win.GetChildren() and win.GetSizer().
Unfortunately, an embedded notebook causes
the algorithm to fail.
Ralf
from wxPython.wx import *
class MyApp(wxApp):
def OnInit(self):
main_frame = wxFrame(NULL, -1, 'Main Frame', size = wxSize(400, 400))
nb_win = wxNotebook(main_frame, -1)
nb_szr = wxNotebookSizer(nb_win)
nb_win.SetAutoLayout(true)
subp_win = wxPanel(nb_win, -1)
subp_szr = wxBoxSizer(wxVERTICAL)
subp_win.SetAutoLayout(true)
subp_win.SetSizer(subp_szr)
btn = wxButton(subp_win, -1, 'Button')
subp_szr.Add(btn, 0, wxALL, 10)
subp_szr.Fit(subp_win)
nb_win.AddPage(subp_win, 'Page 1')
nb_szr.Fit(nb_win)
print nb_win.GetSizer()
print subp_win.GetSizer()
main_frame.Show(true)
self.SetTopWindow(main_frame)
return true
app = MyApp(0)
app.MainLoop()
--== Sent via Deja.com http://www.deja.com/ ==--
Before you buy.