EVT_MAXIMIZE problem

According to http://www.wxpython.org/docs/api/wx.MaximizeEvent-class.html,
“An EVT_MAXIMIZE event is sent when a frame is maximized or
restored.”

However, when I bind to the event, it only gets called during maximize
and not during restore. See attached sample. Tested using Windows XP, python
2.5, wxpython 2.8.7.1

-Kyle Rickey

maximize test.py (587 Bytes)

Rickey, Kyle W wrote:

According to wxPython API Documentation — wxPython Phoenix 4.2.2 documentation, “An EVT_MAXIMIZE event is sent when a frame is maximized or restored.”

However, when I bind to the event, it only gets called during maximize and not during restore. See attached sample. Tested using Windows XP, python 2.5, wxpython 2.8.7.1

This was recently brought up on wx-dev and it was decided that it is a documentation error. To find out when the frame is restored you can hook into the EVT_SIZE event since it will be sent at least once during the un-maximization process.

···

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

Thanks Robin, that worked well. This allows me to keep track of a
variable for maximization, so when I exit the app, I can restore it
later. Thanks for your help. Here's the code in case anyone is
interested.

self.Bind(wx.EVT_SIZE, self.OnResizeWindow)

def OnResizeWindow(self, event):
  if self.IsMaximized():
    self.maximized = 1
  else:
    self.maximized = 0
  event.Skip()

-Kyle Rickey

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Friday, January 04, 2008 6:06 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] EVT_MAXIMIZE problem

Rickey, Kyle W wrote:

According to
wxPython API Documentation — wxPython Phoenix 4.2.2 documentation, "An
EVT_MAXIMIZE event is sent when a frame is maximized or restored."

However, when I bind to the event, it only gets called during maximize

and not during restore. See attached sample. Tested using Windows XP,
python 2.5, wxpython 2.8.7.1

This was recently brought up on wx-dev and it was decided that it is a
documentation error. To find out when the frame is restored you can
hook into the EVT_SIZE event since it will be sent at least once during
the un-maximization process.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org