1#!/usr/bin/perl -w 2# vim: set ft=perl et sw=2 sts=2 : 3use strict; 4use Gtk2::TestHelper tests => 5, noinit => 1; 5 6# $Id$ 7 8my $group = Gtk2::SizeGroup -> new("vertical"); 9isa_ok($group, "Gtk2::SizeGroup"); 10 11$group -> set_mode("horizontal"); 12is($group -> get_mode(), "horizontal"); 13 14my $label = Gtk2::Label -> new("Bla"); 15 16$group -> add_widget($label); 17$group -> remove_widget($label); 18 19SKIP: { 20 skip("new 2.8 stuff", 1) 21 unless Gtk2->CHECK_VERSION (2, 8, 0); 22 23 $group -> set_ignore_hidden(TRUE); 24 ok($group -> get_ignore_hidden()); 25} 26 27SKIP: { 28 skip("new 2.10 stuff", 2) 29 unless Gtk2->CHECK_VERSION (2, 10, 0); 30 31 # we last left it empty. 32 my @widgets = $group->get_widgets; 33 ok(!@widgets); 34 35 my ($uno, $dos, $tres, $cuatro) = 36 (Gtk2::Label->new ("Tinky-Winky"), 37 Gtk2::Label->new ("Dipsy"), 38 Gtk2::Label->new ("La La"), 39 Gtk2::Label->new ("Po")); 40 41 # now add a few and try again. 42 $group->add_widget($uno); 43 $group->add_widget($dos); 44 $group->add_widget($tres); 45 $group->add_widget($cuatro); 46 @widgets = $group->get_widgets; 47 is (scalar @widgets, 4); 48 # i don't think we can count on an order. do we care about ensuring 49 # that the same widgets are in the group as we added? 50} 51 52__END__ 53 54Copyright (C) 2003-2006 by the gtk2-perl team (see the file AUTHORS for the 55full list). See LICENSE for more information. 56