Autogrow on panel

Hi, I'm just picking up the wxPython stuff for the new project I'm on.
Really like it so far, but have newbie like questions.

I'm using a panel to basically build a set of labels and textboxes (with the
flexgridsizer). The number of these textbox/label combinations is variable
based on user selection.

Is ther a way to get a wxPanel (or scrolledpanel) to stretch vertically,
rather than scroll? I'd like it to stretch vertically and have its parent
window have the scrollbar.

I can do it by having the wxScrollingPanel, but it looks clunky; I'd rather
just put the panel into the window and have the content pane of the handle
the scrolling.

Thanks for any insight.

Tim

Tim Royal wrote:

Hi, I'm just picking up the wxPython stuff for the new project I'm on.
Really like it so far, but have newbie like questions.

I'm using a panel to basically build a set of labels and textboxes (with the
flexgridsizer). The number of these textbox/label combinations is variable
based on user selection.

Is ther a way to get a wxPanel (or scrolledpanel) to stretch vertically,
rather than scroll? I'd like it to stretch vertically and have its parent
window have the scrollbar.

I can do it by having the wxScrollingPanel, but it looks clunky; I'd rather
just put the panel into the window and have the content pane of the handle
the scrolling.

Yes, this should work. Make the panel be a child of a wxScrolledWindow and the controls as children of the panel. When you add new items to the sizer call sizer.Fit(panel) and then get the size of hte panel and SetVirtualSize of the scrolled window with that size.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!