programmatically minimizing a window

Hey everyone,

I am in a situation where I need to programmatically minimize a
window. Looking at the API, there is no Minimize method (there is a
Maximize method with a boolean to determine whether to maximize or
restore the window). Does anyone have any ideas?

- Josiah

Related followup question...

Now that I can programmatically minimize/restore a window, on OSX it
doesn't seem as if there is a way of discovering if/when an
application is minimized, restored, or maximized by the user.
According to the docs on wxIconizeEvent, iconization information is
only available on MSW/GTK. The docs don't mention anything about
wxMaximizeEvent, yet I'm not seeing any when I restore/maximize, so I
suspect the same limitation holds.

Using IsShown() or IsShownOnScreen() always returns true.

Does anyone know of a method of discovering whether or not a window
has been minimized in OSX?

- Josiah

···

On Fri, Jun 20, 2008 at 7:02 PM, Josiah Carlson <josiah.carlson@gmail.com> wrote:

On Fri, Jun 20, 2008 at 6:05 PM, Robin Dunn <robin@alldunn.com> wrote:

Josiah Carlson wrote:

Hey everyone,

I am in a situation where I need to programmatically minimize a
window. Looking at the API, there is no Minimize method (there is a
Maximize method with a boolean to determine whether to maximize or
restore the window). Does anyone have any ideas?

See Iconize()

Ahh, perfect. Thank you :slight_smile:

- Josiah

Josiah,

Hey everyone,

I am in a situation where I need to programmatically minimize a
window. Looking at the API, there is no Minimize method (there is a
Maximize method with a boolean to determine whether to maximize or
restore the window). Does anyone have any ideas?

- Josiah

I think you want self.Iconize(True). I just tried it and it worked in my toy program.

···

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org

Hi Josiah,

···

2008/6/21 Josiah Carlson <josiah.carlson@gmail.com>:

Does anyone know of a method of discovering whether or not a window
has been minimized in OSX?

Is wx.TopLevelWindow.IsIconized() what you are looking for?

Cheers, Frank

The IsIconized() method works on OS X, so I'm just going to hook a
wx.Timer() instance to look for transitions and signal on change. I'm
pretty sure it also works on Windows, but I'll test that later
today/tomorrow.

- Josiah

···

On Mon, Jun 23, 2008 at 6:34 AM, Mike Rooney <mxr@qvii.com> wrote:

Josiah Carlson wrote:

Does anyone know of a method of discovering whether or not a window
has been minimized in OSX?

Just to throw this out there, have you looked at the window position in this
state? On Windows it is -32000, -32000, so that gives it away. Maybe
something similar happens on OSX.

Just to throw this out there, have you looked at the window position in this

state? On Windows it is -32000, -32000, so that gives it away. Maybe

something similar happens on OSX.

I presume you mean “on modern versions of Windows.” In earlier versions (98 that I’m aware of, maybe as late as Me) the minimized position was not as far away - with the interesting result that if you hooked up multiple monitors and extended your desktop, you could see the minimized windows! I’ve forgotten now whether they showed up at the lower left or the upper right - I seem to remember it was actually the upper right.

In any case, that value of (-32000, -32000) was a patch, so it definitely would NOT work as a check for earlier versions.

The IsIconized() method works on OS X, so I’m just going to hook a

wx.Timer() instance to look for transitions and signal on change. I’m

pretty sure it also works on Windows, but I’ll test that later

today/tomorrow.

Please let us know!

···

On Mon, Jun 23, 2008 at 6:34 AM, Mike Rooney mxr@qvii.com wrote:


www.fsrtechnologies.com