wx.Frame hidden, and customising the close button

M

Mark Carter

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?
 
V

Vlastimil Brom

2011/2/11 Mark Carter said:
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?
Hi,
For testing whether the frame is shown, you can simply use frm.IsShown()
[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 by Example
"Adding an Event Handler"

(wxPython-specific questions may be rather discussed on that maillist:
http://groups.google.com/group/wxpython-users/topics?pli=1

(e-mail address removed) )

hth,
vbr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,440
Latest member
YoungBorel

Latest Threads

Top