[Richard Suchenwirth] 2008-04-24 - Here is a little non-modal [dialog] to change a global variable which contains a [list] or [dict] like foo 1 bar 0 grill 1 The odd elements are taken as [checkbutton] labels, the even ones as the corresponding value. You can toggle the state of a label by clicking on it, as usual. With the "Apply" button, the variable is set to the current values. proc checkvar _var { upvar \#0 $_var var set t [toplevel .[clock clicks]] wm title $t $_var foreach {name bool} $var { pack [checkbutton $t.c$name -text $name -variable g(c$name)] -anchor w set ::g(c$name) [expr !!$bool] } pack [button $t.ok -text Apply -command "checkvar_set $_var $t"] -fill x } proc checkvar_set {_var w} { upvar \#0 $_var var global g set res {} foreach i [winfo children $w] { if {[winfo class $i] ne "Checkbutton"} continue set name [$i cget -text] lappend res $name $g(c$name) } set var $res } #-- Testing example: set ::thisvar {foo 1 bar 0 grill 1} checkvar thisvar ---- !!!!!! %| [Category GUI] | [Category Example] |% !!!!!!