| 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

Buttonbox

The Buttonbox performs geometry management for Pushbutton instances. Public commands exist which enable the user to add new Pushbuttons, define the default, and control their display. Options enable the user to establish the orientation. This class is used to manage the buttons for all dialogs in the [incr Widgets] mega-widget set. For further information, see the Buttonbox manpage

Components: hull
				

wm title . "Buttonbox Example"

##
##	Supporting procs to show/hide buttons
##
proc more {} {
	global current last

	##
	##	Make sure that the current
	##	button is not the last one
	##
	if {$current < $last} {
		.bb show button[expr {$current+1}]
		incr current
	}

	if {$current == $last} {
		.bb default less
	}

	return
}; # end proc more

proc less {} {
	global current

	##
	##	Make sure that the current is
	##	not zero
	##
	if {$current != 0} {
		.bb hide button$current
		incr current -1
	} else {
		
		.bb default more
	}

	return 

}; # end proc less

##
##	Supporting global variables
##
set current 0
set last 5

##=========================================================
##	Create the buttonbox iwidget
##=========================================================
##
iwidgets::buttonbox .bb \
	-padx 10 \
	-pady 10

##
##	Add some buttons to the box
##
foreach b {more less} {
	.bb add $b \
		-text [string totitle $b] \
		-command "$b"
}

for {set b 1} {$b <= 5} {incr b} {
	.bb add button$b \
		-text [string totitle button$b]

	.bb hide button$b
}

.bb default more

pack .bb \
	-expand yes \
	-fill both

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