home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / lisp / mcl / 1968 < prev    next >
Encoding:
Text File  |  1993-01-11  |  2.9 KB  |  164 lines

  1. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!usc!cs.utexas.edu!sun-barr!olivea!apple!goofy!cambridge.apple.com!gwer1@cislabs.pitt.edu
  2. From: gwer1@cislabs.pitt.edu (Gerhard Werner)
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: <stdin>
  5. Message-ID: <9301101633.AA11340@phantom.cislabs.pitt.edu>
  6. Date: 10 Jan 93 16:33:03 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 153
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10.  
  11. I am hopelessly stuck: the purpose of the following abbreviated code is to use 
  12.  
  13. the list (items) and build from it a dialog consisting of buttons, 
  14.  
  15. check-boxes etc.  I am building the list *show-list* for use by 
  16.  
  17. :view-subviews. I encounter a hopeless tangle of interactions 
  18.  
  19. among and between buttons and  boxes. The static text items are 
  20.  
  21. work well.
  22.  
  23. What are the errors of my way ? Please adevise.
  24.  
  25.   
  26.  
  27. (defun init-all-items (items)
  28.  
  29.  
  30.   (declare (list items))
  31.  
  32.  
  33.      (setf *show-list* '())
  34.  
  35.  
  36.      (dolist (item items)
  37.  
  38.  
  39.      (let ((display-item (first item))
  40.  
  41.  
  42.           (left-x (second item))
  43.  
  44.              (skipping rest)))
  45.  
  46.  
  47.             (declare (atom sym left-x left-y right-x right-y) (string dialog-text))
  48.  
  49.  
  50.     (cond ((equal display-item :radio)
  51.  
  52.  
  53.            (setf *show-list* (append *show-list* (list
  54.  
  55.  
  56.                          (make-dialog-item 'radio-button-dialog-item
  57.  
  58.  
  59.                          (make-point left-x left-y)
  60.  
  61.  
  62.                          (make-point right-x right-y)
  63.  
  64.  
  65.                          dialog-text
  66.  
  67.  
  68.                           #'(lambda (item)
  69.  
  70.  
  71.                               item
  72.  
  73.  
  74.                               (set-display-hash sym))
  75.  
  76.  
  77.                          :view-font '("Monaco" 12 :plain)
  78.  
  79.  
  80.                          :radio-button-cluster 1
  81.  
  82.  
  83.                      )))))
  84.  
  85.  
  86.           ((equal display-item :check)
  87.  
  88.  
  89.            (setf *show-list* (append *show-list* (list
  90.  
  91.  
  92.                            (make-dialog-item 'check-box-dialog-item
  93.  
  94.  
  95.                            (make-point left-x left-y)
  96.  
  97.  
  98.                            (make-point right-x right-y)
  99.  
  100.  
  101.                             dialog-text
  102.  
  103.  
  104.                             #'(lambda (item)
  105.  
  106.  
  107.                                 item
  108.  
  109.  
  110.                                 (set-display-hash sym))
  111.  
  112.  
  113.                             :view-font '("Monaco" 9 :bold)
  114.  
  115.  
  116.                          )))))                                           
  117.  
  118.  
  119.         (t nil))))
  120.  
  121.  
  122.      
  123.  
  124.      (make-instance 'dialog
  125.  
  126.  
  127.                   :window-type :document 
  128.  
  129.  
  130.                   :window-title "Test Dialog"
  131.  
  132.  
  133.                   :view-position #@(20 40)
  134.  
  135.  
  136.                   :view-size #@(200 300) 
  137.  
  138.  
  139.                   :view-subviews  *show-list*)
  140.  
  141.  
  142.      )
  143.  
  144.                                          
  145.  
  146.  
  147. (setf items
  148.  
  149.    
  150.  
  151.     T( (:radio 10 110 150 120 "Dysarthria" :dysarthric)
  152.  
  153.  
  154.      (:radio 10 130 150 150 "Acute Onset" :course-acute)
  155.  
  156.  
  157.      (:check 10 100 120 80 "Married" :status-married)
  158.  
  159.  
  160.      (:check 10  80 120 80 "Unemployed" :status-unemployed)
  161.  
  162.  
  163.     ))
  164.