[Tkinter-discuss] How do I identify which menu item has bee selected?

Guilherme Polo ggpolo at gmail.com
Thu Aug 20 00:52:32 CEST 2009


2009/8/19 thicket <mark_eastwood at ntlworld.com>:
>
> I've just run your code and it is exactly what I'm trying to do :-D however
> I ideally want to use add_cascade() instead of add_radiobutton() .. my
> problem is that a menu object does not provide for use
> of variables and so far, using variables is the only way I've managed to get
> a 'partial' solution albeit a bad one!!
>
> Therefore the solution I've been trying to achieve is what your code does
> but using add_cascade().  Failing that a rethink of the app.
>

Did you mean add_command instead of add_cascade ? It is possible to do
what you want, the first code I pasted didn't use Tcl variables so
maybe you could try adjusting it to your needs.

> thanks again
> cheers
>
> --


-- 
-- Guilherme H. Polo Goncalves


More information about the Tkinter-discuss mailing list