Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Terry Reedy Newsgroups: comp.lang.python Subject: Re: Tkinter --> Why multiple windows Date: Thu, 24 Mar 2016 21:27:48 -0400 Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de MghAxLtyhaUN3yOEUziQdQz3ixvnp4L8ZBHnV8EILSoQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'root': 0.04; 'hiding': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Why': 0.09; 'jan': 0.11; 'thursday,': 0.13; 'thu,': 0.15; '2016': 0.16; '24,': 0.16; 'appear.': 0.16; 'downside': 0.16; 'for"': 0.16; 'idle,': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'subject:Tkinter': 0.16; 'subject:windows': 0.16; 'wrote:': 0.16; '(in': 0.18; '>>>': 0.20; 'windows': 0.20; 'appears': 0.23; 'nearly': 0.23; 'header:In-Reply-To:1': 0.24; 'sort': 0.25; 'header:User-Agent:1': 0.26; 'header:X-Complaints- To:1': 0.26; 'question': 0.27; "skip:' 10": 0.28; 'asked': 0.29; 'that.': 0.30; 'code': 0.30; 'window': 0.30; 'possibly': 0.32; 'run': 0.33; 'idle': 0.33; 'text': 0.35; 'there': 0.36; 'to:addr :python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'received:org': 0.37; 'application': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'email addr:gmail.com': 0.62; 'received:96': 0.63; 'march': 0.64; 'mar': 0.65; 'fact,': 0.67; 'utc-4,': 0.84; 'apparent': 0.91; 'received:fios.verizon.net': 0.91; 'why?': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: pool-96-227-207-81.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105674 On 3/24/2016 4:43 PM, kevind0718@gmail.com wrote: > On Thursday, March 24, 2016 at 4:29:03 PM UTC-4, Random832 wrote: >> On Thu, Mar 24, 2016, at 16:24, kevind0718@gmail.com wrote: >>> If I run the code below two windows appear. >>> One empty and one with the text box and button. >>> Why? The answer to that sort of question is nearly always "Because that is what you asked for" >> The empty one is the root window. > I kinda guessed that. > Is there any downside to hiding it using root.withdraw(). In your example, there is no apparent reason to hid root and use a Toplevel. IDLE, however, is currently a multiwindow application with no main window and it uses 'root.withdraw'. (In fact, it appears to do so twice in the IDLE process -- possibly a mistake.) -- Terry Jan Reedy