Gtk2::Alignment(3)
β¨ Gtk2::Alignment β¨
okay bestie, welcome to Gtk2::Alignment(3) β it's from the User Contributed Perl Documentation, and it's literally the Perl wrapper for GtkAlignment π
If you've ever been like "bestie, why is my widget glued to the corner of the window when there's so much empty space??" β that's the alignment's whole job. It's the thing that decides where your child widget sits and how much of the extra room it gets to eat. Iconic behaviour honestly.
πΈ HIERARCHY πΈ
she's got a whole ancestry, and we respect the lineage:
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::Widget
+----Gtk2::Container
+----Gtk2::Bin
+----Gtk2::Alignment
π¦ INTERFACES π¦
the vibes she implements:
Glib::Object::_Unregistered::AtkImplementorIfaceGtk2::Buildable
π METHODS π
widget = Gtk2::Alignment->new ($xalign, $yalign, $xscale, $yscale)
bestie, you're making a fresh alignment. here's what you're handing her:
$xalign(double)$yalign(double)$xscale(double)$yscale(double)
$alignment->set ($xalign, $yalign, $xscale, $yscale)
change up all four vibes at once, no cap:
$xalign(double)$yalign(double)$xscale(double)$yscale(double)
(padding_top, padding_bottom, padding_left, padding_right) = $alignment->get_padding
grab all four padding numbers in one go, returned as a little squad of values. π«Ά
Since: gtk+ 2.4
$alignment->set_padding ($padding_top, $padding_bottom, $padding_left, $padding_right)
set all the padding in one call. here's the lineup:
$padding_top(integer)$padding_bottom(integer)$padding_left(integer)$padding_right(integer)
Since: gtk+ 2.4
π PROPERTIES π
every single one of these is readable / writable / private / static-nick / static-blurb, so likeβ¦ she's not shy, she's available. π
'bottom-padding'(Glib::UInt: default0: readable / writable / private / static-nick / static-blurb) β the padding to insert at the bottom of the widget.'left-padding'(Glib::UInt: default0: readable / writable / private / static-nick / static-blurb) β the padding to insert at the left of the widget.'right-padding'(Glib::UInt: default0: readable / writable / private / static-nick / static-blurb) β the padding to insert at the right of the widget.'top-padding'(Glib::UInt: default0: readable / writable / private / static-nick / static-blurb) β the padding to insert at the top of the widget.'xalign'(float: default0.5: readable / writable / private / static-nick / static-blurb) β horizontal position of child in available space.0.0is left aligned,1.0is right aligned.'xscale'(float: default1: readable / writable / private / static-nick / static-blurb) β if available horizontal space is bigger than needed for the child, how much of it to use for the child.0.0means none,1.0means all.'yalign'(float: default0.5: readable / writable / private / static-nick / static-blurb) β vertical position of child in available space.0.0is top aligned,1.0is bottom aligned.'yscale'(float: default1: readable / writable / private / static-nick / static-blurb) β if available vertical space is bigger than needed for the child, how much of it to use for the child.0.0means none,1.0means all.
π SEE ALSO π
go read these next, iykyk:
Gtk2Glib::ObjectGlib::InitiallyUnownedGtk2::ObjectGtk2::WidgetGtk2::ContainerGtk2::Bin
π 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 written against perl v5.42.0, dated 2025-07-25, and it's Gtk2::Alignment(3) forever and always. go align something gorgeous. π¦β¨
π¦ 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