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
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
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 ?
cheers,
Stef Mientki
···
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
Hi Stef,
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()

Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
···
On 6/3/07, Stef Mientki wrote:
I believe you are missing the capital "S" in front of "Skip()". It should be:
event.Skip()
and not:
event.skip()

Andrea.
thanks Andrea,
that was indeed the problem,
now it works.
The obvious is often so far away 
cheers,
Stef