;******************************************************************************
;
; File name     : showVars.stk
; Creation date : Aug-13-1993
; Last update   : Aug-13-1993
;
;******************************************************************************
;
; STk adaptation of the Tk widget demo.
;
; showVars:
; Create a top-level window that displays a bunch of global variable values
; and keeps the display up-to-date even when the variables change value.
;
;******************************************************************************

(provide "showVars")

(define (showVars w . args)
  (catch (destroy w))
  (toplevel w)
  (wm 'title w "Variable values")
  (pack [label (& w ".title")
	       :text "Variable values:" :width 20 :anchor "center"
	       :font "-Adobe-helvetica-medium-r-normal--*-180*"]
	:side "top" :fill "x")

  (for-each (lambda (i)
	     (let ((f (& w "." i)))
	       (pack [frame f] :side "top" :anchor "w")
	       (pack [label (& f ".name") :text (& i ": ")]
		     [label (& f ".value") :textvar i]
		     :side "left")))
	    args)

  (pack [button (& w ".ok") :text "OK" :command `(destroy ,w)]
	:side "bottom" :pady 2))
