home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / elk-2_0.lha / elk-2.0 / examples / xm / selection-box < prev    next >
Encoding:
Text File  |  1991-09-26  |  953 b   |  37 lines

  1. ;;; -*-Scheme-*-
  2. ;;;
  3. ;;; Selection box demo
  4.  
  5. (require 'motif)
  6. (load-widgets shell selection-box)
  7.  
  8. (define top (application-initialize 'selection))
  9.  
  10. (define sb (create-managed-widget (find-class 'selection-box) top))
  11.  
  12. (define items
  13.   '(montana washington florida california texas new\ york alaska maryland
  14.   idaho virginia maine oregon illinois new\ jersey missouri louisiana))
  15.  
  16. (set-values! sb 'list-items items 'list-item-count (length items))
  17. (set-values! sb 'list-visible-item-count 6)
  18.  
  19. (set-values! sb 'list-label-string "Available items:" 'must-match #t)
  20. (set-values! sb 'label-font-list "8x13" 'button-font-list "9x15")
  21.  
  22. (for-each
  23.   (lambda (c)
  24.     (add-callback sb c
  25.       (lambda r
  26.     (case (caadr r)
  27.     (no-match
  28.       (display #\007))
  29.     (help
  30.       (display "No help available!") (newline)))
  31.     (print r))))
  32.   '(apply-callback cancel-callback no-match-callback
  33.     ok-callback help-callback))
  34.  
  35. (realize-widget top)
  36. (context-main-loop (widget-context top))
  37.