[wxPython-users] eventSkip() (was: wx.SplitterWindow .. )

Robin Dunn robin at alldunn.com
Sat Jul 1 11:43:46 PDT 2006


Anders Wallin wrote:
>>> Skip() makes the Event handlers of the parent classes run also ?
>> It instructs the event system to continue looking for a handler of the 
>> event after the current handler returns.  So yes, it will look in the 
>> base class for a handler, or if the type of the event is one that 
>> propagates up the containment hierarchy then it will eventually look at 
>> parent windows too.
> 
> what about event handlers for child objects ?
> 
> Now I have a frame, inside the frame I have a splitterwindow, inside the 
> splitterwindow I have a panel, and inside the panel I have a GLCanvas.
> 
> My problem is that the GLCanvas does not size/resize correctly. It 
> initializes as 20x20 pixels and stays that way.
> The problem is probably that the GLCanvas never receives EVT_SIZE events. I 
> checked this by binding EVT_SIZE to a simple print statement and it never 
> gets called.

The frame will autosize the splitter if it is the only child of the 
frame.  Likewise, the splitter will resize its two children to fill the 
2 panes of the splitter.  However the panel does not have any built-in 
child autosize behavior, so you need to give it a sizer and add the 
GLCanvas to the sizer.


> The event handler for the frame gets called, and apparently the event 
> handler for the splitterwindow also gets called since it resizes correctly.
> I don't know how to check that the event handlers for the panels work, but 
> it seems that if I bind the GLCanvas wx.EVT_SIZE to a function, that 
> function will never get called ? I wonder why ?

Because there is nothing that is causing its SetSize to be called.  Put 
it in a sizer then it will manage the size and call SetSize as needed to 
fulfill the sizer algorithm.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list