The following code fragment works OK.  Question: why?
#======================================
from Tkinter import *
root=Tk()

lbl=Label(root,text='1').pack()

def doIt():
    lbl.config(bg="yellow")

btn=Button(root,text="do", bg="cyan",command=doIt).pack()

root.mainloop()
#=======================================
My question is: how is the instance lbl.config(...) recognized in the doIt
callback fn when called from the main w/o an argument referencing lbl?


-- 
View this message in context: 
http://old.nabble.com/A-Button-command-callback-question...-tp32080554p32080554.html
Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.

_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to