aboutsummaryrefslogtreecommitdiff
path: root/cordarrows-plugin.tcl
blob: 1c35a6dc025404466ea49b5b6323b994bc89a238 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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 PatchWindow <<EditMode>> {+add_arrows_to_cords %W}