Path: csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!aioe.org!feeder.news-service.com!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.102 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.80; '*S*': 0.00; 'subject:button': 0.09; '>>>': 0.11; 'e.g.': 0.13; 'subject:close': 0.16; 'variable': 0.18; 'discussed': 0.21; 'header:In-Reply-To:1': 0.23; 'url:group': 0.25; 'url:wiki': 0.26; 'closing': 0.27; 'testing': 0.28; 'message-id:@mail.gmail.com': 0.29; 'to:addr:python-list': 0.31; 'url:mailman': 0.31; 'connected': 0.33; 'carter': 0.34; 'frame': 0.34; 'url:google': 0.34; 'there': 0.34; 'whether': 0.34; 'hi,': 0.34; 'using': 0.35; 'respective': 0.36; 'shell': 0.36; 'rather': 0.36; 'close': 0.37; 'received:209.85': 0.38; 'received:google.com': 0.38; 'event': 0.38; 'url:org': 0.38; 'subject:: ': 0.39; 'url:python': 0.39; 'to:addr:python.org': 0.40; 'url:%1': 0.64; 'clicks': 0.67; 'url:%20': 0.68; 'destroyed,': 0.84; 'email addr:googlegroups.com': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=hOXP3SujsJGXf2TokoYnhDdK7ai6kGKqaFchtXep/h4=; b=ZJuMlTcTDAwMM+290OthU6iY6m+Tle8T2b1KFPAog1fDPJrNclB19tx3SpMYdw8aEZ bajkYq/xn8z3jOYKAIU1K6adwjHyirfmE1nb8/CeOoxjUgQ4HtTU/oaXTV21b/G9UNor tIirYbXRz/eXN0Ed2fhxg1WQ9ghzGLqKsLJuI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=bIWjtp0lhYiIqvHtEllL1Gxfo6tjDAzog8c+gVanFYfiUgBKItN7wx/hvMYoSNPiDl N+Euk2HHxoUdiiYlfVNQqWThHyv6lOAhOvth/ArnNgglEtTPFBvKbTf1WP2T/Zmxhw8w EFTVi5AY2YkcPfLCu/V6WrKnh50Gly2RBgPSo= MIME-Version: 1.0 In-Reply-To: <03497879-b376-4d66-8c3b-93fb5b0fbbd3@d16g2000yqd.googlegroups.com> References: <03497879-b376-4d66-8c3b-93fb5b0fbbd3@d16g2000yqd.googlegroups.com> Date: Fri, 11 Feb 2011 14:39:24 +0100 Subject: Re: wx.Frame hidden, and customising the close button From: Vlastimil Brom To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 33 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1297431566 news.xs4all.nl 41102 [::ffff:82.94.164.166]:57033 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:55931 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%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