Gtk2::E...::Image(3)
π Gtk2::Ex::FormFactory::Image π
okay so bestie, this is the manual page for Gtk2::Ex::FormFactory::Image(3) β from the User Contributed Perl Documentation corner of the universe. it's an Image in a FormFactory framework, and honestly? it's giving main character energy. let's get into it β¨
πΈ SYNOPSIS πΈ
Gtk2::Ex::FormFactory::Image->new (
bgcolor => Background color of the widget,
with_frame => Draw a frame around the image?,
scale_to_fit => Automatially scale the image in its container?,
max_width => Maximum width the image may scale to,
max_height => Maximum height the image may scale to,
scale => Display the image with this constant scaling,
scale_hook => Callback which returns the actual scale,
...
Gtk2::Ex::FormFactory::Widget attributes
);
π¦ DESCRIPTION π¦
so this class implements an Image inside a Gtk2::Ex::FormFactory framework. the image is always displayed with its natural aspect ratio β like, that's non-negotiable, that's the vibe β but there are various possibilities to control the scaling of the image. slay π
the value of the associated application object attribute is the filename of the displayed image. and heads up: the file format must be supported by Gtk2::Gdk::PixBuf. no cap.
π OBJECT HIERARCHY π
Gtk2::Ex::FormFactory::Intro
Gtk2::Ex::FormFactory::Widget
+--- Gtk2::Ex::FormFactory::Image
Gtk2::Ex::FormFactory::Layout
Gtk2::Ex::FormFactory::Rules
Gtk2::Ex::FormFactory::Context
Gtk2::Ex::FormFactory::Proxy
look at that lineage. it's literally a whole family tree π«Ά
β¨ ATTRIBUTES β¨
okay so attributes are handled through the common get_ATTR(), set_ATTR() style accessors β very iykyk β but they're mostly passed once to the object constructor and must not be altered after the associated FormFactory was built. set it and forget it, bestie π
bgcolor= "RGB Hex Triple" [optional] β this is the background color of the widget. if you set it, all areas of the widget not filled with the image get painted with this color. cute little frame-filler πwith_frame= BOOL [optional] β if set toTRUE, a frame is rendered around the image. it's giving picture-frame realness πΌοΈscale_to_fit= BOOL [optional] β if set toTRUE, the image will automatically scale proportionally into the space the container of this widget allocated for the image widget. so it fits. iconic β¨max_width= INTEGER [optional] β with this attribute you can define a maximum width the image may scale to. boundaries? we love a healthy boundary πΈmax_height= INTEGER [optional] β with this attribute you can define a maximum height the image may scale to. same energy, vertical edition πscale= FLOAT [optional] β if you set this attribute, no dynamic scaling applies, but the image will be constantly scaled with this value. this overrides all other attributes regarding dynamic scaling. periodt. it's the boss of the scaling situation πscale_hook=CODEREF(FormFactory::Image, PixBuf)[optional] β this code reference is called if the image needs an update, e.g. if the associated application object attribute changed, or the parent was resized andscale_to_fitwas set. theGtk2::Ex::FormFactory::Imageinstance and theGtk2::Gdk::PixBufof the image are passed to the function.
if scale_to_fit is set, the widget's dimension are tracked automatically. the actual width and height are stored in the attributes widget_width and widget_height, and thus can be accessed from the callback by calling get_widget_width and get_widget_width.
ngl bestie, the docs literally say get_widget_width twice there π that's word-for-word what it says, so I'm passing it straight to you, no edits, no fixes. read it and weep (affectionately).
for more attributes refer to Gtk2::Ex::FormFactory::Widget. go drink from that firehose, you got this π«Ά
π AUTHORS π
JΓΆrn Reder <joern at zyn dot de>
that's the icon who wrote this π
π COPYRIGHT AND LICENSE π
Copyright 2004-2006 by JΓΆrn Reder.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA.
fr fr, read the license. it's free software but the warranty is not there, so don't come for it if something breaks π
π POD ERRORS π
hey! the above document had some coding errors, which are explained below:
Around line 259:
Non-ASCII character seen before =encoding in 'JΓΆrn'. Assuming UTF-8
the ΓΆ did it. the ΓΆ is the culprit. not me being shocked π
and that's the whole page, bestie! it's from perl v5.42.0, dated 2025-07-25 β so shoutout to that vintage build for carrying this little image widget through time. now go scale something beautifully, and remember: aspect ratio is sacred ππβ¨
π¦ where this page comes from
- fedora 43: perl-Gtk2-Ex-FormFactory 0.67-39.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms