Re: Using foreach loop to create radiobutton menu



Once again, I appreciate the expeditiousness and comprehensiveness of
your last post. That being said, the complaint comes when I load the
script, NOT when I click on the button.

Here is a complete script exemplifying the problem. Run this in your
favorite wish interpreter to see if you get the same error I do.
Hopefully uou have Iwidgets.

I reduced the usage of the "rng" variable to one place, and wrapped it
in quotes as you said to expand it.

package require Iwidgets

set f [frame .main]

iwidgets::menubar $f.menu -menubuttons {
menubutton range -text "VALUE" -menu {
foreach rng {1} {
radiobutton range -label "$rng" -command {puts hello}
}
}
}

.