LispWorks CAPI User Guide > 7 Modifying CAPI Windows


7.1 Initialization

If necessary you can run code after your interface's windows have been created but before they are displayed on screen. Do this by supplying create-callback for your interface. For example:

(defun make-text (self createdp)
  (multiple-value-bind (s m h dd mm yy)
      (decode-universal-time (get-universal-time))
    (format nil "Window ~S ~:[displayed~;created~] at ~2,'0D:~2,'0D:~2,'0D" 
            self createdp h m s)))
(let ((editor (make-instance 'editor-pane 
                             :text "Not created yet.")))
  (contain editor
           (list :create-callback 
             #'(lambda (self) 
                 (setf (editor-pane-text editor)
                       (make-text self t))))))

Also, if you need to run code at display time you may define a :before or :after method on the generic function interface-display . Your method will run just before or just after your interface is displayed on screen.

LispWorks CAPI User Guide (Unix version) - 22 Dec 2009