Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: Implicit initialization is EVIL! Date: Thu, 07 Jul 2011 17:34:23 +1200 Lines: 35 Message-ID: <97kur2FlkhU1@mid.individual.net> References: <97dc7iF9eiU1@mid.individual.net> <78624344-9696-42c9-9ed8-9454c55c1d9f@g12g2000yqd.googlegroups.com> <97ga0jFq2lU1@mid.individual.net> <4e131ef7$0$29977$c3e8da3$5496439d@news.astraweb.com> <4e133509$0$12858$426a74cc@news.free.fr> <999dd05c-cae5-4c86-8ee7-6e1d6116d2ed@gh5g2000vbb.googlegroups.com> <97icm3Ft0eU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net S9Hh7ifOO7biMeHWbHJO4gqTZ9jEsGW+oSFmAxX3z9dRKaAwma Cancel-Lock: sha1:j+NcaqUehC/rsuuAh7Hyrc1N808= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9008 rantingrick wrote: > Yes but what benefit does that gain over say, Tkinter's design > (because that has been your argument). Like I said, it's a tangential issue. The important thing is that it's okay for an app to stay alive until its *last* top level window is closed. There doesn't have to be a special "main" window that kills the whole app when you close it. However, I think what the original complaint was really about is that when you create a non-toplevel widget in Tkinter you have to specify its parent (and if you don't, it assumes you want it to be a child of the main window). You can't create the widget first and specify its parent later. This is another API flaw that is seen distressingly often in GUI libraries. It's a nuisance, because it means you can't write code that creates a widget hierarchy bottom-up. For example, in PyGUI you can write things like dialog_contents = Column([ Label("Caution: Your underpants are on fire."), Row([Button("OK"), Button("Cancel")]) ]) There's no way you could write Row and Column functions for Tkinter that work like that -- they would have to take parent widgets as arguments, and you wouldn't be able to nest the calls. -- Greg