From e58f6b3236f51c06e53c407a46d41f5e898c3b3c Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 30 Nov 2010 21:18:47 +0000 Subject: added the simple plugins from the pd-gui-rewrite/0.43/startup branch svn path=/trunk/scripts/guiplugins/simple_examples/; revision=14540 --- hide_cords_in_editmode-plugin.tcl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 hide_cords_in_editmode-plugin.tcl (limited to 'hide_cords_in_editmode-plugin.tcl') diff --git a/hide_cords_in_editmode-plugin.tcl b/hide_cords_in_editmode-plugin.tcl new file mode 100644 index 0000000..a0cd189 --- /dev/null +++ b/hide_cords_in_editmode-plugin.tcl @@ -0,0 +1,16 @@ +# this script makes it so that the cords are hidden when not in edit mode + +proc set_cords_by_editmode {mytoplevel} { + if {$mytoplevel eq ".pdwindow"} {return} + set tkcanvas [tkcanvas_name $mytoplevel] + if { ! [winfo exists $mytoplevel] } {return} + if {$::editmode($mytoplevel) == 1} { + $tkcanvas itemconfigure cord -fill black + $tkcanvas raise cord + } else { + $tkcanvas itemconfigure cord -fill white + $tkcanvas lower cord + } +} + +bind all <> {+set_cords_by_editmode %W} -- cgit v1.2.1