Glib::Ex::ConnectProperties::Element::tree_selection -- TreeSelection rows
Glib::Ex::ConnectProperties->new([$treesel, 'tree-selection#width'], [$another, 'something']);
This element class implements ConnectProperties access to rows selected in a Gtk2::TreeSelection.
tree-selection#empty boolean, read-only tree-selection#not-empty boolean, read-only tree-selection#count integer, read-only tree-selection#selected-path Gtk2::TreePath or undef
A Gtk2::TreeSelection is normally used by Gtk2::TreeView. The target object for ConnectProperties should be the TreeSelection, as obtained from the TreeView with
Gtk2::TreeSelection
Gtk2::TreeView
$treeselection = $treeview->get_selection();
For example tree-selection#not-empty might be connected up to make a delete button sensitive only when the user has selected one or more rows,
tree-selection#not-empty
my $treeselection = $treeview->get_selection; Glib::Ex::ConnectProperties->new ([$treeselection, 'tree-selection#not-empty'], [$button, 'sensitive', write_only => 1]);
tree-selection#selected-path is the first selected row. It's intended for use with "single" selection mode so there's at most one row selected. Writing to the property does select_path() and in single mode will switch from any existing selected row to just the new one. This could be used to synchronise the selected item in two TreeViews.
tree-selection#selected-path
select_path()
Rows in a Gtk2::TreeSelection and items in a Gtk2::IconView are similar but not quite the same and so are kept as separate tree-selection# and iconview-selection#.
Gtk2::IconView
tree-selection#
iconview-selection#
For reference a selected-iter of type Gtk2::TreeIter might mostly work, but not sure about comparing on storing. Would prefer an equal() or compare() method on Gtk2::TreeIter rather than going via the model. (Perl-Gtk2's to_arrayref() access only suits Perl code models.)
selected-iter
Gtk2::TreeIter
equal()
compare()
to_arrayref()
Glib::Ex::ConnectProperties, Glib::Ex::ConnectProperties::Element::iconview_selection, Glib::Ex::ConnectProperties::Element::model_rows, Glib::Ex::ConnectProperties::Element::combobox_active, Gtk2::TreeSelection, Gtk2::TreeView, Gtk2::TreePath
http://user42.tuxfamily.org/glib-ex-connectproperties/index.html
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/.
To install Glib::Ex::ConnectProperties, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Glib::Ex::ConnectProperties
CPAN shell
perl -MCPAN -e shell install Glib::Ex::ConnectProperties
For more information on module installation, please visit the detailed CPAN module installation guide.