2011/2/11 Mark Carter <alt.mcar...@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-us...@googlegroups.com ) hth, vbr -- http://mail.python.org/mailman/listinfo/python-list