Gtk2::Gdk(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

✨ 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.2
  • string = 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.2
  • Gtk2::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.2
  • grabstatus = 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 =undef is 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, or undef. 🎭
    • $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 (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