problem: Tkinter.Menu() on NT

Sven Drescher Sven.Drescher at dlr.de
Tue Mar 7 08:48:50 CET 2000


> def test_routine(index):
>     print index
>
> for i in range(6):
>     submenu.add_command(
>         label=str(i),
>         command=lambda i=i, cb=test_routine: cb(i)
>     )

Thanks, works fine!

I forgot the 'i=i' in the lambda function I checked.
*upps*

Sven





More information about the Python-list mailing list