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


Groups > comp.lang.python > #105650

Tkinter --> Why multiple windows

Newsgroups comp.lang.python
Date 2016-03-24 13:24 -0700
Message-ID <d1b257d3-6d27-4201-b3db-e363409b2623@googlegroups.com> (permalink)
Subject Tkinter --> Why multiple windows
From kevind0718@gmail.com

Show all headers | View raw


Hello:

newbie Tkinter question

If I run the code below two windows appear.
One empty and one with the text box and button.

Why?  please

KD



from Tkinter import *

class MyDialog:
    def __init__(self, parent):

        top = self.top = Toplevel(parent)

        Label(top, text="Value").pack()

        self.e = Entry(top)
        self.e.pack(padx=5)

        b = Button(top, text="OK", command=self.ok)
        b.pack(pady=5)

    def ok(self):

        print "value is", self.e.get()

        self.top.destroy()


root = Tk()

d = MyDialog(root)

root.wait_window(d.top)

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


Thread

Tkinter -->  Why multiple windows kevind0718@gmail.com - 2016-03-24 13:24 -0700
  Re: Tkinter -->  Why multiple windows Random832 <random832@fastmail.com> - 2016-03-24 16:28 -0400
    Re: Tkinter -->  Why multiple windows kevind0718@gmail.com - 2016-03-24 13:43 -0700
      Re: Tkinter --> Why multiple windows Terry Reedy <tjreedy@udel.edu> - 2016-03-24 21:27 -0400
  Re: Tkinter -->  Why multiple windows Wildman <best_lay@yahoo.com> - 2016-03-24 20:24 -0500
    Re: Tkinter -->  Why multiple windows kevind0718@gmail.com - 2016-03-25 06:41 -0700
      Re: Tkinter -->  Why multiple windows Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-03-25 13:03 -0400

csiph-web