Tkinter menu: trying to use item label in callback
by KlaasJan from LinuxQuestions.org on (#56TG3)
Hello,
In a tkinter app I have a two-level menu with book categories, like Exact - Astronomy
or Music - Classic. The second level is added to the first one with add_cascade.
I want to use the labels of any duo in the appropriate command-callback, without writing them litterally in the callback. So far in my experiments I allways get back the labels of the last duo fed into the gui. I do understand now why. But how to get the labels I clicked on ?
KlaasJan


In a tkinter app I have a two-level menu with book categories, like Exact - Astronomy
or Music - Classic. The second level is added to the first one with add_cascade.
I want to use the labels of any duo in the appropriate command-callback, without writing them litterally in the callback. So far in my experiments I allways get back the labels of the last duo fed into the gui. I do understand now why. But how to get the labels I clicked on ?
KlaasJan