[Tkinter-discuss] 回复: bind between event and callback

2011-08-17 Thread 守株待兔
why in the following code,there is no "frame.focus_set()" in the code ,it can run ,why?? from Tkinter import * root = Tk() def callback(event): print "i am here" frame = Frame(root, width=100, height=100) frame.bind("", callback) frame.pack() root.mainloop() -- 原始邮件 --

Re: [Tkinter-discuss] 回复: bind between event and callback

2011-08-17 Thread Michael Lange
Hi, Thus spoketh "守株待兔" <1248283...@qq.com> unto us on Wed, 17 Aug 2011 17:06:28 +0800: > why in the following code,there is no "frame.focus_set()" in the > code ,it can run ,why?? from Tkinter import * > root = Tk() > def callback(event): >print "i am here" > > frame = Frame(root, width=1

[Tkinter-discuss] 回复: 回复: bind between event and callback

2011-08-17 Thread 守株待兔
code1 from Tkinter import * root = Tk() def callback(event): print "i am here" frame = Frame(root, width=100, height=100) frame.bind("", callback) frame.focus_set() frame.pack() root.mainloop() code2 from Tkinter import * root = Tk() def callback(event): print "i am here" frame = Frame(ro

Re: [Tkinter-discuss] 回复: 回复: bind between event and callback

2011-08-17 Thread Firat Ozgul
I think there is no difference. Both positions seem reasonable to me. So you can insert the set_focus line at whichever position you wish. 2011/8/17 守株待兔 <1248283...@qq.com>: > code1 > from Tkinter import * > root = Tk() > def callback(event): >print "i am here" > > frame = Frame(root, width=1

[Tkinter-discuss] and or ??

2011-08-17 Thread 守株待兔
there is a code: #coding:utf-8 from Tkinter import * from sys import stdout, exit # lambda generates a function widget = Button(None,# but contains just an expression text='Hello event world', command=(lambda: stdout.write('He