Gtk2::AspectFrame(3)
π Gtk2::AspectFrame β bestie, it's the wrapper for GtkAspectFrame
okay so picture this: you've got a frame, right? and you want it to keep its ~proportions~ no matter how the window gets dragged around. that's literally it. that's the whole gig. Gtk2::AspectFrame is the Perl wrapper for GtkAspectFrame, and she is here to keep your aspect ratio from being a mess. β¨
π HIERARCHY
the family tree, and yes she's at the very bottom of it, deep in the lineage, main character of her own little branch:
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::Widget
+----Gtk2::Container
+----Gtk2::Bin
+----Gtk2::Frame
+----Gtk2::AspectFrame
like, six levels of inheritance before you even get to her. the way that Gtk2::Frame is her direct parent and she just builds on top of it? obsessed. π
π¦ INTERFACES
she also plays nice with these:
Glib::Object::_Unregistered::AtkImplementorIfaceGtk2::Buildable
iykyk, accessibility and builder support just come free. slay. π
β¨ METHODS β¨
πΈ widget = Gtk2::AspectFrame->new ($label, $xalign, $yalign, $ratio, $obey_child)
the constructor, the origin story, the birth of your frame. here's what you're handing her:
$labelβ a string, orundefif you're feeling mysterious and label-less (string or undef)$xalignβ a double (double)$yalignβ a double (double)$ratioβ a double (double)$obey_childβ a boolean (boolean)
π $aspect_frame->set_params ($xalign, $yalign, $ratio, $obey_child)
change your mind later? totally valid. this lets you re-set the whole vibe after the fact:
$xalignβ a double (double)$yalignβ a double (double)$ratioβ a double (double)$obey_childβ a boolean (boolean)
π PROPERTIES
the full property roster, no skips, no cuts:
'obey-child'(boolean : defaulttrue: readable / writable / private / static-nick / static-blurb) β Force aspect ratio to match that of the frame's child'ratio'(float : default1: readable / writable / private / static-nick / static-blurb) β Aspect ratio ifobey_childisFALSE'xalign'(float : default0.5: readable / writable / private / static-nick / static-blurb) β X alignment of the child'yalign'(float : default0.5: readable / writable / private / static-nick / static-blurb) β Y alignment of the child
note the defaults bestie βobey-childistrueout the gate, andratiois1. don't come for me, that's just what she ships with. π«Ά
π SEE ALSO
go read these too, they're the whole friend group:
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Bin, Gtk2::Frame
π 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 was documented with perl v5.42.0, dated 2025-07-25, and it's a Gtk2::AspectFrame(3) situation from the User Contributed Perl Documentation. go forth and keep those ratios cute. 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