[wxPython-users] wx.SplitterWindow not resizing with parent Frame ?

Saketh Bhamidipati saketh.bhamidipati at gmail.com
Thu Jun 29 06:30:51 PDT 2006


On 6/29/06, Anders Wallin <anders.wallin at helsinki.fi> wrote:
>
> >   Actually, you don't need to. Menubar, toolbar and statusbar don't
> > count. The only other control in the frame will occupy all the frame's
> > remaining client area. But only if you don't bind your own handler to
> > EVT_SIZE. In this case, you'll need to call somethings like
> >    self.theMainPanel.SetSize(self.GetClientSizeTuple())
> >   inside your handler. The sizers don't work also, if EVT_SIZE is
> > overridden, so you should call self.Layout() in the handler.
>
> This is it !
>
> For the Frame, I had:
> self.Bind(wx.EVT_SIZE, self.OnSize)
>
> and then:
>   def OnSize(self, event):
>         size =3D event.GetSize()
>         print "size:", size.width, size.height
>
> If I remove the bind statement the splitterwindow resizes correctly.
>
> What should I put in OnSize() so that the splitterwindow will resize
> correctly again ? I have tried with
>         self.Layout()
>         self.sp.Layout()
>         self.p1.Layout()
>         self.p2.Layout()
> but they have no effect...
>
>
> AW
>
> PS. why is the behavior of print different with different demo programs I
> try ? Some write to the python prompt, some open a separate
> wxPython:stdout/sterr window although the code is very similar ??
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
> In my work with splitters, the splitter resizes correctly even though I
didn't bind it to EVT_SIZE. I don't think you need SP_LIVE_UPDATE as a style
option.

self.splitter =3D wx.SplitterWindow(self, style =3D wx.SIMPLE_BORDER)

That worked for me. Look at my past replies for more code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200606=
29/14efe163/attachment.htm


More information about the wxpython-users mailing list