Create and return an apply-drawing-object.
lw-gt
make-a-drawing-call function arguments &optional pass-pane-p => apply-drawing-object
make-draw-arc x y width height start-angle sweep-angle &rest args => apply-drawing-object
make-draw-circle x y radius &rest args => apply-drawing-object
make-draw-ellipse x y x-radius y-radius &rest args => apply-drawing-object
make-draw-line from-x from-y to-x to-y &rest args => apply-drawing-object
make-draw-lines lines &rest args => apply-drawing-object
make-draw-polygon points &rest args => apply-drawing-object
make-draw-rectangle x y width height &rest args => apply-drawing-object
function⇩ |
A function designator. |
arguments⇩ |
A list. |
pass-pane-p⇩ |
A generalized boolean. |
Real nunbers. | |
args⇩ |
Other drawing function arguments. |
Real numbers. | |
Real numbers. | |
lines⇩ |
A sequence of real numbers of the form x1 y1 x2 y2. |
points⇩ |
A sequence of real numbers of the form x y. |
apply-drawing-object |
Each of the functions make-a-drawing-call
, make-draw-line
, make-draw-lines
, make-draw-polygon
, make-draw-ellipse
, make-draw-circle
, make-draw-rectangle
and make-draw-arc
creates and returns an apply-drawing-object.
For make-a-drawing-call
, the drawing is done by applying the function function to arguments. When pass-pane-p is true, function is applied to the "root pane" (see drawing-object) followed by arguments. function should typically draw something, but it does not have to, and may do other things. The default value of pass-pane-p is true.
For the other functions, the drawing is done using the corresponding Graphics Ports function:
make-draw-arc | |
make-draw-circle | |
make-draw-ellipse | |
make-draw-line | |
make-draw-lines | |
make-draw-polygon | |
make-draw-rectangle |
x, y, width, height, start-angle, sweep-angle, args, radius, x-radius, y-radius, from-x, from-y, to-x, to-y, lines and points are interpreted as for the corresponding Graphics Ports function (except that y is interpreted from the bottom, see below).
Once created, the drawing object can be used in the drawing-object slot of an objects-displayer or a pinboard-objects-displayer, but more commonly it would be passed to one of the positioning/fitting functions (position-object, fit-object and so on), which will position and scale it with, by drawing the object inside a context of Graphics Ports transformation.
At the top level, the y coordinate is reversed, so y is measured from the bottom of the objects-displayer or pinboard-objects-displayer, as opposed to the default for Graphics Ports which is from the top down. A fitting object in the hierarchy may change that.
apply-drawing-objects can be used repeatedly and concurrently in the same or different panes. The ones that are created by the make-draw-*
functions are fixed, but for objects created by make-a-drawing-call
, the supplied function may depend on values that change, and hence needs to be redisplayed when these values change. Use force-objects-redraw on the root of the hierarchy (an objects-displayer or a pinboard-objects-displayer) to do that.
See drawing-object for description of the drawing operation.
objects-displayer
pinboard-objects-displayer
position-object
fit-object
position-and-fit-object
14.1 Lower level - drawing objects and objects displayers
CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:33:10