I am having a problem with displaying a list of check boxes in a scrolled window. The scrolled window shows a single item and scrollbars, but I would like the scrolled window to expand to fit the rest of the dialog box.
I'm relatively new to Python, so I am not exactly sure what I am missing here. Any help would be appreciated.
Here is the offending code:
Thanks for the help.
I'm relatively new to Python, so I am not exactly sure what I am missing here. Any help would be appreciated.
Here is the offending code:
Code:
# Attachments --------------------------
sbsizer = wx.StaticBoxSizer(wx.StaticBox(self, -1, 'Card Attachments'), wx.VERTICAL)
sbsizer.Add(wx.StaticText(self, label='Allow cards to be attached to:'), 0, wx.EXPAND|wx.ALL, 5)
self.attachBoxes = {}
swin = wx.ScrolledWindow(self, style=wx.VSCROLL|wx.SUNKEN_BORDER, size=(-1, -1))
swinsizer = wx.BoxSizer(wx.VERTICAL)
for type in database.cardTypes:
chk = wx.CheckBox(swin, label=type)
if type.lower() in settings.attach_ok:
chk.SetValue(True)
self.attachBoxes[type.lower()] = chk
swinsizer.Add(chk, 0, wx.EXPAND|wx.ALL, 2)
swin.SetSizer(swinsizer)
swin.SetScrollbars(0, 10, 0, swinsizer.GetMinSize()[1]/10)
sbsizer.Add(swin, 0, wx.EXPAND|wx.ALL, 5)
psizer.Add(sbsizer, 0, wx.CENTRE|wx.EXPAND|wx.ALL, 4)
Thanks for the help.