[wxPython-users] Re: action on resize main window ?

Andrea Gavana andrea.gavana at gmail.com
Sun Jun 3 07:24:22 PDT 2007


Hi Stef,

On 6/3/07, Stef Mientki wrote:
>
>
> Christian K wrote:
> > 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.
> >
> thanks Cristian,
> but it just gave compiler errors :-(
>
> I tried to insert the skip event in the Resize Handler,
>
>    event.skip()
> AttributeError: 'SizeEvent' object has no attribute 'skip'
>
> I assume also that I've to do the skip only in certain cases,
> am I right ?

I believe you are missing the capital "S" in front of "Skip()". It should be:

event.Skip()

and not:

event.skip()

:-D :-D

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/




More information about the wxpython-users mailing list