All Manuals > CAPI User Guide > 10 Defining Interface Classes


10.5 Controlling the interface title

You can add dynamic control of window titles using the functions illustrated in the section.

Firstly we add a counter to the title of new demo windows:

(defvar *demo-title-counter* 0)
(defmethod capi:interface-extend-title ((self demo) title)
  (let ((counter 
         (or (capi:capi-object-property self 'my-title-counter)
              (capi:capi-object-property self 'my-title-counter)
              (incf *demo-title-counter*)))))
    (format nil "~A - ~D"
(capi:display (make-instance 'demo))

Then we specify a common prefix for all interface window titles. Note that this will generally affect all interfaces in the current session except, on Microsoft Windows only, interfaces inside MDI:

 :prefix "My " :suffix nil )
(capi:display (make-instance 'demo))

CAPI User Guide (Windows version) - 30 Aug 2011