Re: Activate/Deactivate checkbutton by program
- From: Wojciech Kocjan <mojeimie@xxxxxxxxxx>
- Date: Thu, 30 Jun 2005 12:51:04 +0200
purzel30@xxxxxx napisał(a):
Hello!
Can anybody tell me, how it is possible to activate or deactivate a Tk checkbutton by program. I cannot find any switch about that.
My example:
set e [checkbutton $f.r1 -justify left -text "Test"] pack $e -padx 5 -pady 3 -anchor sw
I'm looking for an option like "-value enabled" or "-state activated". Does anybody know a possibility?
Just bind the variable to it by doing
set e [checkbutton $f.r1 -justify left -text "Test" -variable ::x]
pack $e -padx 5 -pady 3 -anchor swNow, to check the button, do the following:
set ::x 1
To uncheck it do:
set ::x 0
Of course this is done using variable tracing, so if you bind >1 checkbutton or different radiobuttons, those values will also be changed.
-- WK .
- Follow-Ups:
- Re: Activate/Deactivate checkbutton by program
- From: purzel30
- Re: Activate/Deactivate checkbutton by program
- References:
- Activate/Deactivate checkbutton by program
- From: purzel30
- Activate/Deactivate checkbutton by program
- Prev by Date: Re: Commercial/Shareware and Extensions ?
- Next by Date: Re: Activate/Deactivate checkbutton by program
- Previous by thread: Activate/Deactivate checkbutton by program
- Next by thread: Re: Activate/Deactivate checkbutton by program
- Index(es):