View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Kevin Ryde > Glib-Ex-ConnectProperties > Glib::Ex::ConnectProperties::Element::child



Annotate this POD


View/Report Bugs
Module Version: 19   Source  


Glib::Ex::ConnectProperties::Element::child -- container child properties


 Glib::Ex::ConnectProperties->new([$childwidget, 'child#propname'],
                                  [$another,     'something']);


This element class implements ConnectProperties access to the "child properties" provided by Gtk2::Container subclasses on a widget stored in a container.

These properties require Perl-Gtk2 1.240 and up for find_child_property(). The properties are accessed on the child widget, with names as specified by the container.


For example Gtk2::Table has child properties for the child attach positions. These are separate from normal object properties.

      ([$adj,         'value'],
       [$childwidget, 'child#bottom-attach']);

$childwidget should be a widget which is in a container with the given child property. If $childwidget is unparented later then nothing is read or written by ConnectProperties. Unparenting happens during destruction and quietly doing nothing is usually best in that case.

It's unspecified yet what happens if $childwidget is reparented. Gtk emits a child-notify for each property so in the current ConnectProperties code the initial value set by the container will propagate out. It might be better to apply the first readable ConnectProperties element onto the child, like at ConnectProperties creation. (But noticing a reparent requires a parent-set or notify::parent signal, so perhaps a watch_reparent option should say when reparent handling might be needed, so as not to listen for something which will never happen.)

For reference, Goo::Canvas has a system of child properties too on its canvas items. They could be offered too when its Perl bindings have find_child_property(). But the method names are slightly different so probably a separate goo-child#propname.


Glib::Ex::ConnectProperties, Gtk2::Container



Copyright 2010, 2011, 2012 Kevin Ryde

Glib-Ex-ConnectProperties is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Glib-Ex-ConnectProperties is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Glib-Ex-ConnectProperties. If not, see

syntax highlighting: