NAME
Glib::Ex::ConnectProperties::Element::response_sensitive -- dialog response sensitivity
SYNOPSIS
Glib::Ex::ConnectProperties->new([$dialog, 'response-sensitive#ok'],
[$another, 'something']);
DESCRIPTION
This element class implements ConnectProperties access to the sensitivity of a response code in a Gtk2::Dialog
, Gtk2::InfoBar
or similar.
response-sensitive#ok boolean
response-sensitive#123 boolean
The name part after the "#" is a name or nick from the Gtk2::ResponseType
enum, or an integer application-defined response code (usually a positive integer).
Glib::Ex::ConnectProperties->new
([$job, 'have-help-available'],
[$dialog, 'response-sensitive#help', write_only => 1]);
response-sensitive#xx
is writable and is applied to the target object with $dialog->set_response_sensitive()
. Often writing is all that's needed and the write_only
option can force that if desired (see "General Options" in Glib::Ex::ConnectProperties).
response-sensitive#xx
is readable if the widget has a get_response_for_widget()
method, which means Gtk 2.8 up for Dialog, but not available for InfoBar (as of Gtk 2.22).
To read there must be at least one button etc using the response type, since sensitivity is not recorded in the dialog, it only sets the sensitive
property of action area widgets. ConnectProperties currently assumes the first widget it finds using the response will not be removed. Perhaps that could be relaxed in the future, but perhaps only as an option since buttons are normally unchanging and extra listening would be needed to notice a change.
Button sensitivity can also be controlled directly by finding the widget (or perhaps multiple widgets) for the given response and setting their sensitive
property. This response-sensitive#
is a convenient way to have someone else do that widget lookup.
SEE ALSO
Glib::Ex::ConnectProperties, Gtk2::Dialog, Gtk2::InfoBar
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/.