Kevin Ryde > Glib-Ex-ConnectProperties-19 > Glib::Ex::ConnectProperties::Element::child

Download:
Glib-Ex-ConnectProperties-19.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 19   Source  

NAME ^

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

SYNOPSIS ^

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

DESCRIPTION ^

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.

    child#propname

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

    Glib::Ex::ConnectProperties->new
      ([$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.

SEE ALSO ^

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

HOME PAGE ^

http://user42.tuxfamily.org/glib-ex-connectproperties/index.html

LICENSE ^

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 http://www.gnu.org/licenses/.

syntax highlighting: