[info-mcl] RMCL editable-text-dialog-item

Glen Foy lisp at clairvaux.org
Tue Jul 14 09:47:17 CDT 2009


On Jul 13, 2009, at 3:25 PM, Glen Foy wrote:

> Has anyone already written a patch for the editable-text-dialog
> problem in RMCL?

I was a little vague to say the least!  This code demonstrates the  
problem:

(defClass FOO (color-dialog)
   ((editable-text :initform nil :accessor foo-editable-text))
   (:default-initargs
         :window-title "Bug Demo"
         :theme-background t
         :view-size (make-point 200 50)
         :view-position #@(50 50)))

#|
;;; This works in 5.2, but not in RMCL:
(defMethod initialize-instance :after ((dialog foo) &rest rest &key)
   (declare (ignore rest))
   (setf (foo-editable-text dialog)
         (make-instance 'editable-text-dialog-item
	               :dialog-item-text "Foobar"
                        :view-size #@(100 25)
                        :view-position #@(15 15)
                        :view-container dialog)))
|#


;;; This works in 5.2 also, but in RMCL produces the error below:
(defMethod ccl::window-make-parts :after ((dialog foo) &rest rest &key)
    (declare (ignore rest))
    (setf (foo-editable-text dialog)
          (make-instance 'editable-text-dialog-item
                                                     :dialog-item-text  
"Foobar"
                           :view-size #@(100 25)
                           :view-position #@(15 15)
                           :view-container dialog)))

#|
;;; (make-instance 'foo)

 > Error: Unbound-slot FREC in #<EDITABLE-TEXT-DIALOG-ITEM #x3DE37B6>.
 > While executing: #<CCL::STANDARD-KERNEL-METHOD SLOT-UNBOUND (T T T)>
 > Type Command-. to abort.
See the Restarts… menu item for further choices.

|#


;;; Here is a work-around:
(defMethod ccl::window-make-parts :after ((dialog foo) &rest rest &key)
    (declare (ignore rest))
    (setf (foo-editable-text dialog)
          (make-instance 'editable-text-dialog-item :dialog-item-text  
"Foobar"
                           :view-size #@(100 25)
                           :view-position #@(15 15)))
    (set-view-container (foo-editable-text dialog) dialog))


It looks like in combining various versions of MCL the initialization  
sequence for this widget got hammered.  If someone comes up with a  
less kludgey solution, please post it.

-- Glen








-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://clozure.com/pipermail/info-mcl/attachments/20090714/0b5b10f1/attachment.html>


More information about the info-mcl mailing list