1 CAPI Reference Entries

element

Class

Summary

The classelement is the superclass of all CAPI objects that appear in a window.

Superclasses

capi-object

Subclasses

simple-pane
pinboard-object
menu
collection

Slots

parent
The element containing this element.

interface
The interface containing this element.

min-width
The minimum width of the element.

min-height
The minimum height of the element.

max-width
The maximum width of the element.

max-height
The maximum height of the element.

x
The x position for the element in a pinboard.

y
The y position for the element in a pinboard.

Accessors

element-parent

Readers

element-interface

Description

The classelement contains the slotsparent andinterface which contain the element and the interface that the element is contained in respectively. The writer methodelement-parent can be used to re-parent an element into another parent (or to remove it from a container entirely by setting its parent tonil).

All elements accept hints as to the initial size and position of the element in question. By default elements have a minimum pixel size of one by one, and a maximum size ofnil (meaning no maximum), but any of the following hints can be specified to change these values:

:x
The x position of the element.

:y
The y position of the element.

:min-width
The width of the element.

:min-height
The minimum height of the element.

:max-width
The maximum width of the element.

:max-height
The maximum height of the element.

:best-width
The initial width of the element.

:best-height
The initial height of the element.

The possible values for these hints are as follows:

integer
The size in pixels.

t
Formax-width andmax-height, means use the minimum.

:text-width
The width of any text in the element.

:screen-width
The width of the screen.

:screen-height
The height of the screen.

Also, hints can be a list starting with any of the following operators, followed by one or more hints.

max
The maximum size of the hints.

min
The minimum size of the hints.

+
The sum of the hints.

-
The subtraction of hints from the first.

*
The multiplication of the hints.

/
The division of hints from the first.

Finally, you can choose toapply orfuncall an arbitrary function, by passing a list starting withfuncall orapply, followed by the function and then the arguments.

Examples

(capi:display (make-instance 'capi:interface
                              :title "Test"
                              :min-width 300))

(capi:display (make-instance 'capi:interface :title "Test" :min-width 300 :max-height 200))

Here is a simple example that demonstrates the use of theelement-parent accessor to place elements.

(setq pinboard (capi:contain
                 (make-instance 
                  'capi:pinboard-layout)
                  :min-width 300 :min-height 300))

(setq object (make-instance 'capi:image-pinboard-object :x 10 :y 10 :image "new-lispworks-logo" :parent pinboard))

(setf (capi:element-parent object) nil)

(setf (capi:element-parent object) pinboard)

See Also

set-hint-table


CAPI Reference Manual, Liquid Common Lisp Version 5.0 - 3 OCT 1997

Generated with Harlequin WebMaker