Re: RMCL editable-text-dialog-item

Glen Foy <[email protected]>
Newsgroups gmane.lisp.mcl.general
Message-ID <[email protected]>
On Jul 14, 2009, at 2:09 PM, Terje Norderhaug wrote:

> What about calling set-view-container in an initialize- 
> instance :after method on editable-text-dialog-item?
>
> I haven't tested this at all, but something like this (assuming  
> there isn't already an :after method):
>
> (defmethod initialize-instance :after ((item editable-text-dialog- 
> item) &key view-container)
> 	(set-view-container item view-container))


Good man, Terje.  We can't use :view-container as the keyword  
parameter, but if we call it :container, that will be a decent  
workaround:

(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 is new:
(defMethod initialize-instance :after ((item editable-text-dialog- 
item) &key container)
    (when container (set-view-container item container)))

(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)
                           ;; just :container here, not :view-container
                           :container dialog)))

;;; (make-instance 'foo)

_______________________________________________
info-mcl mailing list
[email protected]
http://clozure.com/mailman/listinfo/info-mcl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.