Re: Tkinter: passing parameters to menu commands (looping through a list)

2005-01-07 Thread Philippe C. Martin
>>l_dec.add_command(label=i, command=lambda x=i: self.__Dec(x)) Woof! I'd better do my homework on lambda ! Thanks, Philippe -- *** Philippe C. Martin SnakeCard LLC www.snakecard.com *** -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: passing parameters to menu commands (looping through a list)

2005-01-07 Thread Philippe C. Martin
I face a strange behavior when adding menu labels / command parameters from a list: *** This is the code that works but I wish to avoid - ATR and IN appear in the menu, and __Dec is called with ATR or IN depending on the choice *** l_dec.add_command(label = 'ATR', command= lambda: self.__Dec('ATR