Gtk2::E...::Image(3)

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

πŸ’– 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 to TRUE, a frame is rendered around the image. it's giving picture-frame realness πŸ–ΌοΈ
  • scale_to_fit = BOOL [optional] β€” if set to TRUE, 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 and scale_to_fit was set. the Gtk2::Ex::FormFactory::Image instance and the Gtk2::Gdk::PixBuf of 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 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