Because CAPI elements are just like CLOS classes, many elements share a common set of properties. The remainder of this section describes the properties that all the classes described in this chapter inherit.
The CAPI lets you specify horizontal or vertical scroll bars for any subclass of the simple-pane element (including all of the classes described in this chapter).
All subclasses of the simple pane element can have different foreground and background colors, using the
:foreground initargs of simple-pane. For example, including
The CAPI interface supports the use of other fonts for text in title panes and other CAPI objects, such as buttons, through the use of the
:font initarg of simple-pane.. If the CAPI cannot find the specified font it reverts to the default font. The
:font keyword applies to data following the
:text keyword. The value is a graphics ports font-description object specifying various attributes of the font.
On systems running X Windows, the
xlsfonts command can be used to list which fonts are available. The X logical font descriptor can be explicitly passed as a string to the
:font initarg, which will convert them.
Here is an example of a title-pane with an explicit font:
For more information on mnemonics in buttons, see Mnemonics in buttons.
:mnemonic-title allows you to specify the mnemonic in the title for many pane classes including list-panel, text-input-pane and option-pane. Also grid-layout supports
is true. For the details see titled-object.
You can specify that a pane should or should not get the focus by using the initarg
:accepts-focus-p (defined for element). By default interactive elements except menus accept focus, and non-interactive elements do not accept focus, so normally you do not need to use
By default, when a window first appears the focus is in the top-left pane that accepts focus. You can override this by using the initarg
:initial-focus or using the accessor pane-initial-focus on interfaces and layouts, and using the initarg
:initial-focus-item for choices (check-button-panel for example).
The function pane-descendant-child-with-focus can find a child pane that has the focus, when given as argument a pane with children such as a layout, an interface, or certain choices including a button-panel and toolbar.
The function pane-has-focus-p can be used to determine if a specific pane has the focus.
The function set-pane-focus can be used to set the focus to a pane inside an active window. If you need to ensure that the window is active, you can use activate-pane, which activates the window and sets the focus. For panes that have children (as described in Querying the focus) the actual pane that receives the focus is the "initial focus", as described Initial focus.
When set-pane-focus is called, just before it actually sets the focus, it calls the generic function pane-got-focus with the interface and the pane. You can define your own method (specialized on your own interface class) to perform any processing that may be required.
The mouse cursor of a pane can be specified by the initarg
:cursor or accessor
simple-pane-cursor. The cursor to be used needs to be a result of a call to load-cursor.
It is possible to set an "override" cursor in an interface, which sets the cursors in all its panes. That is typically used to temporarily set the cursor while the interface is in a different input state from the normal state. This feature does not work on Cocoa.
CAPI User Guide and Reference Manual (Macintosh version) - 3 Aug 2017