By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,222 Members | 2,416 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,222 IT Pros & Developers. It's quick & easy.

Panel problems

P: n/a
Howdy,
I am having some problems woth sizers adding panels to a
scrolledwindow.

I have 3 classes (wx.Panels) which I want to add to a ScrolledWindow
(The Parent). I can get it to work except the ScrollWindow never
scrolls.
Also as I am new to (wx)Python, so I am sure it is a simple mistake.
But what I cannot figure out is the creation order of Frames to Panels
to Windows, sizers, blah...Is this infomation laid out some where?

Any help would be apperciated.
class MyFrame(wx.Frame):
def __init__(self, parent, ID, title):
wx.Frame.__init__(self, parent, ID, title,
style=wx.DEFAULT_FRAME_STYLE
| wx.CLIP_CHILDREN
| wx.NO_FULL_REPAINT_ON_RESIZE)

self.MaintPanel = wx.ScrolledWindow(self, -1,
style=wx.SUNKEN_BORDER
| wx.CLIP_CHILDREN)
self.MaintPanel.SetScrollRate(10, 10)

# Do I need another Sizer in here somewhere??

#Parent Sizer
#self.mainsizer = wx.BoxSizer(wx.VERTICAL)
#self.SetSizer(self.mainsizer)
#self.SetSize(( 700, 600 ))
#self.Centre()

self.subsizer = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(self.subsizer)
self.SetSize(( 700, 600 ))
self.Centre()

# Add subPanels
# All of the sub panels work fine
pnl1 = subPanel1(self)
pnl2 = subPanel2(self)
pnl3 = subPanel3(self)

self.subsizer.AddMany([ (pnl1, 1, wx.EXPAND),
(pnl2, 1, wx.EXPAND),
(pnl3, 1, wx.EXPAND)])

# Add Main Panel
self.MaintPanel.SetAutoLayout(True)
self.MaintPanel.SetSizer(self.subsizer)

self.Layout()

Thanks in advance
Scott

Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.