[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

<stdin>



I am hopelessly stuck: the purpose of the following abbreviated code is to use 

the list (items) and build from it a dialog consisting of buttons, 

check-boxes etc.  I am building the list *show-list* for use by 

:view-subviews. I encounter a hopeless tangle of interactions 

among and between buttons and  boxes. The static text items are 

work well.

What are the errors of my way ? Please adevise.

  

(defun init-all-items (items)


  (declare (list items))


     (setf *show-list* '())


     (dolist (item items)


     (let ((display-item (first item))


          (left-x (second item))

     	    (skipping rest)))


            (declare (atom sym left-x left-y right-x right-y) (string dialog-text))


    (cond ((equal display-item :radio)


           (setf *show-list* (append *show-list* (list


                         (make-dialog-item 'radio-button-dialog-item


                         (make-point left-x left-y)


                         (make-point right-x right-y)


                         dialog-text


                          #'(lambda (item)


                              item


                              (set-display-hash sym))


                         :view-font '("Monaco" 12 :plain)


                         :radio-button-cluster 1


                     )))))


          ((equal display-item :check)


           (setf *show-list* (append *show-list* (list


                           (make-dialog-item 'check-box-dialog-item


                           (make-point left-x left-y)


                           (make-point right-x right-y)


                            dialog-text


                            #'(lambda (item)


                                item


                                (set-display-hash sym))


                            :view-font '("Monaco" 9 :bold)


                         )))))                                           


        (t nil))))


     

     (make-instance 'dialog


                  :window-type :document 


                  :window-title "Test Dialog"


                  :view-position #@(20 40)


                  :view-size #@(200 300) 


                  :view-subviews  *show-list*)


     )

                                         


(setf items

   

    T( (:radio 10 110 150 120 "Dysarthria" :dysarthric)


     (:radio 10 130 150 150 "Acute Onset" :course-acute)


     (:check 10 100 120 80 "Married" :status-married)


     (:check 10  80 120 80 "Unemployed" :status-unemployed)


    ))