~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(in-package "TK")
 
2
;;# showVars w var var var '...
 
3
;;
 
4
;; Create a top-level window that displays a bunch of global variable values
 
5
;; and keeps the display up-to-date even when the variables change value
 
6
;;
 
7
;; Arguments:
 
8
;;    w -       Name to use for new top-level window.
 
9
;;    var -     Name of variable to monitor.
 
10
 
 
11
(defun showVars (w args) 
 
12
    (if (winfo :exists w :return 'boolean) (destroy w))
 
13
    (toplevel w)
 
14
    (wm :title w "Variable values")
 
15
    (label (conc w '.title) :text "Variable values:" :width 20 :anchor "center" 
 
16
            :font :Adobe-helvetica-medium-r-normal--*-180*)
 
17
    (pack (conc w '.title) :side "top" :fill "x")
 
18
    (dolist (i args) 
 
19
        (frame (conc w '|.| i))
 
20
        (label (conc w '|.| i '.name) :text (tk-conc i ": "))
 
21
        (label (conc w '|.| i '.value) :textvariable
 
22
                             (list (or (get i 'text-variable-type) t) i))
 
23
        (pack (conc w '|.| i '.name) (conc w '|.| i '.value) :side "left")
 
24
        (pack (conc w '|.| i) :side "top" :anchor "w")
 
25
    )
 
26
    (button (conc w '.ok) :text "OK" :command (tk-conc "destroy " w))
 
27
    (pack (conc w '.ok) :side "bottom" :pady 2)
 
28
)