Popcorn Dave has asked for the wisdom of the Perl Monks concerning the following question:
I'm having a bit of a problem finding any docs on this. I want to set the default on a radio button. This is my code thusfar:
$shape="square"; (stuff deleted) foreach ('square ', 'circle ', 'polygon'){ $frame2->Radiobutton( -bg=>COLOR, -activebackground=>COLOR, -text=>$_, -font=>'code14', -value=>$_, -variable=>\$shape, )->pack(-anchor=>'w'); }
My question is: Why isn't the radio button being set to square initiallly since I've set the variable? The radio buttons are being drawn fine, but with none selected.
All I can find in Mastering Perl/Tk is a reference to the default on a regular button. There is nothing listed in the reference charts in the back either. Have I missed something here?
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Default radio button in Tk
by ariels (Curate) on May 05, 2002 at 06:06 UTC |