4
;; Create a top-level window that displays a vertical scale.
7
;; w - Name to use for new top-level window.
9
(defun mkVScale (&optional (w '.vscale ))
13
(wm :title w "Vertical Scale Demonstration")
14
(wm :iconname w "Scale")
15
(message (conc w '.msg) :font :Adobe-times-medium-r-normal--*-180* :aspect 300
16
: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.")
17
(frame (conc w '.frame) :borderwidth 10)
18
(button (conc w '.ok) :text "OK" :command (tk-conc "destroy " w))
19
(pack (conc w '.msg) (conc w '.frame) (conc w '.ok))
21
(scale (conc w '.frame.scale) :orient "vertical" :length 280 :from 0 :to 250
22
:command #'(lambda (height)
24
(setHeight (conc w '.frame.right.inner) height))
27
(frame (conc w '.frame.right) :borderwidth 15)
28
(frame (conc w '.frame.right.inner) :width 40 :height 20 :relief "raised"
29
:borderwidth 2 :bg "SteelBlue1")
30
(pack (conc w '.frame.scale) :side "left" :anchor "ne")
31
(pack (conc w '.frame.right) :side "left" :anchor "nw")
32
(funcall (conc w '.frame.scale) :set 20)
35
(pack (conc w '.frame.right.inner) :expand "yes" :anchor "nw")
38
(defun setHeight (w height)
39
(funcall w :config :width 40 :height height)