|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proc RunSample {w} { |
|
|
|
|
|
|
|
frame $w.top -border 1 -relief raised |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tixComboBox $w.top.a -label "Month: " -dropdown true \ |
|
-command cbx:select_month -editable false -variable demo_month \ |
|
-options { |
|
listbox.height 6 |
|
label.width 10 |
|
label.anchor e |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tixComboBox $w.top.b -label "Year: " -dropdown false \ |
|
-command cbx:select_year -editable true -variable demo_year \ |
|
-options { |
|
listbox.height 4 |
|
label.padY 5 |
|
label.width 10 |
|
label.anchor ne |
|
} |
|
|
|
pack $w.top.a -side top -anchor w |
|
pack $w.top.b -side top -anchor w |
|
|
|
|
|
|
|
$w.top.a insert end January |
|
$w.top.a insert end February |
|
$w.top.a insert end March |
|
$w.top.a insert end April |
|
$w.top.a insert end May |
|
$w.top.a insert end June |
|
$w.top.a insert end July |
|
$w.top.a insert end August |
|
$w.top.a insert end September |
|
$w.top.a insert end October |
|
$w.top.a insert end November |
|
$w.top.a insert end December |
|
|
|
$w.top.b insert end 1992 |
|
$w.top.b insert end 1993 |
|
$w.top.b insert end 1994 |
|
$w.top.b insert end 1995 |
|
|
|
|
|
|
|
|
|
|
|
tixSetSilent $w.top.a January |
|
tixSetSilent $w.top.b 1995 |
|
|
|
|
|
|
|
tixButtonBox $w.box -orientation horizontal |
|
$w.box add ok -text Ok -underline 0 -command "cbx:okcmd $w" \ |
|
-width 6 |
|
$w.box add cancel -text Cancel -underline 0 -command "destroy $w" \ |
|
-width 6 |
|
|
|
pack $w.box -side bottom -fill x |
|
pack $w.top -side top -fill both -expand yes |
|
} |
|
|
|
proc cbx:select_year {args} { |
|
tixDemo:Status "you have selected \"$args\"" |
|
} |
|
|
|
proc cbx:select_month {s} { |
|
tixDemo:Status "you have selected \"$s\"" |
|
} |
|
|
|
proc cbx:okcmd {w} { |
|
global demo_month demo_year |
|
|
|
tixDemo:Status "The month selected is $demo_month of $demo_year" |
|
destroy $w |
|
} |
|
|
|
if {![info exists tix_demo_running]} { |
|
wm withdraw . |
|
set w .demo |
|
toplevel $w; wm transient $w "" |
|
RunSample $w |
|
bind $w <Destroy> exit |
|
} |
|
|