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
|
#!/usr/bin/perl -w
use strict;
use Gtk2::TestHelper tests => 10;
# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/t/GtkScrolledWindow.t,v 1.10 2006/08/07 18:36:05 kaffeetisch Exp $
my $window = Gtk2::ScrolledWindow -> new();
isa_ok($window, "Gtk2::ScrolledWindow");
my $adjustment = Gtk2::Adjustment -> new(0, 0, 100, 1, 5, 10);
$window -> set_hadjustment($adjustment);
is($window -> get_hadjustment(), $adjustment);
$window -> set_vadjustment($adjustment);
is($window -> get_vadjustment(), $adjustment);
$window = Gtk2::ScrolledWindow -> new(undef, undef);
isa_ok($window, "Gtk2::ScrolledWindow");
my $label = Gtk2::Label -> new("Bla");
$window -> add_with_viewport($label);
$window = Gtk2::ScrolledWindow -> new($adjustment, $adjustment);
isa_ok($window, "Gtk2::ScrolledWindow");
$window -> set_policy("always", "automatic");
is_deeply([$window -> get_policy()], ["always", "automatic"]);
$window -> set_placement("bottom-right");
is($window -> get_placement(), "bottom-right");
$window -> set_shadow_type("etched-in");
is($window -> get_shadow_type(), "etched-in");
SKIP: {
skip("new 2.8 stuff", 2)
unless Gtk2->CHECK_VERSION (2, 8, 0);
isa_ok($window -> get_hscrollbar(), "Gtk2::HScrollbar");
isa_ok($window -> get_vscrollbar(), "Gtk2::VScrollbar");
}
SKIP: {
skip("new 2.10 stuff", 0)
unless Gtk2->CHECK_VERSION (2, 10, 0);
$window -> unset_placement();
}
__END__
Copyright (C) 2003-2006 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
|