http://purl.org/tcl/home/man/tcl8.5/TkCmd/checkbutton.htm The older (8.4) man page is at: http://purl.org/tcl/home/man/tcl8.4/TkCmd/checkbutton.htm For these purposes, [checkbox] is a distinct [widget]. ---- Note the 8.5 checkbutton includes the new "tristate" options, implemented at the behest of Tip #110 http://www.tcl.tk/cgi-bin/tct/tip/110 ---- gold@mailcity.com wrote in [the comp.lang.tcl newsgroup]: ''I would like to be able to control the location of the box in checkbutton and make it appear to the right of it's [[sic]] text (rather than to the left -- as is the default). Is this possible?'' You can approximate it with a little wrapper that places a label left of a text-less checkbutton. Quick shot: proc lcheckbutton {w args} { array set opt {-text ""} array set opt $args frame $w -bg red label $w.1 -text $opt(-text) unset opt(-text) eval [list checkbutton $w.2 -text {}] [array get opt] pack $w.2 $w.1 -side right -fill x set w } ;# RS #--------------------------------------- testing: checkbutton .1 -text Right lcheckbutton .2 -text Left eval pack [winfo children .] -anchor w To fully emulate the checkbutton protocol, some more work is of course needed... ---- Instead of work, here's more play: the ''vertical'' command places the text of a radio- or checkbutton below the clickable field: proc vertical {type w args} { frame $w set pos [lsearch $args -text] if {$pos == -1} { set text "" } else { set text [lindex $args [expr $pos+1]] set args [lreplace $args $pos [incr pos]] } eval $type $w.r $args [list -text ""] -pady 0 label $w.t -text $text -pady 0 pack $w.r $w.t -side top -pady 0 -padx 0 -fill x -anchor e set w } ;# RS vertical radiobutton .io.ri$i -text "X$i" -variable Xary($i) ---- Here's a procedure which does all the nessecary stuff to bind label and checkbutton - when label is of left as separate control and checkbox is textless. All mouse interactions are taken care of - on_mouseover, etc: proc setWidgetsState { state widgets } { foreach widg $widgets { $widg configure -state $state } } ; # SetWidgetsState proc bindLabelToCheckbutton { lbl chkBtn } { foreach prop {-activebackground -activeforeground} { $lbl configure $prop [$chkBtn cget $prop] } bind $lbl [list setWidgetsState active [list $lbl $chkBtn]] bind $lbl [list setWidgetsState normal [list $lbl $chkBtn]] bind $chkBtn +[list setWidgetsState active $lbl] bind $chkBtn +[list setWidgetsState normal $lbl] bind $lbl <1> [list $chkBtn invoke] } ; #bindLabelToCheckbutton Just add the following call to /lcheckbutton/ (above) and you are all done: bindLabelToCheckbutton $w.1 $w.2 ---- [Lars H], 2007-06-06: Yesterday I needed a window that displayed a set of images and let the user select a subset of them. Noticing that [checkbutton] has an -image option, I thought "Great, I'll just create a [grid] of [checkbutton]s and display the images in these!" Slightly simplified, the code for setting this up looked like this: for {set n 1} {$n < $limit} {incr n} { grid [ checkbutton $t.back.i${n} -compound top -text $Info($n)\ -image $im($n) -variable $t.back.i${n}\ -justify left -wraplength [image width $im($n)] ] -row $n -column 1 } Unfortunately, this didn't look so well -- for some reason the checkbuttons ended up being twice as wide as the image, which occupied the right half of the widget. The left half was empty, except for the actual checkbox which was about its normal distance from the left edge of the widget; in other words the box was ''very far'' from the image and text. For now, I'll try putting the image in a separate [label] widget instead, but the checkbutton behaviour seems baroque. Does anyone know ''why'' this happens? (Just so you know, this is with aqua as [tk windowingsystem].) ---- '''See also''' * [Lightbutton] a pure Tcl package mimicking the radio and the checkbuttons, with bright and pretty colors. ---- [Category Widget] - [Category Command] - [Tk syntax help] - [Arts and Crafts of Tcl-Tk Programming]