source: branches/GUIdev/Original Trial Files (9 December 2013)/EntryTrial.py @ 1441

Last change on this file since 1441 was 1306, checked in by KelvinHsu, 11 years ago

Initial commit of early python tests

File size: 544 bytes
Line 
1from Tkinter import *
2master = Tk()
3
4e = Entry(master, width=50)
5e.pack()
6
7text = e.get()
8
9def makeentry(parent, caption, width=None, **options):
10    Label(parent, text=caption).pack(side=LEFT)
11    entry = Entry(parent, **options)
12    if width:
13        entry.config(width=width)
14    entry.pack(side=LEFT)
15    return entry
16
17user = makeentry(master, "User name:", 10)
18password = makeentry(master, "Password:", 10, show="*")
19
20content = StringVar()
21entry = Entry(master, text= 'blah' , textvariable=content)
22
23text = content.get()
24content.set(text)
Note: See TracBrowser for help on using the repository browser.