| 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

Dialogshell

The Dialogshell class provides base class support for top level iwidget modal dialogs. This includes dialog mapping, button management, separator control, and a child site. The activate command maps the dialog and waits based on the modality. Non-modal dialogs return control immediately, whereas global and application modal dialogs wait until the deactivate command is invoked. The deactivate command accepts an optional argument which becomes the return value of the activate command. This provides dialog deactivation status notification. For further information, see the Dialogshell manpage

Components: bbox hull separator
				

wm title . "Dialogshell Example"

##
##	Supporting proc to switch checkbutton's label
##
proc changeCheck {} {

	global check cs

	array set txt {0 "No" 1 "Yes"}

	$cs.cb configure \
		-text "$txt($check)"

	return

}; # end proc changeCheck

##=========================================================
##	Create the dialog iwidget
##=========================================================
##
iwidgets::dialogshell .ds \
	-title "Dialogshell Example" \
	-buttonboxpos e \
	-modality application


##
##	add buttons
##
foreach b {OK Apply Cancel Help} {
	.ds add $b \
		-text $b \
		-command ".ds deactivate $b"
}

.ds default OK

##
##	Need to access the childsite
##	to add the other widgets
##	
set cs [.ds childsite]

##
##	Add a bitmap and a message
##
label $cs.quest \
	-bitmap questhead \
	-foreground red

message $cs.msg \
	-justify left \
	-width 200 \
	-text "Do you want to show this message next time"

checkbutton $cs.cb \
	-text "Yes" \
	-variable check \
	-indicatoron 0 \
	-command {changeCheck}

set check 1

pack $cs.quest $cs.msg $cs.cb \
	-side left

##
##	Do some positioning
##
.ds center
update idletasks

##
##	Since modality was set to application,
##	then this will invoke the dialog iwidget
##	We just print it here for feedback
##
puts "User hit [.ds activate]"

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