Gtk2::Image(3)
β¨ NAME β¨
Gtk2::Image β bestie, it's literally just a wrapper for GtkImage πΌοΈπ
Like, the manual page header says Gtk2::Image(3) and it lives in the User Contributed Perl Documentation section, but we're gonna skip the formalities and get to the good stuff, okay?
πΈ HIERARCHY πΈ
So this is the family tree, the bloodline, the main character lineage:
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::Widget
+----Gtk2::Misc
+----Gtk2::Image
Every one of those is an ancestor. She inherited the whole vibe, no cap. π
π¦ INTERFACES π¦
She's also got these interfaces on her, like accessories she never takes off:
Glib::Object::_Unregistered::AtkImplementorIface
Gtk2::Buildable
π METHODS π
π Constructors (the "make me a widget" era)
widget = Gtk2::Image->newβ makes you a fresh, emptyGtk2::Image. A blank canvas, an untouched face card, ready for whatever. β¨widget = Gtk2::Image->new_from_animation ($animation)β builds an image out of an animation.$animation(Gtk2::Gdk::PixbufAnimation)
widget = Gtk2::Image->new_from_file ($filename)β builds an image straight from a file on disk.$filename(localized file name orundef)
widget = Gtk2::Image->new_from_icon_name ($icon_name, $size)β builds an image from an icon name in the icon theme. π§$icon_name(string)$size(Gtk2::IconSize)- Since: gtk+ 2.6
widget = Gtk2::Image->new_from_icon_set ($icon_set, $size)β builds an image out of an icon set.$icon_set(Gtk2::IconSet)$size(Gtk2::IconSize)
widget = Gtk2::Image->new_from_image ($image, $mask)β builds an image from a Gdk image (and optionally a mask).$image(Gtk2::Gdk::Imageorundef)$mask(Gtk2::Gdk::Bitmaporundef)
widget = Gtk2::Image->new_from_pixbuf ($pixbuf)β builds an image from a pixbuf.$pixbuf(Gtk2::Gdk::Pixbuforundef)
widget = Gtk2::Image->new_from_pixmap ($pixmap, $mask)β builds an image from a pixmap (plus optional mask).$pixmap(Gtk2::Gdk::Pixmaporundef)$mask(Gtk2::Gdk::Bitmaporundef)
widget = Gtk2::Image->new_from_stock ($stock_id, $size)β builds an image from a stock ID. π$stock_id(string)$size(Gtk2::IconSize)
π Getters and the one lil clear-er
pixbufanimation = $image->get_animationβ hands you back the animation.$image->clearβ wipes the image clean. It's giving "factory reset". π«§- Since: gtk+ 2.8
β¨ The set_from_* girlies
Every one of these swaps out what your image is showing. Same energy, different source. π
$image->set_from_animation ($animation)$animation(Gtk2::Gdk::PixbufAnimation)
$image->set_from_file ($filename)$filename(localized file name orundef)
$image->set_from_icon_name ($icon_name, $size)$icon_name(string)$size(Gtk2::IconSize)- Since: gtk+ 2.6
$image->set_from_icon_set ($icon_set, $size)$icon_set(Gtk2::IconSet)$size(Gtk2::IconSize)
$image->set_from_image ($gdk_image, $mask)$gdk_image(Gtk2::Gdk::Imageorundef)$mask(Gtk2::Gdk::Bitmaporundef)
$image->set_from_pixbuf ($pixbuf)$pixbuf(Gtk2::Gdk::Pixbuforundef)
$image->set_from_pixmap ($pixmap, $mask)$pixmap(Gtk2::Gdk::Pixmaporundef)$mask(Gtk2::Gdk::Bitmaporundef)
$image->set_from_stock ($stock_id, $size)$stock_id(string)$size(Gtk2::IconSize)
πΈ More getters, bc we stay curious
list = $image->get_icon_name- Since: gtk+ 2.6
list = $image->get_icon_setlist = $image->get_imagepixbuf = $image->get_pixbufinteger = $image->get_pixel_size- Since: gtk+ 2.6
$image->set_pixel_size ($pixel_size)$pixel_size(integer)- Since: gtk+ 2.6
list = $image->get_pixmap(stock_id, icon_size) = $image->get_stockimagetype = $image->get_storage_type
π₯ PROPERTIES π₯
Okay so these are the properties, and every single one of them is readable / writable / private / static-nick / static-blurb unless I say otherwise. Pay attention to the defaults bestie, they matter. π
'file'(string: defaultundef: readable / writable / private / static-nick / static-blurb) β Filename to load and display π'gicon'(Glib::Object::_Unregistered::GIcon: defaultundef: readable / writable / private / static-nick / static-blurb) β The GIcon being displayed'icon-name'(string: defaultundef: readable / writable / private / static-nick / static-blurb) β The name of the icon from the icon theme'icon-set'(Gtk2::IconSet: defaultundef: readable / writable / private / static-nick / static-blurb) β Icon set to display'icon-size'(integer: default4: readable / writable / private / static-nick / static-blurb) β Symbolic size to use for stock icon, icon set or named icon'image'(Gtk2::Gdk::Image: defaultundef: readable / writable / private / static-nick / static-blurb) β A GdkImage to display'mask'(Gtk2::Gdk::Pixmap: defaultundef: readable / writable / private / static-nick / static-blurb) β Mask bitmap to use with GdkImage or GdkPixmap'pixbuf'(Gtk2::Gdk::Pixbuf: defaultundef: readable / writable / private / static-nick / static-blurb) β A GdkPixbuf to display'pixbuf-animation'(Gtk2::Gdk::PixbufAnimation: defaultundef: readable / writable / private / static-nick / static-blurb) β GdkPixbufAnimation to display'pixel-size'(integer: default-1: readable / writable / private / static-nick / static-blurb) β Pixel size to use for named icon'pixmap'(Gtk2::Gdk::Pixmap: defaultundef: readable / writable / private / static-nick / static-blurb) β A GdkPixmap to display'stock'(string: defaultundef: readable / writable / private / static-nick / static-blurb) β Stock ID for a stock image to display'storage-type'(Gtk2::ImageType: default"empty": readable / private / static-nick / static-blurb) β The representation being used for image data
Heads up, bestie: 'storage-type' is readable / private only β no writing to that one, she said no. π«βοΈ
π ENUMS AND FLAGS π
enum Gtk2::IconSize
'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::ImageType
'empty'/GTK_IMAGE_EMPTY'pixmap'/GTK_IMAGE_PIXMAP'image'/GTK_IMAGE_IMAGE'pixbuf'/GTK_IMAGE_PIXBUF'stock'/GTK_IMAGE_STOCK'icon-set'/GTK_IMAGE_ICON_SET'animation'/GTK_IMAGE_ANIMATION'icon-name'/GTK_IMAGE_ICON_NAME'gicon'/GTK_IMAGE_GICON
π«Ά SEE ALSO π«Ά
Go read these next, they're the friend group:
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Misc
π 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, bestie π This one's perl v5.42.0, dated 2025-07-25, and yeah the manual page really is called Gtk2::Image(3). Obsessed. Periodt. πβ¨
π¦ 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