File: GtkSizeGroup.t

package info (click to toggle)
libgtk2-perl 1%3A1.140-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,808 kB
  • ctags: 609
  • sloc: perl: 14,245; ansic: 118; makefile: 70
file content (55 lines) | stat: -rw-r--r-- 1,450 bytes parent folder | download | duplicates (2)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/perl -w
# vim: set ft=perl  et sw=2 sts=2 :
use strict;
use Gtk2::TestHelper tests => 5, noinit => 1;

# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/t/GtkSizeGroup.t,v 1.10 2006/08/07 18:36:06 kaffeetisch Exp $

my $group = Gtk2::SizeGroup -> new("vertical");
isa_ok($group, "Gtk2::SizeGroup");

$group -> set_mode("horizontal");
is($group -> get_mode(), "horizontal");

my $label = Gtk2::Label -> new("Bla");

$group -> add_widget($label);
$group -> remove_widget($label);

SKIP: {
  skip("new 2.8 stuff", 1)
    unless Gtk2->CHECK_VERSION (2, 8, 0);

  $group -> set_ignore_hidden(TRUE);
  ok($group -> get_ignore_hidden());
}

SKIP: {
  skip("new 2.10 stuff", 2)
    unless Gtk2->CHECK_VERSION (2, 10, 0);

  # we last left it empty.
  my @widgets = $group->get_widgets;
  ok(!@widgets);

  my ($uno, $dos, $tres, $cuatro) =
    (Gtk2::Label->new ("Tinky-Winky"),
     Gtk2::Label->new ("Dipsy"),
     Gtk2::Label->new ("La La"),
     Gtk2::Label->new ("Po"));

  # now add a few and try again.
  $group->add_widget($uno);
  $group->add_widget($dos);
  $group->add_widget($tres);
  $group->add_widget($cuatro);
  @widgets = $group->get_widgets;
  is (scalar @widgets, 4);
  # i don't think we can count on an order.  do we care about ensuring
  # that the same widgets are in the group as we added?
}

__END__

Copyright (C) 2003-2006 by the gtk2-perl team (see the file AUTHORS for the
full list).  See LICENSE for more information.