NextPrevUpTopContentsIndex

double-headed-arrow-pinboard-object

Class
Summary

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

Package

capi

Superclasses

arrow-pinboard-object

Initargs

:double-head-predicate

A function determining whether a single or double arrowhead is drawn.

Description

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.

Example
(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))))

LispWorks CAPI Reference Manual - 25 Jul 2006

NextPrevUpTopContentsIndex