action on resize main window ?
Christian K
ckkart at hoc.net
Sun Jun 3 05:01:15 PDT 2007
Stef Mientki wrote:
> hello,
>
> I've the following situation
>
> Frame
> |___ SplitterWindow
> |____ Editor
>
>
> Now I want to resize the Editor, so it always fits into a certain part
> of the SplitterWindow.
>
> So I catch the Splitter changing, which works perfect
>
> self.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.OnSplitter)
> def OnSplitter (self, event):
> ( w, h ) = self.Splitter.GetClientSize()
> w = self.Splitter.GetSashPosition()
> self.Code_Editor.SetClientSizeWH ( w - 22, h - bh - 23 )
>
> Now I also want to catch the resize of the total window (Frame), by
>
> self.Bind ( wx.EVT_SIZE, self.OnResize )
> def OnResize (self, event):
> ( w, h ) = self.Splitter.GetClientSize()
> w = self.Splitter.GetSashPosition()
> self.Code_Editor.SetClientSizeWH ( w - 22, h - bh - 23 )
>
> But then the automatic resizing of the SplitterWindow is lost.
This sounds like putting 'event.Skip()' somewhere in your event handler should help.
Christian
More information about the wxpython-users
mailing list