Minimize/Maximize a frame under program control

268 views
Skip to first unread message

Bruce Sherwood

unread,
Apr 24, 2014, 11:50:21 PM4/24/14
to wxpytho...@googlegroups.com
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.

C M

unread,
Apr 25, 2014, 12:12:59 AM4/25/14
to wxpytho...@googlegroups.com
On Thu, Apr 24, 2014 at 11:50 PM, Bruce Sherwood <bruce.s...@gmail.com> wrote:
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


--
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-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bruce Sherwood

unread,
Apr 25, 2014, 1:05:48 AM4/25/14
to wxpytho...@googlegroups.com
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?

C M

unread,
Apr 25, 2014, 1:45:22 AM4/25/14
to wxpytho...@googlegroups.com
On Fri, Apr 25, 2014 at 1:05 AM, Bruce Sherwood <bruce.s...@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

Rill

unread,
Apr 25, 2014, 3:19:14 AM4/25/14
to wxPython-users
linux have Minimize/Maximize issue
Windows should work fine. Please confirm with windows.


--
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-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
jiang zhixiang

Bruce Sherwood

unread,
Apr 27, 2014, 1:39:59 AM4/27/14
to wxpytho...@googlegroups.com
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!
Reply all
Reply to author
Forward
0 new messages