Tkinter code (with pmw) executing to soon please help

Gabriel Genellina gagsl-py at yahoo.com.ar
Sun Jan 14 12:27:37 EST 2007


<Eric_Dexter at msn.com> escribió en el mensaje 
news:1168760423.608731.213550 at a75g2000cwd.googlegroups.com...

> button[num] = Tkinter.Button(frame,text =  returnstring,
> command=callback(returnstring))#
>
> I understand this part of it
>
> def callback(text):
>   def handler(event):
>     print text

> It stopped calling it automaticaly but will not do anything when I
> click on the button.  Does something have to change on this line as
> well.

Sorry, I overlooked your example. For a button, command should be a function 
with no arguments (and I forget to return the handler, as someone already 
pointed out):

def callback(text):
    def handler():
        print text
    return handler

-- 
Gabriel Genellina 






More information about the Python-list mailing list