wx.Frame hidden, and customising the close button

Discussion in 'Python' started by Mark Carter, Feb 11, 2011.

  1. Mark Carter

    Mark Carter Guest

    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?
    Mark Carter, Feb 11, 2011
    #1
    1. Advertising

  2. 2011/2/11 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?
    > --
    > 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 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

    )

    hth,
    vbr
    Vlastimil Brom, Feb 11, 2011
    #2
    1. Advertising

  3. Mark Carter

    Mark Carter Guest

    Mark Carter, Feb 11, 2011
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wh1974
    Replies:
    0
    Views:
    2,428
    wh1974
    Jan 12, 2005
  2. David
    Replies:
    3
    Views:
    506
    Kenneth P. Turvey
    Nov 12, 2006
  3. ameyas
    Replies:
    3
    Views:
    1,193
  4. Peter

    Customising Tk widgets

    Peter, Sep 21, 2010, in forum: Python
    Replies:
    2
    Views:
    241
    Arndt Roger Schneider
    Sep 21, 2010
  5. Iñaki Baz Castillo
    Replies:
    7
    Views:
    843
    Iñaki Baz Castillo
    Jan 12, 2010
Loading...

Share This Page