Glib::Ex::ConnectProperties::Element::textbuffer -- TextBuffer character count
Glib::Ex::ConnectProperties->new([$textbuf, 'textbuffer#empty'], [$another, 'something']);
This element class implements ConnectProperties access to the following attributes of a Gtk2::TextBuffer.
textbuffer#empty boolean, read-only textbuffer#not-empty boolean, read-only textbuffer#char-count integer, read-only
For example textbuffer#not-empty might be connected up to make a "clear" button sensitive only when there is in fact something to clear
textbuffer#not-empty
Glib::Ex::ConnectProperties->new ([$textbuf, 'textbuffer#not-empty'], [$button, 'sensitive', write_only => 1]);
These attributes use $textbuf->get_char_count(). Gtk2::TextBuffer doesn't offer this count from a property as such, only a method.
$textbuf->get_char_count()
Gtk2::TextBuffer
The full text string is available from the text property on the TextBuffer in the usual way. But Gtk circa 2.24.8 doesn't seem to emit a notify for changes to it, only the changed signal. If accessing text with ConnectProperties it may be necessary to use read_signal => "changed" instead of the usual notify.
text
notify
changed
read_signal => "changed"
Glib::Ex::ConnectProperties, Glib::Ex::ConnectProperties::Element::model_rows, Gtk2::TextBuffer
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.