Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #55931
| References | <03497879-b376-4d66-8c3b-93fb5b0fbbd3@d16g2000yqd.googlegroups.com> |
|---|---|
| Date | 2011-02-11 14:39 +0100 |
| Subject | Re: wx.Frame hidden, and customising the close button |
| From | Vlastimil Brom <vlastimil.brom@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.100.1297431566.1633.python-list@python.org> (permalink) |
2011/2/11 Mark Carter <alt.mcarter@gmail.com>: > Is there a way of testing whether a frame (suppose I have it as a > variable my_frame) is hidden in wxPython? > > Also, is there a way that I can over-ride the close button so that the > frame becomes hidden rather than destroyed, and perform supplementary > tests? > -- > http://mail.python.org/mailman/listinfo/python-list > Hi, For testing whether the frame is shown, you can simply use frm.IsShown() >>> my_frame.IsShown() True >>> [here shown with a shell connected to that frame] To intercept closing the window using a clicks on the "x icon" catch the respective event wx.EVT_CLOSE Check the sample e.g. in http://wiki.wxpython.org/wxPython%20by%20Example "Adding an Event Handler" (wxPython-specific questions may be rather discussed on that maillist: http://groups.google.com/group/wxpython-users/topics?pli=1 wxpython-users@googlegroups.com ) hth, vbr
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
wx.Frame hidden, and customising the close button Mark Carter <alt.mcarter@gmail.com> - 2011-02-11 04:52 -0800
Re: wx.Frame hidden, and customising the close button Vlastimil Brom <vlastimil.brom@gmail.com> - 2011-02-11 14:39 +0100
Re: wx.Frame hidden, and customising the close button Mark Carter <alt.mcarter@gmail.com> - 2011-02-11 06:12 -0800
csiph-web