Re: Using foreach loop to create radiobutton menu
- From: Uwe Klein <uwe_klein_habertwedt@xxxxxxxxxxx>
- Date: Fri, 28 Apr 2006 19:07:42 +0200
Bryan Oakley wrote:
Ok, I didn't realize you were using Iwidgets. I haven't used iwidgets in years and it appears to have some odd features. For example, I had no idea you could have a "foreach" statement inside a "-menu" definition.
You can't.
::iwidgets::menubar does a [subst] in an [uplevel] on the value that is
supplied for the -menu option.
the way to go would be build the -menu argument
with foreach:
foreach rng 1 {
append menuarg "radiobutton $f.range -label \"$rng\" -command {puts hello} ;"
}
menubutton $f.range -text "VALUE" -menu $menuarg
or thereabouts.
++++++++++++++++++++++++++
i get this as error output:
Error in startup script: can't read "rng": no such variable
while executing
"subst {
menubutton $f.range -text "VALUE" -menu {
foreach rng 1 {
radiobutton $f.range -label "$rng" -command {puts hello}
}
}
}"
uwe
.
- References:
- Using foreach loop to create radiobutton menu
- From: aj
- Re: Using foreach loop to create radiobutton menu
- From: Bryan Oakley
- Re: Using foreach loop to create radiobutton menu
- From: aj
- Re: Using foreach loop to create radiobutton menu
- From: Bryan Oakley
- Re: Using foreach loop to create radiobutton menu
- From: aj
- Re: Using foreach loop to create radiobutton menu
- From: Bryan Oakley
- Using foreach loop to create radiobutton menu
- Prev by Date: Re: Using foreach loop to create radiobutton menu
- Next by Date: Re: Tcl/Tk 8.5a4 released
- Previous by thread: Re: Using foreach loop to create radiobutton menu
- Next by thread: Re: Using foreach loop to create radiobutton menu
- Index(es):