6.5 Graph Functions
(add-links graph-snip<%> graph-snip<%>) PROCEDURE
(add-links graph-snip<%> graph-snip<%> (union false? (is-a?/c pen%)) (union false? (is-a?/c pen%)) (union false? (is-a?/c brush%)) (union false? (is-a?/c brush%)))) PROCEDURE
(add-links graph-snip<%> graph-snip<%> (union false? (is-a?/c pen%)) (union false? (is-a?/c pen%)) (union false? (is-a?/c brush%)) (union false? (is-a?/c brush%)) number number) PROCEDURE
The add-links function connects a parent snip to a child snip in the same pasteboard.
When called with two arguments, connects the snips using a blue/purple color scheme for the links. The first snip is the parent and the second snip is the child.
When called with four arguments, uses the two pens and brushes for the color scheme. The first pen and the first brush are used when the mouse cursor is over the snip (or a child or parent) and the second pen and brush are used when the mouse cursor is not over the snip. The brush is used to draw inside the arrow head and the pen is used to draw the border of the arrowhead and the line connecting the two snips.
The final arguments are dx and dy offsets for the head and the tail of the arrow, first dx and then dy.