Gtk2::Gdk(3)
β¨ NAME β¨
Gtk2::Gdk β it's the Gdk bit of the Gtk2 Perl bindings, bestie. The low-level graphics/window-system layer that Gtk2 sits on top of. This page is the User Contributed Perl Documentation version, and we're gonna go through every single thing on it together, no skips. π
π«Ά METHODS π«Ά
okay so this is the big one. Grab a snack. π
atom = Gtk2::Gdk->SELECTION_CLIPBOARDβ hands you the clipboard selection atom. πatom = Gtk2::Gdk->SELECTION_PRIMARYβ the primary selection atom, aka the thing that happens when you highlight text and middle-click. πatom = Gtk2::Gdk->SELECTION_SECONDARYβ the secondary selection atom. Rarely used, but she's there. πatom = Gtk2::Gdk->SELECTION_TYPE_ATOMβ selection type: atom.atom = Gtk2::Gdk->SELECTION_TYPE_BITMAPβ selection type: bitmap.atom = Gtk2::Gdk->SELECTION_TYPE_COLORMAPβ selection type: colormap.atom = Gtk2::Gdk->SELECTION_TYPE_DRAWABLEβ selection type: drawable.atom = Gtk2::Gdk->SELECTION_TYPE_INTEGERβ selection type: integer.atom = Gtk2::Gdk->SELECTION_TYPE_PIXMAPβ selection type: pixmap.atom = Gtk2::Gdk->SELECTION_TYPE_STRINGβ selection type: string. π€atom = Gtk2::Gdk->SELECTION_TYPE_WINDOWβ selection type: window.atom = Gtk2::Gdk->TARGET_BITMAPβ target atom: bitmap.atom = Gtk2::Gdk->TARGET_COLORMAPβ target atom: colormap.atom = Gtk2::Gdk->TARGET_DRAWABLEβ target atom: drawable.atom = Gtk2::Gdk->TARGET_PIXMAPβ target atom: pixmap.atom = Gtk2::Gdk->TARGET_STRINGβ target atom: string.Gtk2::Gdk->beepβ literally just makes the thing go beep. iconic. πwindow = Gtk2::Gdk->get_default_root_windowβ returns the default root window. πlist = Gtk2::Gdk->devices_listβ returns a list of GdkDevices.string = Gtk2::Gdk->get_display_arg_nameβ Since: gtk+ 2.2string = Gtk2::Gdk->get_displayβ grabs you the display name as a string. π₯οΈinteger = Gtk2::Gdk->error_trap_popβ pops the error trap. (yes, they're a pair, don't leave her hanging.)Gtk2::Gdk->error_trap_pushβ pushes the error trap. the other half of the situationship.boolean = Gtk2::Gdk->events_pendingβ true if there are events waiting in the queue. πGtk2::Gdk->flushβ flushes the Gdk output buffer. π½β¨ (no but seriously it's the display one)boolean = Gtk2::Gdk->initβ initializes Gdk. returns a boolean.boolean = Gtk2::Gdk->init_checkβ checks whether Gdk is initialized. returns a boolean.grabstatus = Gtk2::Gdk->keyboard_grab ($window, $owner_events, $time_)β grabs the keyboard, returns a grabstatus.$window(Gtk2::Gdk::Window)$owner_events(boolean)$time_(unsigned)
Gtk2::Gdk->keyboard_ungrab ($time_)β releases that keyboard grab.$time_(unsigned)
(lower, upper) = Gtk2::Gdk->keyval_convert_case ($symbol)β gives you back a(lower, upper)pair, in that order.$symbol(integer)
integer = Gtk2::Gdk->keyval_from_name ($keyval_name)β turns a keyval name into a keyval integer.$keyval_name(string)
boolean = Gtk2::Gdk->keyval_is_lower ($keyval)β true if the keyval is lowercase.$keyval(integer)
boolean = Gtk2::Gdk->keyval_is_upper ($keyval)β true if the keyval is uppercase.$keyval(integer)
string = Gtk2::Gdk->keyval_name ($keyval)β the name of a keyval, as a string.$keyval(integer)
integer = Gtk2::Gdk->keyval_to_lower ($keyval)β converts a keyval to its lowercase form.$keyval(integer)
unsigned = Gtk2::Gdk->keyval_to_unicode ($keyval)β converts a keyval to a Unicode codepoint, returned as an unsigned.$keyval(integer)
integer = Gtk2::Gdk->keyval_to_upper ($keyval)β converts a keyval to its uppercase form.$keyval(integer)
list = Gtk2::Gdk->list_visualsβ gives you a list of visuals. πstring = Gtk2::Gdk->set_localeβ sets the locale, returns a string.Gtk2::Gdk->notify_startup_completeβ Since: gtk+ 2.2Gtk2::Gdk->notify_startup_complete_with_id ($startup_id)β same vibe but you pass the startup id yourself.$startup_id(string)
Since: gtk+ 2.12
Gtk2::Gdk->parse_argsβ Since: gtk+ 2.2grabstatus = Gtk2::Gdk->pointer_grab ($window, $owner_events, $event_mask, $confine_to, $cursor, $time_)β grabs the pointer, returns a grabstatus.$window(Gtk2::Gdk::Window)$owner_events(boolean)$event_mask(Gtk2::Gdk::EventMask)$confine_to(Gtk2::Gdk::Window or undef)$cursor(Gtk2::Gdk::Cursor or undef)$time_(unsigned)
boolean = Gtk2::Gdk->pointer_is_grabbedβ true if the pointer is currently grabbed. βGtk2::Gdk->pointer_ungrab ($time_)β ungrabs the pointer, obviously.$time_(unsigned)
string = Gtk2::Gdk->get_program_classβ the program class, as a string.Gtk2::Gdk->set_program_class ($program_class)β sets the program class.$program_class(string)
list = Gtk2::Gdk->query_depthsβ returns a list of depths.list = Gtk2::Gdk->query_visual_typesβ returns a list of visual types.integer = Gtk2::Gdk->screen_heightβ screen height in pixels.integer = Gtk2::Gdk->screen_height_mmβ screen height in millimeters. πinteger = Gtk2::Gdk->screen_widthβ screen width in pixels.integer = Gtk2::Gdk->screen_width_mmβ screen width in millimeters.scalar = Gtk2::Gdk->setting_get ($name)β fetches a setting by name.$name(string)
boolean = Gtk2::Gdk->get_show_eventsβ true if show-events is on.Gtk2::Gdk->set_show_events ($show_events)β turns show-events on or off.$show_events(boolean)
Gtk2::Gdk->set_sm_client_id ($sm_client_id=undef)β sets the session-management client id. the=undefis the default, so you can just not pass it. π«₯$sm_client_id(string or undef)
list = Gtk2::Gdk->string_to_compound_text ($str)β returns a list of strings.$str(string)
list = Gtk2::Gdk->string_to_compound_text_for_display ($display, $str)β returns a list of strings.$display(Gtk2::Gdk::Display)$str(string)
Since: gtk+ 2.2
list = Gtk2::Gdk->text_property_to_text_list ($encoding, $format, $text)β returns a list of strings.$encoding(Gtk2::Gdk::Atom)$format(integer)$text(scalar)
list = Gtk2::Gdk->text_property_to_text_list_for_display ($display, $encoding, $format, $text)β returns a list of strings.$display(Gtk2::Gdk::Display)$encoding(Gtk2::Gdk::Atom)$format(integer)$text(scalar)
Since: gtk+ 2.2
list = Gtk2::Gdk->text_property_to_utf8_list ($encoding, $format, $text)β returns a list of strings.$encoding(Gtk2::Gdk::Atom)$format(integer)$text(scalar)
list = Gtk2::Gdk->text_property_to_utf8_list_for_display ($display, $encoding, $format, $text)β returns a list of strings.$display(Gtk2::Gdk::Display)$encoding(Gtk2::Gdk::Atom)$format(integer)$text(scalar)
Since: gtk+ 2.2
integer = Gtk2::Gdk->unicode_to_keyval ($wc)β the reverse trip: Unicode codepoint back to keyval.$wc(unsigned)
list = Gtk2::Gdk->utf8_to_compound_text ($str)β returns a list of strings.$str(string)
list = Gtk2::Gdk->utf8_to_compound_text_for_display ($display, $str)β returns a list of strings.$display(Gtk2::Gdk::Display)$str(string)
Since: gtk+ 2.2
string or undef = Gtk2::Gdk->utf8_to_string_target ($str)β returns a string, orundef. π$str(string)
Returns a list of strings.
π ENUMS AND FLAGS π
the little named-constant bundles. both string names and the GDK_-prefixed ones work, so use whichever your heart says. π
π flags Gtk2::Gdk::EventMask
'exposure-mask'/'GDK_EXPOSURE_MASK''pointer-motion-mask'/'GDK_POINTER_MOTION_MASK''pointer-motion-hint-mask'/'GDK_POINTER_MOTION_HINT_MASK''button-motion-mask'/'GDK_BUTTON_MOTION_MASK''button1-motion-mask'/'GDK_BUTTON1_MOTION_MASK''button2-motion-mask'/'GDK_BUTTON2_MOTION_MASK''button3-motion-mask'/'GDK_BUTTON3_MOTION_MASK''button-press-mask'/'GDK_BUTTON_PRESS_MASK''button-release-mask'/'GDK_BUTTON_RELEASE_MASK''key-press-mask'/'GDK_KEY_PRESS_MASK''key-release-mask'/'GDK_KEY_RELEASE_MASK''enter-notify-mask'/'GDK_ENTER_NOTIFY_MASK''leave-notify-mask'/'GDK_LEAVE_NOTIFY_MASK''focus-change-mask'/'GDK_FOCUS_CHANGE_MASK''structure-mask'/'GDK_STRUCTURE_MASK''property-change-mask'/'GDK_PROPERTY_CHANGE_MASK''visibility-notify-mask'/'GDK_VISIBILITY_NOTIFY_MASK''proximity-in-mask'/'GDK_PROXIMITY_IN_MASK''proximity-out-mask'/'GDK_PROXIMITY_OUT_MASK''substructure-mask'/'GDK_SUBSTRUCTURE_MASK''scroll-mask'/'GDK_SCROLL_MASK''all-events-mask'/'GDK_ALL_EVENTS_MASK'
π enum Gtk2::Gdk::GrabStatus
'success'/'GDK_GRAB_SUCCESS''already-grabbed'/'GDK_GRAB_ALREADY_GRABBED''invalid-time'/'GDK_GRAB_INVALID_TIME''not-viewable'/'GDK_GRAB_NOT_VIEWABLE''frozen'/'GDK_GRAB_FROZEN'
π SEE ALSO π
- Gtk2
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.
k that's the whole page, bestie. every flag, every arg, every Since: gtk+ note β nothing left behind. π«Ά
and yeah, this was perl v5.42.0, dated 2025-07-25. mwah. π
β¨πΈ
π¦ 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