ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxpython-users
wxpython-users
Re: [wxpython-users] wx.ScrolledWindow
by Robin Dunn other posts by this author
Jun 3 2009 9:45PM messages near this date
[wxpython-users] wx.ScrolledWindow | [wxpython-users] Re: FINAL NOTICE: Mail list migration
Sofia PT wrote:
>  Hi, I am creating a scrolled parent-panel with some static boxes inside:
>  
>                  self.scroll = wx.ScrolledWindow(self.panel, -1,
>  size=(302,153), style=wx.VSCROLL)
>  		self.scroll.SetScrollbars(1, 79, 150, 153)
>  		self.panel2=wx.Panel(self.scroll,-1)
>  		sizer2=wx.BoxSizer(wx.VERTICAL)
>  		
>                  for doc in dic_sort(RerievalDic)[:4]:
>  			box=wx.StaticBox(self.panel2,-1,"Case History")
>  			sizer21=wx.StaticBoxSizer(box,orient=wx.VERTICAL)
>  			sttext2=wx.StaticText(self.panel2, -1, text, style=wx.ALIGN_CENTER)
>  			sizer21.Add(sttext2)
>  			self.buttonShow = wx.Button(self.panel2, -1, 'Show File', size=(90, 28))
>  			sizer21.Add(self.buttonShow,0, wx.ALIGN_CENTER)
>  			sizer2.Add(sizer21,1)
>  			self.panel2.SetSizer(sizer2)
>  			self.panel2.Fit()
>  			
>  		self.sizersearch.Add(self.scroll,0, wx.ALIGN_CENTER | wx.TOP, 5)
>  
>  With this code every time I add boxes the wx.ScrolledWindow also grows. What
>  I want is to fix the size of the window so It is shown one box at the time
>  and when I scroll it the additional boxes can be seen. I don't know what's
>  wrong, I cant find the mistake, I would appreciate any help. Thanks.

Try it without the panel, just make the other widgets be children of the 
scrolled window.  Then try using FitInside instead of Fit.



-- 
Robin Dunn
Software Craftsman
http://wxPython.org

_______________________________________________
wxpython-users mailing list
wxpython-users@[...].org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Thread:
Sofia PT
Robin Dunn

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved