Hi,
I am having (more) trouble with sizers. I have previously made a small gui that worked as I wanted, however, trying to replicate the structure I used on that is resulting in different behaviour. Here is a peice of the old working code. The main problem is that topPanel.SetSizer(masterBoxSizer) does not work for me in my new code. What I would like to know is, is this code wrong, what is the proper way to set these sizers and lay them up codewise. Are there any suggestions for more robust coding here. wxGlade puts out a whole string of commands that I do not use because when I incorporate them into my code they don't work. I wish I could get a handle on sizers cause it causes so many problems with making new GUI's!
Any help appreciated, if you would like a wiser snippet of the code please let me know.
#Create a master boxSizer
masterBoxSizer = wx.BoxSizer(wx.VERTICAL)
btnBoxSizer = wx.BoxSizer(wx.HORIZONTAL)
fgs = wx.FlexGridSizer(4, 2, 10, 10)
#layout masterBoxSizer
masterBoxSizer.Add(titleTxt, 0, wx.ALL | wx.ALIGN_CENTER)
masterBoxSizer.Add(fgs, 0, wx.ALL | wx.ALIGN_CENTER)
masterBoxSizer.Add(btnBoxSizer, 0, wx.ALL | wx.ALIGN_CENTER)
#layout btnBoxSizer
btnBoxSizer.Add(closeBtn, 1, wx.ALL, 1)
btnBoxSizer.Add(applyBtn, 1, wx.ALL, 1)
#layout fgs
fgs.Add(sceneTxt, 0)
fgs.Add(sceneCB, 0)
fgs.Add(shotTxt, 0, wx.EXPAND)
fgs.Add(shotCB, 1, wx.EXPAND)
fgs.Add(versionTxt, 0, wx.EXPAND)
fgs.Add(versionCB, 1, wx.EXPAND)
fgs.AddGrowableCol(0)
fgs.AddGrowableRow(0)
fgs.AddGrowableCol(1)
fgs.AddGrowableRow(1)
topPanel.SetSizer(masterBoxSizer)
regards,
aaron.