|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proc RunSample {w} { |
|
|
|
|
|
|
|
label $w.top -padx 20 -pady 10 -border 1 -relief raised -text \ |
|
"This dialog box is\n a demostration of the\n tixStdButtonBox widget" \ |
|
-justify center -anchor c |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tixStdButtonBox $w.box |
|
$w.box subwidget ok config \ |
|
-command "tixDemo:Status {OK pressed}; destroy $w" |
|
$w.box subwidget apply config -text "Filter" -underline 0 \ |
|
-command "tixDemo:Status {Filter pressed}" |
|
$w.box subwidget cancel config \ |
|
-command "tixDemo:Status {Cancel pressed}; destroy $w" |
|
$w.box subwidget help config -state disabled |
|
|
|
pack $w.box -side bottom -fill x |
|
pack $w.top -side top -fill both -expand yes -anchor c |
|
|
|
|
|
|
|
|
|
|
|
bind [winfo toplevel $w] <Alt-o> \ |
|
"after 0 tkButtonInvoke [$w.box subwidget ok]" |
|
bind [winfo toplevel $w] <Alt-f> \ |
|
"after 0 tkButtonInvoke [$w.box subwidget apply]" |
|
bind [winfo toplevel $w] <Alt-c> \ |
|
"after 0 tkButtonInvoke [$w.box subwidget cancel]" |
|
bind [winfo toplevel $w] <Escape> \ |
|
"after 0 tkButtonInvoke [$w.box subwidget cancel]" |
|
|
|
focus [$w.box subwidget apply] |
|
} |
|
|
|
if {![info exists tix_demo_running]} { |
|
wm withdraw . |
|
set w .demo |
|
toplevel $w; wm transient $w "" |
|
RunSample $w |
|
bind $w <Destroy> exit |
|
} |
|
|