~ubuntu-branches/ubuntu/vivid/gcl/vivid

« back to all changes in this revision

Viewing changes to gcl-tk/demos/mkVScale.lisp

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2002-03-04 14:29:59 UTC
  • Revision ID: james.westby@ubuntu.com-20020304142959-dey14w08kr7lldu3
Tags: upstream-2.5.0.cvs20020219
ImportĀ upstreamĀ versionĀ 2.5.0.cvs20020219

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(in-package "TK")
 
2
;;# mkVScale w
 
3
;;
 
4
;; Create a top-level window that displays a vertical scale.
 
5
;;
 
6
;; Arguments:
 
7
;;    w -       Name to use for new top-level window.
 
8
 
 
9
(defun mkVScale (&optional (w '.vscale ))
 
10
;    (catch {destroy w})
 
11
    (toplevel w)
 
12
    (dpos w)
 
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))
 
20
 
 
21
    (scale (conc w '.frame.scale) :orient "vertical" :length 280 :from 0 :to 250 
 
22
            :command #'(lambda (height)
 
23
                         ; (print height)
 
24
                          (setHeight  (conc w '.frame.right.inner) height)) 
 
25
            :tickinterval 50 
 
26
            :bg "Bisque1")
 
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)
 
33
 
 
34
 
 
35
    (pack (conc w '.frame.right.inner) :expand "yes" :anchor "nw")
 
36
)
 
37
 
 
38
(defun setHeight (w height) 
 
39
    (funcall w :config :width 40 :height height)
 
40
)