| 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

Toolbar

The toolbar iwidget displays a collection of widgets arranged either in a row or a column, depending on the value of the orient option. In addition, the toolbar supports string and ballon help for each component widget. The widgets managed by the toolbar typically offer user convenience, allowing quick access to a set of commonly needed actions. Any widget may be placed on the toolbar. However, command or value oriented widgets such as buttons, radiobutons, and entries are usually the most useful kind of widgets to appear in a toolbar. For further information, see the Toolbar manpage

Components: hull
				

wm title . "Toolbar Example"

##=========================================================
##	Create a toolbar iwidget
##=========================================================
##
iwidgets::toolbar .tb \
	-balloonbackground #336699 \
	-balloonforeground white \
	-balloondelay1 500 \
	-balloondelay2 150 \
	-orient vertical \
	-helpvariable helpVar

set dir [file join ${iwidgets::library} demos images]

##
##	Add some buttons to the toolbar
##
foreach b {copy paste clear} {

	.tb add button $b \
		-balloonstr "[string totitle $b] it" \
		-helpstr "this will $b the selection" \
		-command "puts $b" \
		-image [image create photo -file [file join $dir $b.gif]]
}

##
##	Add a spacer
##
.tb add frame spacer \
	-borderwidth 1 \
	-width 10 \
	-height 10

##
##	Add one more button
##
.tb add button exit \
	-balloonstr "Exit the application" \
	-helpstr "this will exit the application" \
	-command {exit} \
	-image [image create photo -file [file join $dir exit.gif]]

.tb itemconfigure exit \
	-relief groove \
	-bd 4

##
##	Add a status bar
##
label .stat \
	-textvariable helpVar \
	-relief ridge \
	-background white \
	-foreground #336699 \
	-width 25

pack .tb .stat \
	-expand 1 \
	-fill both \
	-pady 5

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