home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.002 / stk-3 / STk-3.1 / Demos / Widget / Wform.stklos < prev    next >
Encoding:
Text File  |  1996-03-31  |  845 b   |  29 lines

  1. ;;;;
  2. ;;;; STk adaptation of the Tk widget demo.
  3. ;;;;
  4. ;;;; This demonstration script creates a simple form with a bunch
  5. ;;;; of entry widgets.
  6. ;;;;
  7. (require "Tk-classes")
  8.  
  9. (define (demo-form)
  10.   (let  ((w (make-demo-toplevel "form"
  11.                 "Form Demonstration"
  12.                 "This window contains a simple form where you can type in the various entries and use tabs to move circularly between the entries.")))
  13.  
  14.     ;; Make the entries
  15.     (for-each (lambda (x) 
  16.         (pack (make <Labeled-entry> 
  17.                 :parent w         :title x 
  18.                 :title-width 8  :width 40
  19.                 :anchor "w"        :entry-relief "sunken")
  20.               :padx 5))
  21.         
  22.           (list "Name:" "Address:" "" "" "Phone:"))
  23.     ;; destroy the window when  <Return> is typed in the current toplevelel
  24.     (let ((top (winfo 'toplevel w)))
  25.       (bind top "<Return>" (lambda () (catch (destroy top)))))))
  26.  
  27.     
  28.  
  29.