Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #65245

Re: Tkinter widgets into classes.

Subject Re: Tkinter widgets into classes.
References (1 earlier) <04a9d0b0-c968-42c2-94d2-93438558e227@googlegroups.com> <mailman.6289.1391291392.18130.python-list@python.org> <2377621f-a208-4a12-b66c-bb678df6efcf@googlegroups.com> <mailman.6292.1391293398.18130.python-list@python.org> <fab76f9e-7369-4bbc-9da8-06994b731dde@googlegroups.com>
Date 2014-02-02 01:46 +0100
From "albert visser" <albert.visser@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.6293.1391301979.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Sun, 02 Feb 2014 00:07:00 +0100, Lewis Wood <fluttershy363@gmail.com>  
wrote:

> On Saturday, 1 February 2014 22:26:17 UTC, Dave Angel  wrote:
>> Lewis Wood <fluttershy363@gmail.com> 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/

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Tkinter widgets into classes. Lewis Wood <fluttershy363@gmail.com> - 2014-02-01 11:43 -0800
  Re: Tkinter widgets into classes. archie65@live.co.uk - 2014-02-01 12:03 -0800
  Re: Tkinter widgets into classes. archie65@live.co.uk - 2014-02-01 12:04 -0800
  Re: Tkinter widgets into classes. Lewis Wood <fluttershy363@gmail.com> - 2014-02-01 12:12 -0800
    Re: Tkinter widgets into classes. Dave Angel <davea@davea.name> - 2014-02-01 16:52 -0500
      Re: Tkinter widgets into classes. Lewis Wood <fluttershy363@gmail.com> - 2014-02-01 14:12 -0800
        Re: Tkinter widgets into classes. Dave Angel <davea@davea.name> - 2014-02-01 17:26 -0500
          Re: Tkinter widgets into classes. Lewis Wood <fluttershy363@gmail.com> - 2014-02-01 15:07 -0800
            Re: Tkinter widgets into classes. "albert visser" <albert.visser@gmail.com> - 2014-02-02 01:46 +0100
            Re: Tkinter widgets into classes. Terry Reedy <tjreedy@udel.edu> - 2014-02-01 20:26 -0500
            Re: Tkinter widgets into classes. Christian Gollwitzer <auriocus@gmx.de> - 2014-02-02 11:22 +0100
              Re: Tkinter widgets into classes. Lewis Wood <fluttershy363@gmail.com> - 2014-02-02 12:38 -0800
                Re: Tkinter widgets into classes. David Hutto <dwightdhutto@gmail.com> - 2014-02-02 22:21 -0500
  Re: Tkinter widgets into classes. Christian Gollwitzer <auriocus@gmx.de> - 2014-02-02 11:15 +0100

csiph-web