| Itcl  | Itk  | Itcl @ Wiki  | Itcl @ SF  | Tcl  | Tcl @ Wiki |
  home || iwidgets || man pages cross ref distribution docs faq  
buttonbox
calendar
canvasprintbox
canvasprintdialog
checkbox
combobox
dateentry
datefield
dialog
dialogshell
disjointlistbox
entryfield
extbutton
extfileselectionbox
extfileselectiondialog
feedback
fileselectionbox
fileselectiondialog
finddialog
hierarchy
hyperhelp
labeledframe
labeledwidget
mainwindow
menubar
messagebox
messagedialog
notebook
optionmenu
panedwindow
promptdialog
pushbutton
radiobox
regexpfield
scrolledcanvas
scrolledframe
scrolledhtml
scrolledlistbox
scrolledtext
scrolledwidget
selectionbox
selectiondialog
shell
spindate
spinint
spinner
spintime
tabnotebook
tabset
timeentry
timefield
toolbar
watch

man page | options | methods

Checkbox

The Checkbox iwidget allows the user to organize related checkbuttons into a group. There are methods for adding, inserting, deleting, selecting, and deselecting checkbuttons by tag and index. Each checkbutton can have it's own attributes, either when the checkutton is added or by using the buttonconfigure public method. For further information, see the Checkbox manpage

Components: childsite hull label
				
wm title . "Checkbox Example"

##
##	wrap in a dialog user interaction
##
iwidgets::dialog .d \
	-title "Checkbox Example"

.d hide Help
.d hide Apply

.d buttonconfigure OK \
	-text "Update"

set cs [.d childsite]

##=========================================================
##	Create a checkbox iwidget
##=========================================================
##
iwidgets::checkbox $cs.cb \
  -labeltext "Places Visited" \
  -labelpos n

pack $cs.cb \
  -fill both \
  -expand true

##
##	set some lists
##
set places [list australia england france germany spain hawaii tahiti]
lappend places venezuela argentina greece china japan new_zealand mexico 
lappend places peru chile canada africa russia

set been_there [list england france germany spain hawaii venezuela argentina]
lappend been_there greece china japan mexico canada


##
##	Add some checkbuttons
##
##	Note that 'string totitle' is valid 
##	for tcl_version >= 8.1
##
foreach c [lsort $places] {

  $cs.cb add $c \
    -text [string totitle $c]
}

##
##	Select some of the boxes
##
foreach c $been_there {

  $cs.cb select $c
}

##
##	activate the dialog 
##
if {[.d activate]} {
	puts "Updated"
}

Download this sample code
man page | options | methods
 
  home || iwidgets || man pages cross ref distribution docs faq  
Copyright | Contributions | Development Team | Credits
Bugs/Comments/Suggestions about this web site