Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, I am building a graphical interface for my program, using radio Buttons
I would like to have 3 buttons linked to a same variable, 2 of them have a fixed -value field. I want the last one to be configurable by the user
I would like to configure this value using a ttk_entry, here's an extract of my code
$Mode="Mode1"; my $entry26 = $lf21->new_ttk__radiobutton(-text => "Mode1", -variable +=> \$Mode, -value => "Mode1"); my $entry27 = $lf21->new_ttk__radiobutton(-text => "Mode2", -variable +=> \$Mode, -value => "Mode2"); my $entry28 = $lf21->new_ttk__radiobutton(-text => "Other:", -variable + => \$Mode, -value => $OtherMode ); my $entry29 = $lf21->new_ttk__entry( -validate => 'focusout', -textvariable => \$OtherMode, );
From the tests i did, i can say that $OtherMode takes the value of the entry but, if I select the last button, the $Mode variable contains an empty string
do you have any idea of what i did wrong?
thanks in advance, have a great day :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: [Tkx] passing a variable to -value field in radio button
by choroba (Cardinal) on Nov 21, 2017 at 17:34 UTC | |
by Anonymous Monk on Nov 22, 2017 at 09:05 UTC | |
by Anonymous Monk on Nov 22, 2017 at 11:11 UTC |