From 379289ccb91cd5ee0d68ae6a80088e658ac8f2ce Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 16 Aug 2011 17:34:31 +0000 Subject: add arrowheads to cords to show direction of message flow svn path=/trunk/scripts/guiplugins/simple_examples/; revision=15221 --- cordarrows-plugin.tcl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 cordarrows-plugin.tcl 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 <> {+add_arrows_to_cords %W} -- cgit v1.2.1