Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!news.tele.dk!news.tele.dk!small.news.tele.dk!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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'root': 0.05; 'tkinter': 0.07; 'instance.': 0.09; 'skip:b 70': 0.09; 'subject:into': 0.09; 'def': 0.12; 'wrote': 0.14; 'client:': 0.16; 'does,': 0.16; 'none.': 0.16; 'shortcut': 0.16; 'subject:Tkinter': 0.16; 'utc,': 0.16; 'wrote:': 0.18; 'work,': 0.20; 'feb': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; 'code:': 0.26; 'header:In-Reply- To:1': 0.27; 'statement': 0.30; '+0100,': 0.31; 'up:': 0.31; 'another': 0.32; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'starting': 0.37; 'window': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'dave': 0.60; 'break': 0.61; 'new': 0.61; "you're": 0.61; 'kind': 0.63; 'here': 0.66; 'albert': 0.91; 'angel': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=va6Y8GXh8Pus0pKtK5HVsa+5QbUfEN6Dp4Fg5bwwijc=; b=csc9+naf8IxOv1TguZ4vHt4dIZ5MvIMGUmF/DeXEj8Y4sT1/big9Rip00A82u3rn9c wRHweP9ieWD22Me0Ha6EA6eRKfjYRYDZqsavGQ8qsIhoM68GrDaoG6B0bly/mj58Lt6d RQjAzebRXbM5YfwgS+YktYCbD/AJBOyWSEHXmr1Fe7Zy58Gs2RjlCWL9nXcl8t6fJ0+n qZPkzt5NZPylj4tDX8FCGl2jh/eGKoNoJ0l2vhCwqZP60mdQGddrRVDGH3tr+04ZNqCM xnICuPb1LTjF/Tsa1zA+5zu8VlrESgeovoerAVXed2oLTeVbMOoZF01smYK+G5+ix3Iv FfVQ== X-Received: by 10.194.2.70 with SMTP id 6mr18695009wjs.25.1391301970597; Sat, 01 Feb 2014 16:46:10 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: python-list@python.org Subject: Re: Tkinter widgets into classes. References: <5e297400-3322-45aa-ab7e-016af083b259@googlegroups.com> <04a9d0b0-c968-42c2-94d2-93438558e227@googlegroups.com> <2377621f-a208-4a12-b66c-bb678df6efcf@googlegroups.com> Date: Sun, 02 Feb 2014 01:46:07 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "albert visser" In-Reply-To: User-Agent: Opera Mail/12.16 (Linux) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391301979 news.xs4all.nl 2847 [2001:888:2000:d::a6]:50917 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65245 On Sun, 02 Feb 2014 00:07:00 +0100, Lewis Wood wrote: > On Saturday, 1 February 2014 22:26:17 UTC, Dave Angel wrote: >> Lewis Wood Wrote in message: (snip) >> >> DaveA > > It does, this is the whole code: > > from tkinter import * > > root=Tk() > root.title("Second Root Testing") > > > > def secondwindow(): > root2=Tk() > root2.mainloop() > this may seem to work, but you're starting a new event loop here instead of using the current one. I think you want to create another TopLevel() window here, not a new Tk instance. > > button1=Button(root,text="Root2",command=secondwindow).grid(row=0,column=0) > Note that if you want to be able to actually use the button1 symbol, you have to break this statement up: button1=Button(root,text="Root2",command=secondwindow) button1.grid(row=0,column=0) You can't shortcut this because grid() returns None. > > root.mainloop() > -- Vriendelijke groeten / Kind regards, Albert Visser Using Opera's mail client: http://www.opera.com/mail/