All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

static-layout-child-size Accessor Generic Function

Summary

Gets and sets the size of an object inside its parent static-layout.

Package

capi

Signature

static-layout-child-size self => width, height

setf (static-layout-child-size self) (values width height) => width, height

Arguments
self
A pinboard-object or a pane.
width, height
Positive integers.
Values
width, height
Positive integers.
Description

The accessor generic function static-layout-child-size returns as multiple values width, height the dimensions of self.

There is also a setf expansion which sets the dimensions of self.

Examples
(let* ((po (make-instance 'capi:pinboard-object
                          :x 5 :y 5 
                          :width 5 :height 5
                          :graphics-args 
                          '(:background :red)))
       (pl (capi:contain 
            (make-instance 'capi:pinboard-layout 
                           :description (list po)
                           :visible-min-width 200
                           :visible-min-height 200))))
  (capi:execute-with-interface
   (capi:element-interface pl)
   #'(lambda(po)
       (dotimes (x 20)
         (mp:wait-processing-events 1)
         (let ((new-x (* (1+ x) 10))
               (new-y (* 5 (+ 2 x))))
           (setf (capi:static-layout-child-size po)
                 (values new-x new-y)))))
   po))
See also

static-layout
static-layout-child-position


CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:27