1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
#
# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/t/GtkRadioAction.t,v 1.7 2006/08/07 18:36:05 kaffeetisch Exp $
#
use Gtk2::TestHelper
at_least_version => [2, 4, 0, "Action-based menus are new in 2.4"],
tests => 10, noinit => 1;
my @actions = (Gtk2::RadioAction->new (name => 'one', value => 0));
isa_ok ($actions[$#actions], 'Gtk2::RadioAction');
my $i = 1;
foreach (qw(two three four five)) {
push @actions, Gtk2::RadioAction->new (group => $actions[$#actions],
name => $_,
value => $i++);
isa_ok ($actions[$#actions], 'Gtk2::RadioAction');
}
my $group = $actions[0]->get_group;
push @actions, Gtk2::RadioAction->new (name => 'six', value => 5);
isa_ok ($actions[$#actions], 'Gtk2::RadioAction');
$actions[$#actions]->set_group ($group);
is ($actions[0]->get_current_value, 0);
if (Gtk2->CHECK_VERSION (2, 10, 0)) {
$actions[0]->set_current_value (3);
} else {
$actions[0]->set (value => 3);
}
is ($actions[0]->get_current_value, 3);
$actions[3]->set_active (TRUE);
ok (!$actions[0]->get_active);
ok ($actions[3]->get_active);
__END__
Copyright (C) 2003-2006 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
|