Bug in Frame.IsIconized on wxGTK?

Hi,

The attached program prints False on wxGTK (Fedora 8, Python 2.5.1,
wxPython 2.8.8.1-unicode) and True on wxMAC (Max OS X 10.4, Python
2.5, wxPython 2.8.7.1-unicode). Am I missing something or is this a
bug?

--- iconize.py ---
import wx

app = wx.App()
frame = wx.Frame(None)
frame.Show()
frame.Iconize()
print frame.IsIconized()
app.MainLoop()

iconize.py (118 Bytes)

···

-----------------------

Cheers, Frank

On Windows (Python 2.5.1, wxPython 2.8.7.1-unicode) it returns True as well.

Cheers, Frank

···

2008/9/28 Frank Niessink <frank@niessink.com>:

Hi,

The attached program prints False on wxGTK (Fedora 8, Python 2.5.1,
wxPython 2.8.8.1-unicode) and True on wxMAC (Max OS X 10.4, Python
2.5, wxPython 2.8.7.1-unicode). Am I missing something or is this a
bug?

--- iconize.py ---
import wx

app = wx.App()
frame = wx.Frame(None)
frame.Show()
frame.Iconize()
print frame.IsIconized()
app.MainLoop()
-----------------------

Frank Niessink wrote:

Hi,

The attached program prints False on wxGTK (Fedora 8, Python 2.5.1,
wxPython 2.8.8.1-unicode) and True on wxMAC (Max OS X 10.4, Python
2.5, wxPython 2.8.7.1-unicode). Am I missing something or is this a
bug?

--- iconize.py ---
import wx

app = wx.App()
frame = wx.Frame(None)
frame.Show()
frame.Iconize()
print frame.IsIconized()
app.MainLoop()
-----------------------

On Windows (Python 2.5.1, wxPython 2.8.7.1-unicode) it returns True as well.

Sorry, I thought I answered this already, but I don't see my planned response in the archives...

The issue here is that on wxGTK the frame is not actually iconized (or shown, or etc.) until some internal events are able to be processed. So yes, at the moment in time that you call IsIconized above the frame is not iconized, but it will be soon. Unfortunately there is no WillBeIconizedSoon API. :wink:

I've attached a modified sample that demonstrates this theory.

iconize.py (163 Bytes)

···

2008/9/28 Frank Niessink <frank@niessink.com>:

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