From 3a76b8af8364d0ec5e226003213bf26a79b3a284 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 19 Jan 2011 22:18:55 +0000 Subject: 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 --- category_menu-plugin.tcl | 9 +++++++-- 1 file 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\"" } } } -- cgit v1.2.1