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 | |
parent | f887c19fc07ef662db06a0962dac361f24d03562 (diff) |
added raise/lower to cord tag
svn path=/trunk/scripts/guiplugins/simple_examples/; revision=15158
-rw-r--r-- | editmode_look-plugin.tcl | 5 | ||||
-rw-r--r-- | raisecords-plugin.tcl | 15 |
2 files changed, 18 insertions, 2 deletions
diff --git a/editmode_look-plugin.tcl b/editmode_look-plugin.tcl index 5cfe832..f7ab005 100644 --- a/editmode_look-plugin.tcl +++ b/editmode_look-plugin.tcl @@ -1,6 +1,6 @@ # this script makes it so that the cords are hidden when not in edit mode -proc set_cords_by_editmode {mytoplevel} { +proc set_cords_by_editmode {mytoplevel eventname} { if {$mytoplevel eq ".pdwindow"} {return} set tkcanvas [tkcanvas_name $mytoplevel] if { ! [winfo exists $mytoplevel] } {return} @@ -15,6 +15,7 @@ proc set_cords_by_editmode {mytoplevel} { $tkcanvas itemconfigure atom -activefill black $tkcanvas itemconfigure cord -fill black $tkcanvas itemconfigure {inlet || outlet} -outline black + $tkcanvas raise cord } else { $tkcanvas configure -background white $tkcanvas itemconfigure graph -fill magenta @@ -26,7 +27,7 @@ proc set_cords_by_editmode {mytoplevel} { $tkcanvas itemconfigure atom -activefill blue $tkcanvas itemconfigure cord -fill grey $tkcanvas itemconfigure {inlet || outlet} -outline white - $tkcanvas lower {inlet || outlet} + $tkcanvas lower {inlet || outlet || cord} } } 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} |