diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2011-07-16 03:15:39 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2011-07-16 03:15:39 +0000 |
commit | 6c585e44b0f955c9ac3ce208fd7fc4f922c422fe (patch) | |
tree | cdeeb2972721dc72329306f915a9a45681392533 /raisecords-plugin.tcl | |
parent | f887c19fc07ef662db06a0962dac361f24d03562 (diff) |
added raise/lower to cord tag
svn path=/trunk/scripts/guiplugins/simple_examples/; revision=15158
Diffstat (limited to 'raisecords-plugin.tcl')
-rw-r--r-- | raisecords-plugin.tcl | 15 |
1 files changed, 15 insertions, 0 deletions
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 <<EditMode>> {+set_cords_by_editmode %W editmode} +bind PatchWindow <<Loaded>> {+set_cords_by_editmode %W loaded} |