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]"