wx.ScrolledWindow problem

Joined
Dec 4, 2008
Messages
1
Reaction score
0
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:

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top