Glib::Ex::ConnectProperties::Element::widget -- various widget attributes
Glib::Ex::ConnectProperties->new([$widget, 'widget#direction'], [$another, 'something']);
This element class implements ConnectProperties access to the following attributes of a Gtk2::Widget,
widget#direction Gtk2::TextDirection enum, ltr or rtl widget#screen Gtk2::Gdk::Screen widget#has-screen boolean, read-only widget#state Gtk2::StateType enum widget#toplevel Gtk2::Window or undef, read-only
These things are not available as widget properties as such (though perhaps they could have been) but instead have get/set methods and report changes with specific signals.
widget#directionis the "ltr" or "rtl" text direction, per
If "none" is set then
get_direction()gives back "ltr" or "rtl" following the global default. Storing "none" with ConnectProperties probably won't work very well, except to a forced
write_onlytarget so that it's not read back.
get_screen()method. This means it will give the default screen until the widget is added to a toplevel
Gtk2::Windowor similar to determine the screen.
widget#screenis read-only for most widgets, but is writable for anything with a
Gtk2::Menu. There's a plain
Gtk2::Windowso it doesn't need this special
widget#screen, but other widgets benefit.
Gtk2::Gdk::Screenis new in Gtk 2.2 and
widget#has-screenare not available in Gtk 2.0.x.
set_state()condition, such as "normal" or "prelight".
Note that storing "insensitive" doesn't work very well, since a subsequent setting back to "normal" doesn't turn the sensitive flag back on. Perhaps this will change in the future, so as to actually enforce the desired new state.
widget#toplevelis the widget ancestor with
toplevelflag set, or
undefif none. This is
get_toplevel()plus its recommended
$parent->toplevel()flag check. The
hierarchy-changedsignal indicates a change to the toplevel.
Glib::Ex::ConnectProperties->new ([$toolitem, 'widget#toplevel'], [$dialog, 'transient-for']);
The toplevel is normally a
Gtk2::Windowor subclass, but in principle could be another class.
Copyright 2010, 2011, 2012, 2017 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/.