On Wed, Jul 8, 2009 at 6:05 PM, Cameron Laird<came...@phaseit.net> wrote: > On Wed, Jul 08, 2009 at 01:37:52PM -0700, VladPotrosky wrote: > . > . > . >> How do you find the variable which a checkbutton is linked to? >> example: >> >> >> v = IntVar() >> c = Checkbutton(master, text='Foo', variable=v) >> >> how do you then find out (with code) that v is linked to c? > . > . > . > if v._name == c.cget("variable").string: > print "Ah-ha! They *do* match." > > Maybe there is a better way. That's as far as I've thought about it.
I would opt to do the check str(v) == str(c['variable']) instead, less intrusive. -- -- Guilherme H. Polo Goncalves _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org http://mail.python.org/mailman/listinfo/tkinter-discuss