|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proc RunSample {w} { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
frame $w.top -relief raised -bd 1 |
|
|
|
|
|
button $w.top.but -text {Press the right mouse button over |
|
|
this button or its surrounding area} |
|
|
|
|
|
pack $w.top.but -expand yes -fill both -padx 50 -pady 50 |
|
|
|
|
|
tixPopupMenu $w.top.p -title "Popup Test" |
|
|
$w.top.p bind $w.top |
|
|
$w.top.p bind $w.top.but |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set menu [$w.top.p subwidget menu] |
|
|
$menu add command -label Desktop -under 0 |
|
|
$menu add command -label Select -under 0 |
|
|
$menu add command -label Find -under 0 |
|
|
$menu add command -label System -under 1 |
|
|
$menu add command -label Help -under 0 |
|
|
$menu add cascade -label More -menu $menu.m1 |
|
|
menu $menu.m1 |
|
|
$menu.m1 add command -label Hello |
|
|
|
|
|
pack $w.top.but -side top -padx 40 -pady 50 |
|
|
|
|
|
|
|
|
|
|
|
tixButtonBox $w.box -orientation horizontal |
|
|
$w.box add ok -text Ok -underline 0 -command "destroy $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 |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {![info exists tix_demo_running]} { |
|
|
wm withdraw . |
|
|
set w .demo |
|
|
toplevel $w; wm transient $w "" |
|
|
RunSample $w |
|
|
bind $w <Destroy> {if {"%W" == ".demo"} exit} |
|
|
} |
|
|
|