The following simplest code demonstrates the arrangement of nested
sizers I need. The text control from the RowColSizer should appear under
that in the wxFlexGridSizer. Insted of that it is shifted up and right
(to the area of the title) on my system (WindowsNT, Python-2.2.1,
wxPython-2.3.3pre3).
Is that a bug or did I misused something?
from wxPython.wx import *
from wxPython.lib import rcsizer
class myframe(wxFrame):
def __init__(self):
wxFrame.__init__(self, None, -1, 'test')
panel = wxPanel(self, -1)
panel.SetAutoLayout(true)
left = wxPanel(panel, -1)
left.SetAutoLayout(true)
ctrl1 = wxTextCtrl(left, -1, 'in wxFlexGridSizer')
grid1 = wxFlexGridSizer()
grid1.Add(ctrl1)
ctrl2 = wxTextCtrl(left, -1, 'in RowColSizer')
grid2 = rcsizer.RowColSizer()
grid2.Add(ctrl2, pos=(0,0))
border = wxBoxSizer(wxVERTICAL)
border.Add(wxStaticText(left, -1, 'Title'), 0,
wxALL>wxALIGN_CENTER, 10)
border.Add(grid1, 0, wxLEFT|wxRIGHT, 10)
border.Add(grid2, 0, wxLEFT|wxRIGHT, 10)
left.SetSizer(border)
border.Fit(left)
right = wxPanel(panel, -1)
right.SetBackgroundColour(wxGREEN)
main_sizer = wxBoxSizer(wxHORIZONTAL)
main_sizer.Add(left, 0, wxEXPAND)
main_sizer.Add(right, 1, wxEXPAND)
panel.SetSizer(main_sizer)
self.Show(true)
class App(wxApp):
def OnInit(self):
frame = myframe()
self.SetTopWindow(frame)
return true
app = App()
app.MainLoop()
···
--
Géza Groma
Institute of Biophysics,
Biological Research Center of Hungarian Academy of Sciences
Temesvári krt.62.
6726 Szeged
Hungary
phone: +36 62 432 232
fax: +36 62 433 133