passing menu label to function

J Wolfe vorticitywolfe at gmail.com
Fri Aug 7 14:17:28 EDT 2009


Hi,

I would like to pass the label name of a menu to the command it is
calling, is that possible?

self.menuitem.menu.add_command(label="pass this",command = lambda i =
self.self.menuitem.menu.cget("label"): self.function(i))

def function(self, i)
     print i   # print the label name


Any help would be appreciated!
Thanks!
Jonathan



More information about the Python-list mailing list