Mike C. Fletcher wrote:
Have you tried calling self.Layout() on the panel?
Yes; ie.
str = labelwidget.GetLabel() + '\nsome more text'
labelwidget.SetLabel(str)
panel.labelSizer.Fit(labelwidget)
panel.labelSizer.SetSizeHints( label )
panel.Layout()
panel.GetSizer().Fit( self.panel )
then, rather than seeing the new text "underneath" the next
thing on the panel, it's just invisible... <:-(
Good luck,
Thanks...
/Will Sadkin
Parlance Corporation
···
Will Sadkin wrote:
>'ve been beating my head against this one for a while, and
>none of the sizer doc I've read seems to help...
>
>I have a wxStaticText label at the top of a panel that I want
>to dynamically change the contents of, and resize the panel
>accordingly. The label text can contain newlines, but while
>the label itself appears to resize to contain the new text,
>the panel around it does not.
>
>I've tried:
> - recalling .Fit() on the panel,
> - putting the label in question inside its own sizer,
> and then calling .Fit() on the panel,
> - refitting the immediate parent sizer, and then
> the panel sizer, ie:
>
> str = labelwidget.GetLabel() + '\nsome more text'
> labelwidget.SetLabel(str)
> panel.labelSizer.Fit(labelwidget)
> panel.labelSizer.SetSizeHints( label )
> panel.GetSizer().Fit( self.panel )
>
>But still it doesn't work; the label is still overlayed
>by the subsequent stuff on the panel.
>
>What do I have to do to get the sizer/panel to resize
>dynamically and not cut off the new text?
>
>/Will Sadkin
>Parlance Corporation
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail:
wxPython-users-unsubscribe@lists.wxwindows.org
>For additional commands, e-mail:
wxPython-users-help@lists.wxwindows.org
>
>
>
>--
_______________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://members.rogers.com/mcfletch/---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwindows.org