aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2011-08-16 17:34:31 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2011-08-16 17:34:31 +0000
commit379289ccb91cd5ee0d68ae6a80088e658ac8f2ce (patch)
tree339f2d0e9ea10dbb2f7862bd59c2823bdb9ad01d
parent6c585e44b0f955c9ac3ce208fd7fc4f922c422fe (diff)
add arrowheads to cords to show direction of message flow
svn path=/trunk/scripts/guiplugins/simple_examples/; revision=15221
-rw-r--r--cordarrows-plugin.tcl16
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}