NAME
Glib::Ex::ConnectProperties::Element::widget -- various widget attributes
SYNOPSIS
Glib::Ex::ConnectProperties->new([$widget, 'widget#direction'],
[$another, 'something']);
DESCRIPTION
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, perget_direction()andset_direction()methods.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 forcedwrite_onlytarget so that it's not read back.widget#screenuses theget_screen()method. This means it will give the default screen until the widget is added to a toplevelGtk2::Windowor similar to determine the screen.widget#screenis read-only for most widgets, but is writable for anything with aset_screen()such asGtk2::Menu. There's a plainscreenproperty onGtk2::Windowso it doesn't need this specialwidget#screen, but other widgets benefit.Gtk2::Gdk::Screenis new in Gtk 2.2 andwidget#screenandwidget#has-screenare not available in Gtk 2.0.x.widget#stateis thestate()/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 withtoplevelflag set, orundefif none. This isget_toplevel()plus its recommended$parent->toplevel()flag check. Thehierarchy-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.
SEE ALSO
Glib::Ex::ConnectProperties, Glib::Ex::ConnectProperties::Element::widget_allocation, Gtk2::Widget
HOME PAGE
http://user42.tuxfamily.org/glib-ex-connectproperties/index.html
LICENSE
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/.