-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathk.py
More file actions
48 lines (36 loc) · 1008 Bytes
/
k.py
File metadata and controls
48 lines (36 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from Tkinter import *
master = Tk()
e = Entry(master, width=50)
e.delete(0, END)
e.insert(0, "a default value")
e.focus_set()
e.pack()
text = e.get()
def makeentry(parent, caption, width=None, **options):
Label(parent, text=caption).pack(side=LEFT)
entry = Entry(parent, **options)
if width:
entry.config(width=width)
entry.pack(side=LEFT)
return entry
def makemessage(parent, width=None, **options):
message=Message(parent, **options)
# if width:
# entry.config(width=width)
message.pack()
return message
user = makeentry(master, "User name:", 10)
password = makeentry(master, "Password:", 10, show="*")
content = StringVar()
entry = Entry(master, text='duh', textvariable=content)
text = content.get()
content.set(text)
def callback():
# new2=makeentry(master,e.get(),10)
# print e.get()
new3=makemessage(master,100, text=e.get())
return new3
b = Button(master, text="get", width=10, command=callback)
b.pack()
new=makeentry(master, e.get(),10)
mainloop()