[Tkinter-discuss] Entry Widget - Setting a Default Text
amit.finkler at gmail.com
Mon Dec 31 13:56:55 CET 2007
I'm building a GUI for my system using Tkinter. I created the following
Entry and Label widgets:
from Tkinter import *
win = Tk()
f2 = Frame(win, bd = 2, relief = 'groove')
Lake_adr = StringVar()
LakeAdr = Entry(f2, textvariable = Lake_adr)
LakeAdrLabel = Label(f2, text = 'Lakeshore address')
LakeAdr.grid(row = 1, column = 0)
LakeAdrLabel.grid(row = 0, column = 0)
What I want to do is to have a default value already appearing in this
entry widget, which other functions can take using something like
lake = int(LakeAdr.get())
and if I change the entry myself, these other functions, of course, will
take the value I manually wrote.
How do I do that?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tkinter-discuss