My problem is that the the minimum size (now) is set correctly, however it proves to be too small because the scrolledpanel insists om putting in scrollbars, taking away real estate, so the scrollbars are needed.
How can I tell the ScrolledPanel NOT to put them in if it has all the space it needs (because the frame will gladly grow around it)? (there must be some flags for it but I can not find them in the docs.)
Paul
Robin Dunn wrote:
···
Paul Melis wrote:
Hello,
I'm doing some graphic stuff on a wx.lib.scrolledpanel.ScrolledPanel, but I'm having trouble with making the panel keep a minimum size.
I have a subclass MyPanel of ScrolledPanel, of which an overridden OnPaint method does the drawing. I also use SetMinSize and SetSize in the constructor (currently set to (400,300)).
A MyPanel instance is added to a wx.Frame and assigned to a vertical box sizer.
No matter what I try I can't get the frame to observe any minimum size of the drawing panel, i.e. I can make the frame smaller than the minimum size I specified for the panel.
How can I make it observe a minimum size requirement? I've tried fiddling with sizer.SetItemMinSize() and some other things, but nothing works.
sizer.SetSizeHints(frame)
--
Paul Sijben tel: +31334566488
Eemvalley Technology fax: +31334557523
the Netherlands http://eemvalley.com
My problem is that the the minimum size (now) is set correctly, however it proves to be too small because the scrolledpanel insists om putting in scrollbars, taking away real estate, so the scrollbars are needed.
How can I tell the ScrolledPanel NOT to put them in if it has all the space it needs (because the frame will gladly grow around it)? (there must be some flags for it but I can not find them in the docs.)
Give the ScrolledPanel a min size.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
SetMinSize did not work for me but after some trial and error I found this work:
p=scrolled.ScrolledPanel(panel)
content=wx.FlexGridSizer(....
<snip>
p.SetSizer(content)
w,h=p.GetBestVirtualSize()
p.SetInitialSize((w+20,h+20))
content.SetSizeHints(p.GetParent())
p.SetupScrolling()
Robin Dunn wrote:
···
Paul Sijben wrote:
My problem is that the the minimum size (now) is set correctly, however it proves to be too small because the scrolledpanel insists om putting in scrollbars, taking away real estate, so the scrollbars are needed.
How can I tell the ScrolledPanel NOT to put them in if it has all the space it needs (because the frame will gladly grow around it)? (there must be some flags for it but I can not find them in the docs.)
Give the ScrolledPanel a min size.
--
Paul Sijben tel: +31334566488
Eemvalley Technology fax: +31334557523
the Netherlands http://eemvalley.com