For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > June 2004 > tk CheckbuttonGroup ... need a sample running script









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author tk CheckbuttonGroup ... need a sample running script
valued customer

2004-06-05, 3:56 pm

Trying to get started with Tk::CheckbuttonGroup and I
just need a sample running script... the following
test code does not work.

Thanks for any help.

use strict;
use warnings;
use Tk;
use Tk::CheckbuttonGroup;

my($top) = MainWindow->new();

$top->CheckbuttonGroup()->pack;
my @selected = qw(two four);
my $cbg = $top->CheckbuttonGroup (
-list => [qw( one two three four five )],
-orientation => 'vertical',
-variable => \@selected,
-command => sub {
print @selected, "\n";
}
);

Mainloop;
Dieter D'Hoker

2004-06-05, 3:56 pm

valued customer wrote:
> Trying to get started with Tk::CheckbuttonGroup and I
> just need a sample running script... the following
> test code does not work.
>
> Thanks for any help.
>
> use strict;
> use warnings;
> use Tk;
> use Tk::CheckbuttonGroup;
>
> my($top) = MainWindow->new();
>
> $top->CheckbuttonGroup()->pack;
> my @selected = qw(two four);
> my $cbg = $top->CheckbuttonGroup (
> -list => [qw( one two three four five )],
> -orientation => 'vertical',
> -variable => \@selected,
> -command => sub {
> print @selected, "\n";
> }
> );
>
> Mainloop;



use strict;
use warnings;
use Tk;
use Tk::CheckbuttonGroup;

my($top) = MainWindow->new();

my @selected = qw(two four);
my $cbg = $top->CheckbuttonGroup (
-list => [qw( one two three four five )],
-orientation => 'vertical',
-variable => \@selected,
-command => sub {
print @selected, "\n";
}
)->pack();

MainLoop;


--
Dieter D'Hoker
news:free.nl.dieter.dhoker & news:alt.nl.fan.dieter.dhoker
Google? http://neverseenbefore.com/
Multiplayer tetris? http://www.tsrv.com/


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com