added remove-links

svn: r14383
This commit is contained in:
Eli Barzilay 2009-03-31 12:22:29 +00:00
parent 3d04c4ce10
commit a58ba38c52
3 changed files with 22 additions and 3 deletions

View File

@ -21,7 +21,9 @@
add-parent
remove-parent
has-self-loop?
set-parent-link-label
find-shortest-path))
(define-local-member-name get-parent-links)
@ -84,6 +86,11 @@
(or/c false/c string?)
. -> .
void?))
(remove-links
((is-a?/c graph-snip<%>)
(is-a?/c graph-snip<%>)
. -> .
void?))
(set-link-label
((is-a?/c graph-snip<%>)
(is-a?/c graph-snip<%>)
@ -147,6 +154,10 @@
(send parent add-child child)
(send child add-parent parent dark-pen light-pen dark-brush light-brush dark-text light-text dx dy label))
(define (remove-links parent child)
(send parent remove-child child)
(send child remove-parent parent))
(define (set-link-label parent child label)
(send child set-parent-link-label parent label))

View File

@ -51,6 +51,8 @@ this 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
@scheme[remove-links] function.
}
@ -59,7 +61,8 @@ this 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
@scheme[remove-links] function.
}
@ -69,7 +72,6 @@ this snip.
Changes the label on the edge going to the @scheme[parent] to be
@scheme[label]. Ignored if no such egde exists.
}
}

View File

@ -75,6 +75,12 @@ used.}
Like @scheme[add-links], but with extra @scheme[dark-text] and
@scheme[light-text] arguments to set the colors of the label.}
@defproc[(remove-links [parent (is-a?/c graph-snip<%>)]
[child (is-a?/c graph-snip<%>)])
void?]{
Disconnects a parent snip from a child snip within a pasteboard.}
@defproc[(set-link-label [parent (is-a?/c graph-snip<%>)]
[child (is-a?/c graph-snip<%>)]
[label (or/c string? false/c)])