diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2010-11-30 21:18:47 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2010-11-30 21:18:47 +0000 |
commit | e58f6b3236f51c06e53c407a46d41f5e898c3b3c (patch) | |
tree | 0f591563a53ca78869729ec022f76de692306885 /editmode_look-plugin.tcl |
added the simple plugins from the pd-gui-rewrite/0.43/startup branchsvn2git-root
svn path=/trunk/scripts/guiplugins/simple_examples/; revision=14540
Diffstat (limited to 'editmode_look-plugin.tcl')
-rw-r--r-- | editmode_look-plugin.tcl | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/editmode_look-plugin.tcl b/editmode_look-plugin.tcl new file mode 100644 index 0000000..669d03f --- /dev/null +++ b/editmode_look-plugin.tcl @@ -0,0 +1,33 @@ +# 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 configure -background "#fff" + $tkcanvas itemconfigure graph -fill black + $tkcanvas itemconfigure array -fill black + $tkcanvas itemconfigure array -activefill blue + $tkcanvas itemconfigure label -fill black + $tkcanvas itemconfigure obj -fill black + $tkcanvas itemconfigure msg -activefill black + $tkcanvas itemconfigure atom -activefill black + $tkcanvas itemconfigure cord -fill black + $tkcanvas itemconfigure {inlet || outlet} -outline black + } else { + $tkcanvas configure -background white + $tkcanvas itemconfigure graph -fill magenta + $tkcanvas itemconfigure array -fill cyan + $tkcanvas itemconfigure array -activefill blue + $tkcanvas itemconfigure label -fill "#777777" + $tkcanvas itemconfigure obj -fill grey + $tkcanvas itemconfigure msg -activefill blue + $tkcanvas itemconfigure atom -activefill blue + $tkcanvas itemconfigure cord -fill grey + $tkcanvas itemconfigure {inlet || outlet} -outline white + $tkcanvas lower {inlet || outlet} + } +} + +bind all <<EditMode>> {+set_cords_by_editmode %W} |