diff --git a/collects/mrlib/graph.ss b/collects/mrlib/graph.ss index cd3d368f9d..0da089863c 100644 --- a/collects/mrlib/graph.ss +++ b/collects/mrlib/graph.ss @@ -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)) diff --git a/collects/mrlib/scribblings/graph/graph-snip-intf.scrbl b/collects/mrlib/scribblings/graph/graph-snip-intf.scrbl index c31ca443d2..6f5827d7eb 100644 --- a/collects/mrlib/scribblings/graph/graph-snip-intf.scrbl +++ b/collects/mrlib/scribblings/graph/graph-snip-intf.scrbl @@ -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. - } } diff --git a/collects/mrlib/scribblings/graph/graph.scrbl b/collects/mrlib/scribblings/graph/graph.scrbl index 3f568925fd..d5c3324c99 100644 --- a/collects/mrlib/scribblings/graph/graph.scrbl +++ b/collects/mrlib/scribblings/graph/graph.scrbl @@ -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)])