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

How to use text-edit-dialog-item



At 11:43 AM 7/14/93 -0400, Jeffrey B Kane wrote:
>Does anyone have any simple example code that implements the file
>ccl:examples;text-edit-dialog-item?  I'm interested in some code that might:
>
>1) Create a window and if needed, install a shared te-handle
>2) Create several text-edit-dialog-items that can share that te-handle
>3) Switch my focus between these different text-edit-dialog-items
>3) Clean up when it's done (make sure the te-handle goes away if I created it)
>
>It's not clear from the file if the field *te-handle* is created for all 
>of MCL and all windows share it, or if each window has it's own.  Some
>code that I've been playing with (but doesn't work) is:
>
>
>(defvar the-window nil)
>(defvar field-1 nil)
>(defvar field-2 nil)
>
>(defclass fieldWindow (window)
>  ((text-list :initform nil
>              :accessor text-list)) 
>  (:default-initargs
>   :color-p t)
>  (:documentation
>   "To test text-edit-dialog fields"))
>
>(setf the-window (make-instance 'fieldWindow :window-title "Field Test"
>                     :view-size #@(300 150)))
>(setf field-1 (make-instance 'text-edit-dialog-item
>                  :view-size #@(50 50)
>                  :view-position #@(0 0)))
>(setf field-2 (make-instance 'text-edit-dialog-item
>                  :view-size #@(50 50)
>                  :view-position #@(60 0)))
>(install-view-in-window field-1 the-window)
>(install-view-in-window field-2 the-window)
>(set-dialog-item-text field-1 "This is something to display")
>(set-dialog-item-text field-2 "This is something else")

You should use SET-VIEW-CONTAINER instead of INSTALL-VIEW-IN-WINDOW.
Though it is kosher to write methods for INSTALL-VIEW-IN-WINDOW, you
should never call it yourself.