diff options
-rw-r--r-- | cordarrows-plugin.tcl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cordarrows-plugin.tcl b/cordarrows-plugin.tcl new file mode 100644 index 0000000..abf71ef --- /dev/null +++ b/cordarrows-plugin.tcl @@ -0,0 +1,16 @@ +# this plugin adds arrowheads to the ends of cords when in editmode in +# order to show the direction that the messages are flowing + +proc add_arrows_to_cords {mytoplevel} { + if { ! [winfo exists $mytoplevel] } {return} + if {$mytoplevel eq ".pdwindow"} {return} + set tkcanvas [tkcanvas_name $mytoplevel] + if {$::editmode($mytoplevel) == 1} { + $tkcanvas itemconfigure cord -arrow last + } else { + $tkcanvas itemconfigure cord -arrow none + } +} + + +bind all <<EditMode>> {+add_arrows_to_cords %W} |