]>
Commit | Line | Data |
---|---|---|
6a5fa4e0 MG |
1 | # mkVScale w |
2 | # | |
3 | # Create a top-level window that displays a vertical scale. | |
4 | # | |
5 | # Arguments: | |
6 | # w - Name to use for new top-level window. | |
7 | ||
8 | proc mkVScale {{w .scale1}} { | |
9 | catch {destroy $w} | |
10 | toplevel $w | |
11 | dpos $w | |
12 | wm title $w "Vertical Scale Demonstration" | |
13 | wm iconname $w "Scale" | |
14 | message $w.msg -font -Adobe-times-medium-r-normal--*-180* -aspect 300 \ | |
15 | -text "A bar and a vertical scale are displayed below. If you click or drag mouse button 1 in the scale, you can change the height of the bar. Click the \"OK\" button when you're finished." | |
16 | frame $w.frame -borderwidth 10 | |
17 | pack append $w.frame \ | |
18 | [scale $w.frame.scale -orient vertical -length 280 -from 0 -to 250 \ | |
19 | -command "setHeight $w.frame.right.inner" -tickinterval 50 \ | |
20 | -bg Bisque1] {left expand frame ne} \ | |
21 | [frame $w.frame.right -borderwidth 15] {right expand frame nw} | |
22 | pack append $w.frame.right \ | |
23 | [frame $w.frame.right.inner -geometry 40x20 -relief raised \ | |
24 | -borderwidth 2 -bg SteelBlue1] {expand frame nw} | |
25 | $w.frame.scale set 20 | |
26 | button $w.ok -text OK -command "destroy $w" | |
27 | ||
28 | pack append $w $w.msg {top fill} $w.frame {top expand fill} \ | |
29 | $w.ok {bottom fill} | |
30 | } | |
31 | ||
32 | proc setHeight {w height} { | |
33 | $w config -geometry 40x${height} | |
34 | } |