Glib::Ex::ConnectProperties::Element::screen_size -- screen size in pixels or millimetres
Glib::Ex::ConnectProperties->new([$screen, 'screen-size#width'], [$another, 'something']);
This element class implements ConnectProperties access to the size of a a Gtk2::Gdk::Screen, either in pixels or millimetres.
screen-size#width integer pixels, read-only screen-size#height integer pixels, read-only screen-size#width-mm integer millimetres, read-only screen-size#height-mm integer millimetres, read-only
These are $screen->get_width() etc.
$screen->get_width()
screen-size#width and screen-size#height changes are noticed with the size-changed signal. In Gtk 2.14 screen-size#width-mm and screen-size#height-mm changes are noticed with the monitors-changed signal. Before Gtk 2.14 the millimetres don't change.
screen-size#width
screen-size#height
size-changed
screen-size#width-mm
screen-size#height-mm
monitors-changed
The size in pixels can change with the video mode. The size in millimetres can change from a RANDR or Xinerama rearrangement of output monitors. In all cases the sizes are read-only since Gtk2::Gdk::Screen doesn't have anything to perform video mode or monitor changes.
Gtk2::Gdk::Screen
For example to display the screen width in a label,
my $toplevel = Gtk2::Window->new('toplevel'); my $screen = $toplevel->get_screen; # to display the size in some label widget Glib::Ex::ConnectProperties->new ([$screen, 'screen-size#width'], [$label, 'label']);
For reference, under X the way Gtk2::Gdk::Window implements fullscreen() probably requires the window manager to notice screen size changes and keep the window full screen on a screen size change. Hopefully an application doesn't have to link screen-size# to the window size to keep full screen.
Gtk2::Gdk::Window
fullscreen()
screen-size#
Glib::Ex::ConnectProperties, Glib::Ex::ConnectProperties::Element::widget_allocation, Gtk2::Gdk::Screen
http://user42.tuxfamily.org/glib-ex-connectproperties/index.html
Copyright 2010, 2011, 2012, 2014, 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/.
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.