Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Select all/Select None option in the perl check box

by thundergnat (Deacon)
on Jan 23, 2012 at 16:33 UTC ( [id://949449]=note: print w/replies, xml ) Need Help??


in reply to Select all/Select None option in the perl check box

Updated: Misread original question. Updated code.

Is it possible? Yes. Here is one way to do it. (Perl/Tk. May need to adapt it for your particular GUI)

use warnings; use strict; use Tk; my %w; $w{mw} = MainWindow->new; my $col = 0; for my $cb ( 1 .. 5 ) { $w{cb}{$cb} = $w{mw}->Checkbutton( -text => $cb, )->grid( -row => 0, -column => $col++ ) } $w{cba} = $w{mw}->Checkbutton( -text => 'All', -command => sub{ for ( values %{$w{cb}} ) { $w{cba}->{'Value'} ? $ +_->select : $_->deselect } }, )->grid( -row => 0, -column => $col++ ); MainLoop;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://949449]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-25 13:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found