| 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

Selectionbox

The selectionbox iwidget combines a scrolled list of items, an editable entry field for the selected item, and labels for the list and entry field, allowing the user to select or enter one item from a list of alternatives. The Selectionbox also provides a child site and an option to control its position. For further information, see the Selectionbox manpage

Components: hull items selection
				

wm title . "Selectionbox Example"

##
##	Helper procs
##
proc entrySelect {} {
	
	puts "Entry value: [.sb component selection get]"

	return

}; # end proc entrySelect

proc listSelect {} {

	puts "Listbox value: [.sb get]"

	.sb selectitem

	return 

}; # end proc listSelect

##=========================================================
##	Create a selectionbox iwidget
##=========================================================
##
iwidgets::selectionbox .sb \
	-childsitepos w \
	-selectioncommand entrySelect \
	-itemscommand listSelect \
	-selectbackground blue \
	-selectforeground white
	

pack .sb

##
##	Add another label in the childsite
##
font create lbl_font \
	-family Helvetica \
	-size 16 \
	-weight bold

set cs [.sb childsite]
label $cs.label \
	-text [join [split " Iwidgets Library" ""] \n] \
	-foreground blue \
	-font lbl_font

pack $cs.label \
	-padx 4 \
	-pady 4

##
##	Add some items to the listbox
##
cd ${iwidgets::library}/scripts
eval .sb insert items end [glob -nocomplain *.itk]

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