Gtk2::IconTheme(3)
π NAME π
okay so bestie, gather round β Gtk2::IconTheme is literally just a wrapper for GtkIconTheme. that's it. that's the whole vibe. it's the thing that knows where your icons live and goes and fetches them for you. π
it lives in the User Contributed Perl Documentation section of the manual, and no, it did not come with the base Perl install, it's a whole contributed situation. iykyk. β¨
π HIERARCHY π
the family tree, and yes it's giving only child energy:
Glib::Object
+----Gtk2::IconTheme
β¨ METHODS β¨
every single one, in order, no skipping, we do not do that here π
icontheme = Gtk2::IconTheme->new
makes you a fresh, brand new Gtk2::IconTheme. main character origin story fr fr. π
Gtk2::IconTheme->add_builtin_icon ($icon_name, $size, $pixbuf)
slap a built-in icon into the theme. here's what you're handing over:
$icon_name(string)$size(integer)$pixbuf(Gtk2::Gdk::Pixbuf)
$icon_theme->append_search_path ($path)
adds a spot to the end of the list of places it goes looking for icons.
$path(localized file name)
iconinfo or undef = $icon_theme->choose_icon ($icon_names, $size, $flags)
picks an icon for you and hands back an iconinfo β or undef if it's not feeling it. π
$icon_names(scalar)$size(integer)$flags(Gtk2::IconLookupFlags)
Since: gtk+ 2.12 β
$icon_theme->set_custom_theme ($theme_name)
sets a custom theme name, and $theme_name can be a string or undef.
$theme_name(string or undef)
π¨ big warning bestie: you cannot use this on aGtk2::IconThemethat came back fromGtk2::IconTheme->get_defaultorGtk2::IconTheme->get_for_screen. those ones said no. periodt.
icontheme = Gtk2::IconTheme->get_default
grabs you the default Gtk2::IconTheme. the classic. the standard. π«Ά
string or undef = $icon_theme->get_example_icon_name
gives you an example icon name as a string β or undef, because sometimes it just doesn't have one for you. π
icontheme = Gtk2::IconTheme->get_for_screen ($screen)
like get_default but for a specific screen:
$screen(Gtk2::Gdk::Screen)
boolean = $icon_theme->has_icon ($icon_name)
true/false vibes β do you have this icon or not:
$icon_name(string)
list = $icon_theme->get_icon_sizes ($icon_name)
returns a list of all the sizes this icon comes in. iconic, honestly. π
$icon_name(string)
Since: gtk+ 2.6 β
list = $icon_theme->list_contexts
hands you back a list of the contexts. that's it, no args, no notes. β¨
Since: gtk+ 2.12 β
list = $icon_theme->list_icons ($context)
lists the icons, optionally filtered by a context:
$context(string or undef)
pixbuf or undef = $icon_theme->load_icon ($icon_name, $size, $flags)
actually loads the icon up as a pixbuf, or undef if it can't. π₯
$icon_name(string)$size(integer)$flags(Gtk2::IconLookupFlags)
π heads up: this one may croak with aGlib::Errorin$@if it fails. not a drill, wrap it if you're fragile.
iconinfo or undef = $icon_theme->lookup_icon ($icon_name, $size, $flags)
looks up the icon and gives you an iconinfo β or undef. π
$icon_name(string)$size(integer)$flags(Gtk2::IconLookupFlags)
$icon_theme->prepend_search_path ($path)
like append_search_path, but it shoves the new spot at the front of the search list. main character placement. π
$path(localized file name)
boolean = $icon_theme->rescan_if_needed
returns a boolean telling you whether it went and rescanned. lowkey self-care for your icon cache. πΈ
$icon_theme->set_screen ($screen)
points this icon theme at a screen:
$screen(Gtk2::Gdk::Screen)
list = $icon_theme->get_search_path
gives you the whole search path as a list. π¦
$icon_theme->set_search_path (...)
sets the search path all at once:
...(list)
π SIGNALS π
changed(Gtk2::IconTheme) β fires when the theme changes, like a little notification that things are different now. not me getting notified by my own icon theme π
π ENUMS AND FLAGS π
flags Gtk2::IconLookupFlags
all five, bestie:
'no-svg'/'GTK_ICON_LOOKUP_NO_SVG''force-svg'/'GTK_ICON_LOOKUP_FORCE_SVG''use-builtin'/'GTK_ICON_LOOKUP_USE_BUILTIN''generic-fallback'/'GTK_ICON_LOOKUP_GENERIC_FALLBACK''force-size'/'GTK_ICON_LOOKUP_FORCE_SIZE'
enum Gtk2::IconThemeError
the two sad-girl error options:
'not-found'/'GTK_ICON_THEME_NOT_FOUND''failed'/'GTK_ICON_THEME_FAILED'
π SEE ALSO π
go read these next, bestie:
Gtk2Glib::Object
π 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 the whole page, babe π«Ά this doc was served up by perl v5.42.0, dated 2025-07-25, and it's filed under Gtk2::IconTheme(3). slay, go load some icons. πβ¨π
π¦ 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