aboutsummaryrefslogtreecommitdiff
path: root/hide_cords_in_editmode-plugin.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'hide_cords_in_editmode-plugin.tcl')
-rw-r--r--hide_cords_in_editmode-plugin.tcl16
1 files changed, 16 insertions, 0 deletions
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 <<EditMode>> {+set_cords_by_editmode %W}