Tkinter Menu.add_checkbutton()

David Allen s2mdalle at titan.vcu.edu
Mon Feb 19 21:51:16 EST 2001


Just a quick question:

When I add a checkbutton to a menu:

v = BooleanVar()
v.set(FALSE)

foomenu.add_checkbutton(label="Option Foo",
                        variable=v,
                        showcolor='#00FF00',
                        command=some_callback)

The checkbutton always displays as 'off' regardless
of the value of 'v'.  See, depending on the value
of 'v', I'd like to have it start as on if v is
true.

I've also tried invoke()'ing this item, since in
the Tkinter class reference, that says it's the same
thing as the user clicking on it, but that doesn't
work either.

Any suggestions on how to make this start up as
checked?  The default is unchecked.
-- 
David Allen
http://opop.nols.com/
----------------------------------------
A language that doesn't affect the way you think about programming is 
not worth knowing.



More information about the Python-list mailing list