Gtk2::IconSet(3)

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

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

okay so. this is Gtk2::IconSet, a lil wrapper for GtkIconSet, hanging out in the User Contributed Perl Documentation corner of your man pages. she's a boxed type, she's cute, she holds a whole little family of icon renderings for you. no cap.


🌸 HIERARCHY 🌸

the family tree, and yes she's a nepo baby:

Glib::Boxed
+----Gtk2::IconSet

so like, she inherits from Glib::Boxed and that's the whole lineage. short tree. iconic.


✨ METHODS ✨

πŸŽ€ making one

  • iconset = Gtk2::IconSet->new β€” boom, brand new empty icon set, fresh out the box, no args, nothing, just vibes. πŸ¦‹
  • iconset = Gtk2::IconSet->new_from_pixbuf ($pixbuf) β€” same energy but you hand her a pixbuf and she builds the set around it. takes:
    • $pixbuf (a Gtk2::Gdk::Pixbuf) πŸ–ΌοΈ

πŸ’… using one

  • $icon_set->add_source ($source) β€” drop another source into the set. the more the merrier fr fr. takes:
    • $source (a Gtk2::IconSource) ✨
  • pixbuf = $icon_set->render_icon ($style, $direction, $state, $size, $widget, $detail=undef) β€” the main character method, honestly. she renders you an icon and hands back a pixbuf. here's the whole cast:
    • $style (a Gtk2::Style, or undef) πŸ‘‘
    • $direction (a Gtk2::TextDirection)
    • $state (a Gtk2::StateType)
    • $size (a Gtk2::IconSize)
    • $widget (a Gtk2::Widget, or undef)
    • $detail (a string) β€” and heads up bestie, this one defaults to undef 🫢
  • list = $icon_set->get_sizes β€” gives you back a list of Gtk2::IconSize's, so you can see all the sizes she's serving. slay. πŸ”₯

🌈 ENUMS AND FLAGS 🌈

enum Gtk2::IconSize

the size menu, pick your fighter:

  • '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

enum Gtk2::StateType

her moods. we all have them:

  • 'normal' / GTK_STATE_NORMAL 🧚
  • 'active' / GTK_STATE_ACTIVE πŸ”₯
  • 'prelight' / GTK_STATE_PRELIGHT ✨
  • 'selected' / GTK_STATE_SELECTED πŸ‘‘
  • 'insensitive' / GTK_STATE_INSENSITIVE πŸ™ˆ

enum Gtk2::TextDirection

which way are we reading, bestie:

  • 'none' / GTK_TEXT_DIR_NONE
  • 'ltr' / GTK_TEXT_DIR_LTR
  • 'rtl' / GTK_TEXT_DIR_RTL

πŸ‘€ SEE ALSO πŸ‘€

go read these next, they're the friends in the group chat:

  • Gtk2
  • Glib::Boxed

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, bestie!! πŸ’œ this manual came to you courtesy of perl v5.42.0, dated 2025-07-25, and it's filed under Gtk2::IconSet(3) β€” go forth and render icons, you absolute icon πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from