ckj has asked for the wisdom of the Perl Monks concerning the following question:
In this program when the user clicks on "Preferred color" button then those radio buttons should be disable and only the preferred color should be selected. When the user clicks on submit, then all the radio button should be disable with a message that your change has been accepted.#!/wperl use strict; use warnings; use Tk; use Tk::Animation; my $mw = new MainWindow(-background=>'#3B5998', -title=>'GUI - @CKJ'); $mw->geometry('100x100+40+50'); #GUI Building Area #Default Settings my $frm_q1 = $mw -> Frame()-> pack(-side => 'top', -expand => 1, -fill + => 'x'); my $lbl_q1 = $frm_q1 -> Label(-text=>"Choose color")-> pack(-side => ' +left'); my $rdb_p = $frm_q1 -> Radiobutton(-text=>"Red",-value=>"1", -variabl +e=>"arg_02")-> pack(-side => 'left'); my $rdb_f = $frm_q1 -> Radiobutton(-text=>"Green",-value=>"2",-variabl +e=>"arg_02")-> pack(-side => 'left'); my $rdb_o = $frm_q1 -> Radiobutton(-text=>"Blue",-value=>"3",-variable +=>"arg_02")-> pack(-side => 'left'); my $but = $mw -> Button(-text=>"Preferred color", -command =>\&push_bu +tton)->pack(); my $but1 = $mw -> Button(-text=>"Submit", -command =>\&update_script)- +>pack(); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need suggestion in perl TK
by zentara (Cardinal) on Jul 05, 2012 at 08:42 UTC | |
by ckj (Chaplain) on Jul 05, 2012 at 08:45 UTC | |
|
Re: Need suggestion in perl TK
by Anonymous Monk on Jul 05, 2012 at 07:11 UTC |