Gtk2::Gdk::Screen(3)
π Gtk2::Gdk::Screen π
okay so bestie, welcome to Gtk2::Gdk::Screen β it's the Perl wrapper for GdkScreen, which is basically the vibe of an entire physical screen (or a screen-like thing) that your GTK+ app is living on. it's from the gtk2-perl docs, the user-contributed Perl kind, and it's giving "I know exactly how many monitors you have and I'm not afraid to tell you" π
πΈ HIERARCHY πΈ
this is the family tree, and it's a short one:
Glib::Object
+----Gtk2::Gdk::Screen
so like. it's a Glib::Object girlie, and that's the whole lineage. iconic minimalism, honestly. π
β¨ METHODS β¨
here's the whole roster, no skips, no cuts, fr fr:
window = $screen->get_active_windowβ grabs you the currently active window on the screen.- Since: gtk+ 2.10
$screen->broadcast_client_message ($event)β shouts a client message out to everyone listening.$event(Gtk2::Gdk::Event)
colormap = $screen->get_default_colormapβ the default colormap for this screen.$screen->set_default_colormap ($colormap)β sets that default colormap.$colormap(Gtk2::Gdk::Colormap)
screen or undef = Gtk2::Gdk::Screen->get_defaultβ a class method! hands you the default screen, orundefif there just isn't one. it's giving "maybe, maybe not" πdisplay = $screen->get_displayβ the display this screen belongs to.fontoptions or undef = $screen->get_font_optionsβ the font options, possiblyundef.- Since: gtk+ 2.10
$screen->set_font_options ($options)β set the font options.$options(Cairo::FontOptions or undef)- Since: gtk+ 2.10
integer = $screen->get_heightβ the height, in pixels, as an integer.integer = $screen->get_height_mmβ the height, but in millimeters. yes, real-world units. she contains multitudes. πboolean = $screen->is_compositedβ true/false: is this screen composited?- Since: gtk+ 2.10
list = $screen->list_visualsβ Returns a list of Gtk2::Gdk::Visual's.string = $screen->make_display_nameβ builds a display name string for you.integer = $screen->get_monitor_at_point ($x, $y)β which monitor is at this point?$x(integer)$y(integer)
integer = $screen->get_monitor_at_window ($window)β which monitor is this window chillin' on?$window(Gtk2::Gdk::Window)
rectangle = $screen->get_monitor_geometry ($monitor_num)β the geometry (a rectangle) of the given monitor.$monitor_num(integer)
integer = $screen->get_monitor_height_mm ($monitor_num)β that monitor's height in millimeters.$monitor_num(integer)- Since: gtk+ 2.14
unsigned = $screen->get_monitor_output ($monitor_num)β the monitor's output, as an unsigned value.$monitor_num(integer)- Since: gtk+ 2.14
string or undef = $screen->get_monitor_plug_name ($monitor_num)β the plug name of the monitor, orundef.$monitor_num(integer)- Since: gtk+ 2.14
integer = $screen->get_monitor_width_mm ($monitor_num)β that monitor's width in millimeters.$monitor_num(integer)- Since: gtk+ 2.14
integer = $screen->get_n_monitorsβ how many monitors, bestie. the count. the number. πinteger = $screen->get_numberβ the screen's number.integer = $screen->get_primary_monitorβ which one is the main character monitor.- Since: gtk+ 2.20
double = $screen->get_resolutionβ the resolution, as a double.- Since: gtk+ 2.10
$screen->set_resolution ($dpi)β set the resolution.$dpi(double)- Since: gtk+ 2.10
colormap = $screen->get_rgb_colormapβ the RGB colormap.visual = $screen->get_rgb_visualβ the RGB visual.colormap or undef = $screen->get_rgba_colormapβ the RGBA colormap, orundef.- Since: gtk+ 2.8
visual or undef = $screen->get_rgba_visualβ the RGBA visual, orundef.- Since: gtk+ 2.8
window = $screen->get_root_windowβ the root window of the screen. the origin story. π±integer = $screen->get_screen_numberβ the screen number, as an integer.- Since: gtk+ 2.2
scalar = $screen->get_setting ($name)β pull a setting by name.$name(string)
boolean = $screen->supports_net_wm_hint ($property)β does this screen support the given_NET_WMhint property? true/false.$property(Gtk2::Gdk::Atom)- Since: gtk+ 2.2
colormap = $screen->get_system_colormapβ the system colormap.visual = $screen->get_system_visualβ the system visual.list = $screen->get_toplevel_windowsβ Returns a list of Gtk2::Gdk::Window's.integer = $screen->get_widthβ the width, in pixels.integer = $screen->get_width_mmβ the width, in millimeters. metric girlie representation π«Άstring = $screen->get_window_manager_nameβ the name of the window manager, as a string.- Since: gtk+ 2.2
list = $screen->get_window_stackβ the window stack, as a list. stacking order matters, bestie, it's a whole hierarchy of who's on top π- Since: gtk+ 2.10
π PROPERTIES π
two properties, both absolute divas:
'font-options'(gpointer: default0: readable / writable / private / static-nick / static-blurb) β The default font options for the screen'resolution'(double: default-1: readable / writable / private / static-nick / static-blurb) β The resolution for fonts on the screen
π SIGNALS π
these are the moments she yells at you, and honestly? valid:
composited-changed(Gtk2::Gdk::Screen)monitors-changed(Gtk2::Gdk::Screen)size-changed(Gtk2::Gdk::Screen)
π SEE ALSO π
go read these too, iykyk:
Gtk2Glib::Object
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.
no cap, that's the whole page. go forth and interrogate your monitors. π¦
okay and the official receipts, bestie: this was perl v5.42.0, dated 2025-07-25, filed under Gtk2::Gdk::Screen(3). mwah, periodt π
β¨
π¦ where this page comes from
- fedora 43: perl-Gtk2 1.24993-23.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms