Minimize/Maximize a frame under program control

I certainly feel I should have figured this out from the wx documentation but I failed: What I want to do is to execute statements to do what the user can do by clicking the minimize box to reduce the Frame to an icon, or clicking the minimized icon to restore the Frame to being visible. I’d also like to be able under program control to make the Frame be full-screen or to return from full-screen to the smaller size, again what the user can do by clicking the size box.

I certainly feel I should have figured this out from the wx documentation
but I failed: What I want to do is to execute statements to do what the
user can do by clicking the minimize box to reduce the Frame to an icon, or
clicking the minimized icon to restore the Frame to being visible. I'd also
like to be able under program control to make the Frame be full-screen or
to return from full-screen to the smaller size, again what the user can do
by clicking the size box.

I believe they are (but try them; I'm sort of mixing memory and wxWidgets
docs):

frame.Iconize()
frame.Raise()
frame.Maximize()
frame.Restore()

Che

···

On Thu, Apr 24, 2014 at 11:50 PM, Bruce Sherwood <bruce.sherwood@gmail.com>wrote:

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Many thanks!

I don’t know what frame.Raise() does; it doesn’t give an error but I don’t see anything happen. I find that frame.Restore() returns from frame.Maximize() or from frame.Iconize().

I’m greatly puzzled that the documentation for frame at

http://docs.wxwidgets.org/2.8/wx_wxframe.html#wxframe

says nothing about these functions. Where would I look for the reference material on these functions?

Many thanks!

I don't know what frame.Raise() does; it doesn't give an error but I don't
see anything happen. I find that frame.Restore() returns from
frame.Maximize() or from frame.Iconize().

Sorry, I think I was confused at what .Raise() is for. Apparently it
raises any window in terms of the z-order (if something is below or above
something in the z axis).

I'm greatly puzzled that the documentation for frame at

wxFrame

says nothing about these functions. Where would I look for the reference
material on these functions?

Ahh, this is a key point and puzzled me at one point, too: you have to
look higher in the hierarchy of objects in the wx documentation. So, yes,
it's not under wxFrame, but wxFrame (as, I think wxDialog) is derived from
wxTopLevelWindow, and you will find these methods there:

http://docs.wxwidgets.org/2.8/wx_wxtoplevelwindow.html#wxtoplevelwindow

A good rule is: if you don't find the method you want, go to a more
"general" object, above it in the hierarchy, and you will probably find it
there.

Che

···

On Fri, Apr 25, 2014 at 1:05 AM, Bruce Sherwood <bruce.sherwood@gmail.com>wrote:

linux have Minimize/Maximize issue
Windows should work fine. Please confirm with windows.

···

2014-04-25 13:45 GMT+08:00 C M cmpython@gmail.com:

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


jiang zhixiang

On Fri, Apr 25, 2014 at 1:05 AM, Bruce Sherwood bruce.sherwood@gmail.com wrote:

Many thanks!

I don’t know what frame.Raise() does; it doesn’t give an error but I don’t see anything happen. I find that frame.Restore() returns from frame.Maximize() or from frame.Iconize().

Sorry, I think I was confused at what .Raise() is for. Apparently it raises any window in terms of the z-order (if something is below or above something in the z axis).

I’m greatly puzzled that the documentation for frame at

http://docs.wxwidgets.org/2.8/wx_wxframe.html#wxframe

says nothing about these functions. Where would I look for the reference material on these functions?

Ahh, this is a key point and puzzled me at one point, too: you have to look higher in the hierarchy of objects in the wx documentation. So, yes, it’s not under wxFrame, but wxFrame (as, I think wxDialog) is derived from wxTopLevelWindow, and you will find these methods there:

http://docs.wxwidgets.org/2.8/wx_wxtoplevelwindow.html#wxtoplevelwindow

A good rule is: if you don’t find the method you want, go to a more “general” object, above it in the hierarchy, and you will probably find it there.

Che

All worked fine on Windows. Haven’t tested on other platforms yet. In the future I’ll be sure to look at classes from which a class inherits. Thanks again!