From: Steve F. <sf...@ih...> - 2006-07-06 04:29:06
|
Great, thanks for the tip. That's interesting. Before I discovered singleItemExpandingSizerLayout() (say that five times fast), I was using on_size() to adjust the size of StaticBox1 when the window size changed, but the redraws weren't coming through. Until, that is, I added event.skip(). So it seems like for proper handling of most general events (IOW, events not aimed at specific components), calling event.skip() at the end of the function is a good idea, no? Steve On Thu, 2006-07-06 at 00:59 +0100, Alex Tweedly wrote: > Steve Freitas wrote: > > >Hi, > > > >For debugging let's say I put a method "on_size(self, event)" in my > >class, and it prints some stuff. Well, I noticed when playing with > >model.Background.singleItemExpandingSizerLayout(), if I provide an > >on_size(), then the resizing doesn't happen. So I tried... > > > >class Test(model.Background): > > def on_initialize(self, event): > > self.singleItemExpandingSizerLayout() > > > > def on_size(self, event): > > print self.size, self.c.StaticBox1.size > > super(Test, self).on_size(self, event) # This didn't work > > model.Background.on_size(self, event) # Nor this > > > > > > >So when I want to respond to an event but then toss the event back up > >afterward for normal handling, how do I do that? > > > > > > > def on_size(self, event): > print self.size, self.c.StaticBox1.size > event.skip() > > Actually, event.Skip() also seems to work - not 100% sure which is "correct" :-) > > > > -- > Alex Tweedly http://www.tweedly.net > > > |