Gtk2::Requisition(3)

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

πŸ’– NAME πŸ’–

Gtk2::Requisition β€” bestie, it's a little wrapper for GtkRequisition πŸŽ€

No fr, that's the whole gig. It's the Perl-side glow-up of a C struct that holds a width and a height, and it's here to tell the layout gods how much space something wants. Slay. ✨


🌸 HIERARCHY 🌸

It's giving very "nepo baby of the boxed types" energy, and honestly? Iconic.

  Glib::Boxed
  +----Gtk2::Requisition

So yeah β€” Gtk2::Requisition is a Glib::Boxed at heart, which means it gets all that boxed-type copy-and-bless magic for free. Periodt. πŸ’…


✨ METHODS ✨

πŸ¦‹ requisition = Gtk2::Requisition->new ($width=0, $height=0)

Okay so this is the constructor, and it is so lowkey. You hand it a width and a height and it hands you back a brand new requisition object. That's it, that's the whole vibe. 🫢

Here's what you can pass in:

  • $width (integer) β€” how wide, in the integer sense of wide. Defaults to 0 if you just can't be bothered.
  • $height (integer) β€” how tall, ditto. Also defaults to 0.
Not me calling ->new with zero args and getting a 0 by 0 requisition. Technically valid. Emotionally devastating. 😭

🌈 integer = $requisition->height ($newval=undef)

Get the height. Set the height. Main character behaviour either way. πŸ’œ

  • $newval (scalar) β€” pass a new value in and it sets the height; leave it out (it defaults to undef) and it just reads the current one back at you.

Returns an integer, because obviously. ⭐

πŸ“ integer = $requisition->width ($newval=undef)

Same deal, but for the width. The width is the height's bestie fr fr. 🧚

  • $newval (scalar) β€” hand it a value and it sets the width; skip it (defaults to undef) and it returns the width as it currently stands.

Also returns an integer. Consistent king. πŸ‘‘


πŸ’« SEE ALSO πŸ’«

Go read these next, no cap:

  • Gtk2
  • Glib::Boxed

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 little write-up is brought to you by perl v5.42.0, dated 2025-07-25, and filed under Gtk2::Requisition(3) in the User Contributed Perl Documentation section. Go forth and requisition some space, you absolute legend. πŸ’–βœ¨

πŸ“¦ where this page comes from