[Tkinter-discuss] Entry Widget - Setting a Default Text

Amit Finkler amit.finkler at gmail.com
Mon Dec 31 13:56:55 CET 2007


Hi,


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)


    f2.pack()


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?


Thanks,


Amit.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20071231/473f74c4/attachment.htm 


More information about the Tkinter-discuss mailing list