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

double-headed-arrow-pinboard-object Class

Summary

A pinboard-object that draws itself as an arrow.

Package

capi

Superclasses

arrow-pinboard-object

Initargs
:double-head-predicate
A function determining whether a single or double arrowhead is drawn.
Description

The class double-headed-arrow-pinboard-object is a pinboard-object that draws itself as an arrow, which can switch dynamically from double-headed to single-headed.

double-head-predicate should be a function of two arguments returning a boolean value. The first argument is the output pane on which the arrow pinboard object is drawn. The second argument is the arrow pinboard object itself.

double-head-predicate should return a true value if the arrow is to be double-headed, and nil if a single-headed arrow should be drawn. It is called each time the arrow object is redrawn.

Examples
(defvar *doublep* t)
 
(let ((dhr 
       (capi:contain 
        (make-instance
         'capi:pinboard-layout
         :description
         (list
          (make-instance 
           'capi:double-headed-arrow-pinboard-object
           :double-head-predicate
           #'(lambda (x y) *doublep*)
           :start-x 5 :start-y 5 :end-x 95 :end-y 95)
          (make-instance 
           'capi:double-headed-arrow-pinboard-object
           :double-head-predicate
           #'(lambda (x y) *doublep*)
           :head-direction :backwards
            :start-x 5 :start-y 95 :end-x 95 :end-y 5)))
        :visible-min-width 100
        :visible-min-height 100)))
  (dotimes (x 10)
    (sleep 1)
    (setq *doublep* (not *doublep*))
    (mapcar 'capi:redraw-pinboard-object 
            (capi:layout-description dhr))))
See also

12.3 Creating graphical objects


CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:32:42