8.3 graph-snip<%>

► |  | Mr Lib: Extra GUI Libraries

1 | Aligned Pasteboard
2 | Arrow Toggle Snip
3 | Bitmap Label
4 | Cache-image Snip
5 | Close Icon
6 | Expandable Snip
7 | GIF and Animated GIF Writing
8 | Graphs
9 | Hierarchical List Control
10 | Include Bitmap
11 | Interactive Value Port
12 | Name Message
13 | Path Dialog
14 | Plot
15 | Switchable Button
16 | Image Core
17 | Matrix Snip
18 | Snip Canvases
19 | Syntax Browser
20 | Te X Table
21 | Terminal Window
22 | White on Black Panel Predicate
23 | Acknowledgments
| Index

▼ | 8 | Graphs

8.1 | graph-pasteboard<%>
8.2 | graph-pasteboard-mixin
8.3 | graph-snip<%>
8.4 | graph-snip-mixin
8.5 | Graph Functions

On this page:

add-child
add-parent
get-children
get-parents
remove-child
remove-parent
set-parent-link-label

top contents ← prev up next →

interface graph-snip<%> : interface?

> method (send a-graph-snip add-child child) → void?
> child : (is-a?/c graph-snip<%>)

Adds a child of this snip. If this method is called, the add-parent method must also be called (with the parent/child arguments reversed).

Instead of calling this method, consider using the add-links function.

> method (send a-graph-snip add-parent parent) → void?
> parent : (is-a?/c graph-snip<%>)
> (send a-graph-snip add-parent |  | parent |  |  |  |
> |  | mouse-over-pen |  |  |  |
> |  | mouse-off-pen |  |  |  |
> |  | mouse-over-brush |  |  |  |
> |  | mouse-off-brush) |  | → |  | void?
> parent : (is-a?/c graph-snip<%>)
> mouse-over-pen : (or/c false/c (is-a?/c pen%))
> mouse-off-pen : (or/c false/c (is-a?/c pen%))
> mouse-over-brush : (or/c false/c (is-a?/c brush%))
> mouse-off-brush : (or/c false/c (is-a?/c brush%))

Adds a parent of this snip. If this method is called, the add-child method must also be called (with the parent/child arguments reversed).

Instead of calling this method, consider using the add-links function.

> method (send a-graph-snip get-children) → (listof snip%)

returns a list of snips that implement graph-snip<%>. Each of these snips will have a line drawn from it, pointing at this snip.

> method (send a-graph-snip get-parents) → (listof graph-snip<%>)

Returns a list of snips that implement graph-snip<%>. Each of these snips will have a line drawn to it, starting from this snip.

> method (send a-graph-snip remove-child child) → void?
> child : (is-a?/c graph-snip<%>)

Removes a child snip from this snip. Be sure to remove this snip as a parent from the argument, too. Instead of calling this method, consider using the remove-links function.

> method (send a-graph-snip remove-parent parent) → void?
> parent : (is-a?/c graph-snip<%>)

Removes a parent snip from this snip. Be sure to remove this snip as a child from the argument, too. Instead of calling this method, consider using the remove-links function.

> > method
> > (send a-graph-snip set-parent-link-label |  | parent |  |  |  |
> > |  | label) |  | → |  | void?
> parent : (is-a?/c graph-snip<%>)
> label : (or/c false/c string/)

Changes the label on the edge going to the parent to be label. Ignored if no such egde exists.
top contents ← prev up next →