Gtk2::Tooltip(3)

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

πŸ’– Gtk2::Tooltip β€” bestie edition πŸ’–

okay so this is the perl wrapper for GtkTooltip, from the Gtk2 docs (User Contributed Perl Documentation, no cap). if you've ever hovered over a button and a lil text bubble popped up to explain things? yeah, that's this. the tooltip is the main character here and we're just hyping it up πŸŽ€


🌸 HIERARCHY 🌸

it's giving family tree, and this one is a direct line:

Glib::Object
+----Gtk2::Tooltip

so Gtk2::Tooltip is a Glib::Object and nothing else. simple. elegant. iconic. πŸ’…


✨ METHODS ✨

every one of these is called on a $tooltip object, bestie. here's the whole roster 🫢

  • $tooltip->set_custom ($custom_widget) β€” swap in your own custom widget as the tooltip body. it takes:
    • $custom_widget (a Gtk2::Widget, or undef if you want to be mysterious and give it nothing πŸ™ˆ)
  • $tooltip->set_icon_from_icon_name ($icon_name, $size) β€” sets the tooltip's icon by icon name, which is very "i know a guy" of you. args:
    • $icon_name (string)
    • $size (a Gtk2::IconSize)
⭐ Since: gtk+ 2.14 β€” so like, vintage. older gtk+ won't know her.
  • $tooltip->set_icon_from_stock ($stock_id, $size) β€” the stock-id version of the above. args:
    • $stock_id (string or undef)
    • $size (a Gtk2::IconSize)
  • $tooltip->set_icon ($pixbuf) β€” straight-up hands the tooltip a pixbuf as its icon. args:
    • $pixbuf (a Gtk2::Gdk::Pixbuf or undef)
  • $tooltip->set_markup ($markup) β€” sets the tooltip text as Pango markup, so you can get fancy with it ✨ args:
    • $markup (string or undef)
  • $tooltip->set_text ($text) β€” the plain-text one. just words. no markup. lowkey the chillest option. args:
    • $text (string or undef)
  • $tooltip->set_tip_area ($rect) β€” tells the tooltip which region it's actually pointing at. args:
    • $rect (a Gtk2::Gdk::Rectangle or undef)
  • Gtk2::Tooltip::trigger_tooltip_query ($display) β€” note that this one is a class method, not an instance one, so you call it as Gtk2::Tooltip::trigger_tooltip_query, not on a $tooltip. it pokes the display to re-ask about tooltips. args:
    • $display (a Gtk2::Gdk::Display)

πŸ¦‹ ENUMS AND FLAGS πŸ¦‹

enum Gtk2::IconSize

these are your size options, and each one has a short name and a long name β€” same vibe, different fonts πŸ’œ

  • 'invalid' / GTK_ICON_SIZE_INVALID
  • 'menu' / GTK_ICON_SIZE_MENU
  • 'small-toolbar' / GTK_ICON_SIZE_SMALL_TOOLBAR
  • 'large-toolbar' / GTK_ICON_SIZE_LARGE_TOOLBAR
  • 'button' / GTK_ICON_SIZE_BUTTON
  • 'dnd' / GTK_ICON_SIZE_DND
  • 'dialog' / GTK_ICON_SIZE_DIALOG

πŸ‘€ SEE ALSO πŸ‘€

go read these too, bestie, they're the whole ecosystem:

  • Gtk2
  • Glib::Object

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 the whole page, no crumbs left πŸ’… this doc came from perl v5.42.0 and was dated 2025-07-25 β€” mwah, stan the gtk2-perl team, they ate and left zero notes 🫢✨

πŸ“¦ where this page comes from