action on resize main window ?

Stef Mientki s.mientki at ru.nl
Sun Jun 3 03:11:44 PDT 2007


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.

So probably I'm overloading the OnResize event,
and I should do something like (what in Delphi is called) "inherited" 
the orginal action on resize.

Is there something like  "inherited" ?
Is there a better (simple) way to achieve the same ?

thanks,
Stef Mientki




More information about the wxpython-users mailing list