我需要对下面的 tkinter 应用程序的内容进行截图。我在 Windows 7(或 8)上。
from Tkinter import *
def test(x):
#print "I'm in event:", x
if x == 1: # if event on entry e1
print 'e1 event' # do some thing
elif x == 2: # also if event on entry e2
print 'e2 event' # do some thing else
else:
print 'no event'
def test1(x):
test(1)
def test2(x):
test(2)
root=Tk()
root.minsize(500,500)
e1=Entry(root)
e1.pack()
e2=Entry(root)
e2.pack()
e1.bind( "<FocusOut>", test1)
e2.bind( "<FocusOut>", test2)
button=Button(root, text='print').pack(side=BOTTOM)
root.mainloop()