aboutsummaryrefslogtreecommitdiff
path: root/hide_cords_in_editmode-plugin.tcl
blob: a0cd189544540de282ac3b81f21ed27c45abb9cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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}