Re: [Gitk PATCH 1/6] gitk: Add procedure to create accelerated menus
- From
Paul Mackerras <paulus@samba.org>
- Date
- Oct 11, 2008, 01:40 UTC
- Message-ID
- <18672.1017.68669.913415@cargo.ozlabs.ibm.com>
- In-Reply-To
- <1223532590-8706-2-git-send-email-robin.rosenberg@dewire.com>
Robin Rosenberg writes:
Show 5 quoted lines
> +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?
Show 5 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?
Paul.