aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2011-01-19 22:18:55 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2011-01-19 22:18:55 +0000
commit3a76b8af8364d0ec5e226003213bf26a79b3a284 (patch)
tree3cfe34703ce7539e73c2d736368669d5539207f2
parent785c608efa3c041692ddc5a0ce2c069df03294d8 (diff)
replace the normal dash with a Unicode minus so that Tcl doesn't interpret the dash in the -label to make it a separator
svn path=/trunk/scripts/guiplugins/category_menu-plugin/; revision=14762
-rw-r--r--category_menu-plugin.tcl9
1 files changed, 7 insertions, 2 deletions
diff --git a/category_menu-plugin.tcl b/category_menu-plugin.tcl
index dc9f020..cd95eec 100644
--- a/category_menu-plugin.tcl
+++ b/category_menu-plugin.tcl
@@ -12,6 +12,7 @@ proc category_menu::load_menutree {} {
set testfile [file join $::current_plugin_loadpath menutree.tcl]
set f [open $testfile]
set menutree [read $f]
+# set menutree [regsub -all {([\{\s])\-([\s\}])} [read $f] {\1\\\\-\2}]
close $f
unset f
return $menutree
@@ -29,8 +30,12 @@ proc category_menu::create {mymenu} {
menu $mymenu.$category.$subcategory
$mymenu.$category add cascade -label $subcategory -menu $mymenu.$category.$subcategory
foreach item [lindex $subcategorylist end] {
- $mymenu.$category.$subcategory add command -label $item \
- -command "pdsend \"\$::focused_window obj \$::popup_xcanvas \$::popup_ycanvas $item\""
+ # replace the normal dash with a Unicode minus so that Tcl doesn't
+ # interpret the dash in the -label to make it a separator
+ $mymenu.$category.$subcategory add command \
+ -label [regsub -all {^\-$} $item {−}] \
+ -command \
+ "pdsend \"\$::focused_window obj \$::popup_xcanvas \$::popup_ycanvas $item\""
}
}
}