wxEVT_SIZE problem

Well, if you assign a method to bind an event like wx.EVT_SIZE to your panel, then you have 2 options (at least):

  1. Call event.Skip() and let the (eventual) sizers present in the panel have a chance to do their job (layout the items): if you call event.Skip() all the sizer things are processed just after that;

  2. Don’t call event.Skip() and then it’s up to you to layout the items and doing sizer’s job (highly not-recommended, unless you know what you are doing :slight_smile: )

I may missing something here, surely some other poster (more brilliant than me) will suggest a better explanation :slight_smile:

Andrea.

···

Andrea Gavana
(gavana@kpo.kz)

Reservoir Engineer

KPDL

4, Millbank

SW1P 3JA London

Direct Tel: +44 (0) 20 717 08936

Mobile Tel: +44 (0) 77 487 70534

Fax: +44 (0) 20 717 08900

Web:
http://xoomer.virgilio.it/infinity77

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯


From: Keith [mailto:python@cgcreator.com]
Sent: 21 April 2006 16:05
To:
wxPython-users@lists.wxwidgets.org
Subject: RE: [wxPython-users] wxEVT_SIZE problem

Worked like a charm thanks…. Why is that?


From: Gavana, Andrea [mailto:gavana@kpo.kz]
Sent: Saturday, April 22, 2006 12:57 AM
To:
wxPython-users@lists.wxwidgets.org
Subject: RE: [wxPython-users] wxEVT_SIZE problem

Hello Keith,

  probably it won't work, but are you calling event.Skip() at the end of your wx.EVT_SIZE bind method?

Andrea.


** Andrea Gavana** (gavana@kpo.kz)

  • Reservoir Engineer*

KPDL

4, Millbank

SW1P 3JA London

Direct Tel: +44 (0) 20 717 08936

Mobile Tel: +44 (0) 77 487 70534

Fax: +44 (0) 20 717 08900

Web: http://xoomer.virgilio.it/infinity77

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯


From: Keith [mailto:python@cgcreator.com]
Sent: 21 April 2006 15:53
To:
wxPython-users@lists.wxwidgets.org
Subject: [wxPython-users] wxEVT_SIZE problem

I’m creating an interface that is only using one panel and a bunch of children sizers… basically the sizers are used to calculate size and position in the window… and then using that information to draw back on the parent panel… ands its been working fine. but as soon as I assign a wx.EVT_SIZE to the panel all my sizers don’t work… they stop calculating their size and position… the main panel still registers the full size of the window though… its like when I bind to that event its overriding some built in size calculation for the children… any thoughts?

Gavana, Andrea wrote:

Well, if you assign a method to bind an event like wx.EVT_SIZE to your panel, then you have 2 options (at least):
1) Call event.Skip() and let the (eventual) sizers present in the panel have a chance to do their job (layout the items): if you call event.Skip() all the sizer things are processed just after that;
2) Don't call event.Skip() and then it's up to you to layout the items and doing sizer's job (highly not-recommended, unless you know what you are doing :slight_smile: )
I may missing something here, surely some other poster (more brilliant than me) will suggest a better explanation :slight_smile:

To put it another way, the default EVT_SIZE handler is where the layout of the sizers is triggered. When you bind your own handler to EVT_SIZE and don't call evt.Skip() then you are preventing the default handler from being executed. Calling evt.Skip() tells the event processing system to continue searching for a matching event binding.

BTW, there is a #3 for the list above, you can just call self.Layout() from your EVT_SIZE handler.

···

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