Gtk2::Gdk::Cursor(3)
π Gtk2::Gdk::Cursor β the wrapper for GdkCursor π
okay bestie, pull up a chair (or like, a beanbag, whatever ur vibe is) because this is Gtk2::Gdk::Cursor, and it lives in the User Contributed Perl Documentation section of the manual, section 3, iykyk π«Ά
β¨ NAME β¨
Gtk2::Gdk::Cursor β it's the wrapper for GdkCursor. that's it. that's the name. short, sweet, iconic π
πΈ DESCRIPTION πΈ
okay so first thing, for reference: cursors are a per-display resource, and they can only be used with the display they were created on. no sharing, no passing them around like friendship bracelets across displays. it's giving exclusive. π
As of Gtk 2.22 a cursor doesn't keep a reference to its Gtk2::Gdk::Display, and if the display object gets destroyed before the cursor does, then a later destroy of the cursor may get a segv. π Perl-Gtk2 doesn't try to do anything about this β literally nothing, it just vibes. So care may be needed if you're keeping a cursor separate from a widget or window.
Closing the display is fine. Not destroying it. big difference bestie, don't get it twisted π
π¦ HIERARCHY π¦
Glib::Boxed
+----Gtk2::Gdk::Cursor
so it's a Glib::Boxed at heart, and Gtk2::Gdk::Cursor is the main character that branches off it π
π METHODS π
π cursor = Gtk2::Gdk::Cursor->new ($cursor_type)
$cursor_type(Gtk2::Gdk::CursorType)
π cursor = Gtk2::Gdk::Cursor->new_for_display ($display, $cursor_type)
$display(Gtk2::Gdk::Display)$cursor_type(Gtk2::Gdk::CursorType)
Since: gtk+ 2.2
π cursor = Gtk2::Gdk::Cursor->new_from_name ($display, $name)
$display(Gtk2::Gdk::Display)$name(string)
Since: gtk+ 2.8
π cursor = Gtk2::Gdk::Cursor->new_from_pixbuf ($display, $pixbuf, $x, $y)
$display(Gtk2::Gdk::Display)$pixbuf(Gtk2::Gdk::Pixbuf)$x(integer)$y(integer)
Since: gtk+ 2.4
π cursor = Gtk2::Gdk::Cursor->new_from_pixmap ($source, $mask, $fg, $bg, $x, $y)
$source(Gtk2::Gdk::Pixmap)$mask(Gtk2::Gdk::Pixmap)$fg(Gtk2::Gdk::Color)$bg(Gtk2::Gdk::Color)$x(integer)$y(integer)
π cursortype = $cursor->get_cursor_type
Since: gtk+ 2.22
π display = $cursor->get_display
Since: gtk+ 2.2
π pixbuf = $cursor->get_image
Since: gtk+ 2.8
π cursortype = $cursor->type
π ENUMS AND FLAGS π
β enum Gtk2::Gdk::CursorType β
okay this is the big one, the whole mood board of cursors. every single one, no skips, we're not leaving anyone out fr fr π
'x-cursor'/GDK_X_CURSOR'arrow'/GDK_ARROW'based-arrow-down'/GDK_BASED_ARROW_DOWN'based-arrow-up'/GDK_BASED_ARROW_UP'boat'/GDK_BOAT'bogosity'/GDK_BOGOSITY'bottom-left-corner'/GDK_BOTTOM_LEFT_CORNER'bottom-right-corner'/GDK_BOTTOM_RIGHT_CORNER'bottom-side'/GDK_BOTTOM_SIDE'bottom-tee'/GDK_BOTTOM_TEE'box-spiral'/GDK_BOX_SPIRAL'center-ptr'/GDK_CENTER_PTR'circle'/GDK_CIRCLE'clock'/GDK_CLOCK'coffee-mug'/GDK_COFFEE_MUG'cross'/GDK_CROSS'cross-reverse'/GDK_CROSS_REVERSE'crosshair'/GDK_CROSSHAIR'diamond-cross'/GDK_DIAMOND_CROSS'dot'/GDK_DOT'dotbox'/GDK_DOTBOX'double-arrow'/GDK_DOUBLE_ARROW'draft-large'/GDK_DRAFT_LARGE'draft-small'/GDK_DRAFT_SMALL'draped-box'/GDK_DRAPED_BOX'exchange'/GDK_EXCHANGE'fleur'/GDK_FLEUR'gobbler'/GDK_GOBBLER'gumby'/GDK_GUMBY'hand1'/GDK_HAND1'hand2'/GDK_HAND2'heart'/GDK_HEART'icon'/GDK_ICON'iron-cross'/GDK_IRON_CROSS'left-ptr'/GDK_LEFT_PTR'left-side'/GDK_LEFT_SIDE'left-tee'/GDK_LEFT_TEE'leftbutton'/GDK_LEFTBUTTON'll-angle'/GDK_LL_ANGLE'lr-angle'/GDK_LR_ANGLE'man'/GDK_MAN'middlebutton'/GDK_MIDDLEBUTTON'mouse'/GDK_MOUSE'pencil'/GDK_PENCIL'pirate'/GDK_PIRATE'plus'/GDK_PLUS'question-arrow'/GDK_QUESTION_ARROW'right-ptr'/GDK_RIGHT_PTR'right-side'/GDK_RIGHT_SIDE'right-tee'/GDK_RIGHT_TEE'rightbutton'/GDK_RIGHTBUTTON'rtl-logo'/GDK_RTL_LOGO'sailboat'/GDK_SAILBOAT'sb-down-arrow'/GDK_SB_DOWN_ARROW'sb-h-double-arrow'/GDK_SB_H_DOUBLE_ARROW'sb-left-arrow'/GDK_SB_LEFT_ARROW'sb-right-arrow'/GDK_SB_RIGHT_ARROW'sb-up-arrow'/GDK_SB_UP_ARROW'sb-v-double-arrow'/GDK_SB_V_DOUBLE_ARROW'shuttle'/GDK_SHUTTLE'sizing'/GDK_SIZING'spider'/GDK_SPIDER'spraycan'/GDK_SPRAYCAN'star'/GDK_STAR'target'/GDK_TARGET'tcross'/GDK_TCROSS'top-left-arrow'/GDK_TOP_LEFT_ARROW'top-left-corner'/GDK_TOP_LEFT_CORNER'top-right-corner'/GDK_TOP_RIGHT_CORNER'top-side'/GDK_TOP_SIDE'top-tee'/GDK_TOP_TEE'trek'/GDK_TREK'ul-angle'/GDK_UL_ANGLE'umbrella'/GDK_UMBRELLA'ur-angle'/GDK_UR_ANGLE'watch'/GDK_WATCH'xterm'/GDK_XTERM'last-cursor'/GDK_LAST_CURSOR'blank-cursor'/GDK_BLANK_CURSOR'cursor-is-pixmap'/GDK_CURSOR_IS_PIXMAP
periodt. π that's the whole enum, all 80 of them, we ate and left no crumbs π
π§ SEE ALSO π§
Gtk2Glib::Boxed
go read those next bestie, they're part of the lore π
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.
and that's a wrap on Gtk2::Gdk::Cursor(3) from the User Contributed Perl Documentation, brought to you by perl v5.42.0, dated 2025-07-25. slay, stay hydrated, and don't destroy ur display before ur cursor, 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