Is it possible to select just one check button in Tk? I have two buttons, and I want to have the second one return to a normal state if the other is selected.
This is what I have for code
Any ideas why this won't work?my $snmp_version1 = $right_frame->Checkbutton( -text => 'SNMPv1', -indicatoron => 'false', -selectcolor => 'green', -command => sub {$version = 1;}, ); $snmp_version1->pack(-padx => 5, -pady => 5,-anchor => 'w'); &BIND_MESSAGE($snmp_version1, "Send SNMP version 1 Traps"); my $snmp_version2 = $right_frame->Checkbutton( -text => 'SNMPv2', -indicatoron => 'false', -selectcolor => 'green', -command => sub {$version = 2; $snmp_version1->{'normal'}}, ); $snmp_version2->pack(-padx => 5, -pady => 5,-anchor => 'w'); &BIND_MESSAGE($snmp_version2, "Send SNMP version 2 Traps");
Thanks
In reply to Selecting a single Checkbutton in Tk by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |