Commit fd800403 authored by Torsten Schönfeld's avatar Torsten Schönfeld

Add overrides for Gtk3::Container::find_child_property and list_child_properties

parent fcd4942c
......@@ -980,6 +980,22 @@ sub Gtk3::Container::child_set {
}
}
=item * C<Gtk3::Container::find_child_property> and
C<Gtk3::Container::list_child_properties> are forwarded to the corresponding
functions in C<Gtk3::ContainerClass>.
=cut
sub Gtk3::Container::find_child_property {
return Gtk3::ContainerClass::find_child_property (@_);
}
sub Gtk3::Container::list_child_properties {
my $ref = Gtk3::ContainerClass::list_child_properties (@_);
return if not defined $ref;
return wantarray ? @$ref : $ref->[$#$ref];
}
=item * C<Gtk3::Container::get_focus_chain> returns a list of widgets, or an
empty list.
......@@ -1884,8 +1900,8 @@ sub Gtk3::Widget::render_icon {
}
=item * C<Gtk3::Widget::find_style_property> and
C<Gtk3::Widget::list_style_properties> to the corresponding functions in
C<Gtk3::WidgetClass>.
C<Gtk3::Widget::list_style_properties> are forwarded to the corresponding
functions in C<Gtk3::WidgetClass>.
=cut
......
......@@ -7,7 +7,7 @@ BEGIN { require './t/inc/setup.pl' }
use strict;
use warnings;
plan tests => 31;
plan tests => 42;
# we'll create some containers (windows and boxes are containers) and
# mess around with some of the methods to make sure they do things.
......@@ -128,8 +128,6 @@ $vbox->remove ($label);
#------------------------------------------------------------------------------
# find_child_property()
=for FIXME3
is (Gtk3::Container->find_child_property('Gtk3-Perl-test-no-such-property'),
undef,
'find_child_property() no such child property');
......@@ -139,11 +137,6 @@ is (eval { Gtk3::Container::find_child_property('Not::A::Container::Class',
undef,
'find_child_property() Not::A::Container::Class croaks');
is (eval { Gtk3::Container::find_child_property('Gtk3::Widget',
'propname'); 1 },
undef,
'find_child_property() Gtk3::Widget croaks');
{
my $pspec = Gtk3::Box->find_child_property('expand');
isa_ok ($pspec, 'Glib::Param::Boolean',
......@@ -161,13 +154,9 @@ is (eval { Gtk3::Container::find_child_property('Gtk3::Widget',
'find_child_property() object method "expand" is a boolean');
}
=cut
#------------------------------------------------------------------------------
# list_child_properties()
=for FIXME3
# as of Gtk 2.20 the base Gtk3::Container class doesn't have any child
# properties, but don't assume that, so don't ask anything of @pspecs, just
# that list_child_properties() returns
......@@ -178,11 +167,6 @@ is (eval { Gtk3::Container::list_child_properties('Not::A::Container::Class');
undef,
'list_child_properties() Not::A::Container::Class croaks');
is (eval { Gtk3::Container::list_child_properties('Gtk3::Widget');
1 },
undef,
'list_child_properties() Gtk3::Widget croaks');
{
my @pspecs = Gtk3::Box->list_child_properties;
cmp_ok (scalar(@pspecs), '>=', 2,
......@@ -204,10 +188,10 @@ is (eval { Gtk3::Container::list_child_properties('Gtk3::Widget');
my @pspecs = $hbox->list_child_properties;
cmp_ok (scalar(@pspecs), '>=', 2,
'list_child_properties() object method at least "expand" and "pack"');
isa_ok ($pspecs[0], 'Glib::ParamSpec');
isa_ok ($pspecs[1], 'Glib::ParamSpec');
}
=cut
__END__
Copyright (C) 2003-2012 by the gtk2-perl team (see the file AUTHORS for the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment