All Manuals > CAPI User Guide > 3 Creating Common Windows > 3.2 Specifying titles > 3.2.2 Specifying titles directly

NextPrevUpTopContentsIndex

3.2.2.2 Titles for elements

The position of any title can be specified by using the :title-position keyword. Most panes default their title-position to :top , although some use :left .

You can place the title in a frame (like a groupbox) around its element by specifying :title-position :frame .

You may specify the font used in the title via the keyword :title-font.

The title of a titled-object , and its font, may be changed interactively with the use of setf , if you wish.

  1. Create a push button by evaluating the code below:
  2. (setq button (make-instance 'push-button
                               :text "Hello"
                               :title "Press: "
                               :title-position :left
                               :callback 'hello))
    (contain button)
  3. Now evaluate the following:
  4. (apply-in-pane-process
     button #'(setf titled-object-title) "Press here: " button)

    As soon as the form is evaluated, the title of the pane you just created changes.

  5. Lastly evaluate the following:
(apply-in-pane-process
 button #'(setf titled-object-title-font)
 (gp:merge-font-descriptions 
  (gp:make-font-description :size 42) 
  (gp:convert-to-font-description 
   button 
   (titled-object-title-font button))) button)

Notice how the window automatically resizes in steps 2 and 3, to make allowance for the new size of the title.


CAPI User Guide (Macintosh version) - 30 Aug 2011

NextPrevUpTopContentsIndex