* Mike Griffiths <
[email protected]>
| On Tuesday, 10 October 2023 at 15:57:30 UTC+1, Ralf Fassel wrote:
| > I have a menu like this:
| >
| > menu .m -tearoff false
| > .m add radiobutton -label 2 -value 2
| > .m add radiobutton -label foo -value foo
| >
--<snip-snip>--
| >
| > Is there some way to "configure-by-numerical-label" other than iterating
| > over the menu and checking whether the label matches the desired value?
| >
| The index for menus follow the rules for [string match]; as it does
| various forms of matching (including wildcard), you can use \ to
| indicate a literal character. So if you use {\2} for your index, it
| doesn't get treated as a numerical index and instead looks for a label
| matching the literal character "2".
| .m entrycget {\2} -value
Mike,
great, exactly what I am looking for! And since this is documented
behaviour, it is not even a 'hack' :-)
TNX
R'
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)