import wx

wordlist = "Marley was dead to begin-with-There is no doubt whatever"\
"about that The register of his burial was signed by the clergyman the"\
"clerk the undertaker and the chief mourner".split()

class Frame(wx.Frame):

	def __init__(self):

		wx.Frame.__init__(self,None,-1,"Title",size=wx.Size(300,400))

		scroll = wx.ScrolledWindow(self,-1)
		sizer1 = wx.BoxSizer(wx.VERTICAL)

		dy = 0
		x  = 0
		y  = 0

		for word in wordlist:
			button = wx.Button(scroll,-1,label=word,pos=(x,y))
			w,h = button.GetSizeTuple()
			dy  = h + 0
			y   = y + dy
			sizer1.Add(button,0,wx.EXPAND)

		scroll.SetScrollbars(0,dy,0,y/dy+1)
                scroll.SetSizer(sizer1)

                w = sizer1.CalcMin().width + \
                    wx.SystemSettings.GetMetric(wx.SYS_VSCROLL_X) + 2
		self.SetClientSize((w, 400))

		self.Show(1)

#######################

app = wx.App(redirect=0)
frame = Frame()
frame.Show()
app.MainLoop()
