[Tutor] A Simple Tkinter Control Program--Slight Problem
Alan Gauld
alan.gauld at btinternet.com
Thu Mar 5 18:39:24 CET 2009
"Wayne Watson" <sierra_mtnview at sbcglobal.net> wrote
Here's what I think the author meant in discussing a control variable
sample
program. <http://effbot.org/tkinterbook/entry.htm>
========================
from Tkinter import *
v=StringVar()
e = Entry(master, textvariable=v)
AG >> No master defined... you need
AG >> master = Tk()
e.pack()
e.focus_set()
v.set("a default value")
s = v.get()
mainloop()
AG>> and this should be master.mainloop()
Alan G
More information about the Tutor
mailing list