From 6c585e44b0f955c9ac3ce208fd7fc4f922c422fe Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sat, 16 Jul 2011 03:15:39 +0000 Subject: added raise/lower to cord tag svn path=/trunk/scripts/guiplugins/simple_examples/; revision=15158 --- raisecords-plugin.tcl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 raisecords-plugin.tcl (limited to 'raisecords-plugin.tcl') diff --git a/raisecords-plugin.tcl b/raisecords-plugin.tcl new file mode 100644 index 0000000..8212d63 --- /dev/null +++ b/raisecords-plugin.tcl @@ -0,0 +1,15 @@ +# this script makes it so that the cords are hidden when not in edit mode + +proc set_cords_by_editmode {mytoplevel eventname} { + if {$mytoplevel eq ".pdwindow"} {return} + if { ! [winfo exists $mytoplevel] } {return} + set tkcanvas [tkcanvas_name $mytoplevel] + if {$::editmode($mytoplevel) == 1} { + $tkcanvas raise cord + } else { + $tkcanvas lower cord + } +} + +bind PatchWindow <> {+set_cords_by_editmode %W editmode} +bind PatchWindow <> {+set_cords_by_editmode %W loaded} -- cgit v1.2.1