wm title . "Dialog 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::dialog .d \ -title "Dialog Example" \ -modality application .d hide Help ## ## Change the deactivate commands for each ## button ## foreach b {OK Apply Cancel} { .d buttonconfigure $b \ -command ".d deactivate $b" } ## ## Need to access the childsite ## to add other widgets ## set cs [.d 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 ## .d 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 [.d activate]"