git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [Gitk PATCH 1/6] gitk: Add procedure to create accelerated menus

From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Date
Oct 11, 2008, 11:39 UTC
Message-ID
<200810111339.23343.robin.rosenberg.lists@dewire.com>
In-Reply-To
<18672.1017.68669.913415@cargo.ozlabs.ibm.com>
lördagen den 11 oktober 2008 03.40.09 skrev Paul Mackerras:
Show 10 quoted lines
> Robin Rosenberg writes:
> 
> > +proc mcw {menubar args} {
> > +    set ai [lsearch $args "-label"]
> > +    if { $ai > 0 } {
> > +	set label [lindex $args [expr {$ai + 1}]]
> > +	foreach {l u} [::tk::UnderlineAmpersand $label] {
> 
> Where did you find out about ::tk::UnderlineAmpersand?  Is it part of
> the exported interface of Tk that we can rely on in future?

I found it here. http://wiki.tcl.tk/1632. It hints that it may not be unoffical. Seems to original from: http://groups.google.com/group/comp.lang.perl.tk/browse_thread/thread/5b6f4c6a4a9f17b4/c9f8ab47800d27ee?lnk=st&q=#c9f8ab47800d27ee

so if someone thinks there is a problem we could replace it with UnderlineAmpersand with tcl code to do the same (or rip it as is if the license allows it).

Show 10 quoted lines
> 
> > +# Wrapper for mc to remove ampersands used for accelerators.
> > +proc mca {label} {
> > +    set tl8 [mc $label]
> > +    foreach {l u} [::tk::UnderlineAmpersand $tl8] break
> > +    return $l
> 
> 	return [string map {"&" ""} [mc $label]]
> 
> instead, perhaps?
In theory we should translate && to & also, which UnderLineAmpersand does.
-- robin
Previous: Paul MackerrasNext: Paul Mackerras
Message 9 of 15 in “[Gitk Patch 0/6]”
  1. 0/6 Robin Rosenberg, Oct 9, 2008
  2. 1/6 gitk: Add procedure to create accelerated menusRobin Rosenberg, Oct 9, 2008
  3. 2/6 gitk: Change menus to use accelerated designRobin Rosenberg, Oct 9, 2008
  4. 3/6 gitk: regenerated po filesRobin Rosenberg, Oct 9, 2008
  5. 4/6 gitk: Add accelerator hintsRobin Rosenberg, Oct 9, 2008
  6. 5/6 gitk: regenerated po filesRobin Rosenberg, Oct 9, 2008
  7. 6/6 gitk: Add menu accelerators for Swedish translationRobin Rosenberg, Oct 9, 2008
  8. Paul MackerrasOct 11, 2008
  9. Robin RosenbergOct 11, 2008
  10. Paul MackerrasOct 11, 2008
  11. Robin RosenbergOct 11, 2008
  12. Paul MackerrasOct 18, 2008
  13. Add menu acceleratorsRobin Rosenberg, Oct 19, 2008
  14. Add menu acceleratorsRobin Rosenberg, Oct 19, 2008
  15. Paul MackerrasOct 20, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.