Gtk2::Alignment(3)

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

✨ 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::AtkImplementorIface
  • Gtk2::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 : default 0 : readable / writable / private / static-nick / static-blurb) β€” the padding to insert at the bottom of the widget.
  • 'left-padding' (Glib::UInt : default 0 : readable / writable / private / static-nick / static-blurb) β€” the padding to insert at the left of the widget.
  • 'right-padding' (Glib::UInt : default 0 : readable / writable / private / static-nick / static-blurb) β€” the padding to insert at the right of the widget.
  • 'top-padding' (Glib::UInt : default 0 : readable / writable / private / static-nick / static-blurb) β€” the padding to insert at the top of the widget.
  • 'xalign' (float : default 0.5 : readable / writable / private / static-nick / static-blurb) β€” horizontal position of child in available space. 0.0 is left aligned, 1.0 is right aligned.
  • 'xscale' (float : default 1 : 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.0 means none, 1.0 means all.
  • 'yalign' (float : default 0.5 : readable / writable / private / static-nick / static-blurb) β€” vertical position of child in available space. 0.0 is top aligned, 1.0 is bottom aligned.
  • 'yscale' (float : default 1 : 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.0 means none, 1.0 means all.

🌈 SEE ALSO 🌈

go read these next, iykyk:

  • Gtk2
  • Glib::Object
  • Glib::InitiallyUnowned
  • Gtk2::Object
  • Gtk2::Widget
  • Gtk2::Container
  • Gtk2::Bin

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