Gtk2::G...ctangle(3)
π Gtk2::Gdk::Rectangle β the vibe β¨
okay so bestie, welcome to Gtk2::Gdk::Rectangle, a page from the User Contributed Perl Documentation manual (yes that's the manual name, we're fancy now π
). It's literally just a wrapper for GdkRectangle, and it's here to make your rectangles behave.
πΈ NAME
Gtk2::Gdk::Rectangle β a wrapper for GdkRectangle π
π¦ HIERARCHY
Look at the family tree, it's giving legacy β¨
Glib::Boxed
+----Gtk2::Gdk::Rectangle
So it inherits from Glib::Boxed and that's the whole lineage. Short, sweet, iconic. π
π METHODS
π rectangle = Gtk2::Gdk::Rectangle->new ($x, $y, $width, $height)
Build yourself a brand new rectangle, no cap. Here's what you gotta feed it:
$x(integer)$y(integer)$width(integer)$height(integer)
Four integers, one rectangle, slay. β¨
π integer = $rectangle->height
π oldvalue = $rectangle->height ($newvalue)
Call it with no args and it hands you the height as an integer. Call it with an arg and it sets a new one β and gives you back the oldvalue like a lil receipt π§Ύ
$newvalue(integer)
π rectangle = $src1->intersect ($src2)
Give it another rectangle and it returns the intersection. Overlap check but make it β¨mathβ¨
$src2(Gtk2::Gdk::Rectangle)
π rectangle = $src1->union ($src2)
Same energy, different result: this one returns the union of the two. One rectangle to hold them both π«Ά
$src2(Gtk2::Gdk::Rectangle)
β (x, y, width, height) = $rectangle->values
Not me getting all four values back at once π It returns them as a list: x, y, width, height. Periodt.
π integer = $rectangle->width
π oldvalue = $rectangle->width ($newvalue)
Getter mode: gives you the width as an integer. Setter mode: pass a $newvalue and it updates it, handing back the oldvalue. Classic dual-purpose icon behaviour.
$newvalue(integer)
π§ integer = $rectangle->x
π§ oldvalue = $rectangle->x ($newvalue)
Get the x as an integer, or set it by passing a $newvalue and receive the oldvalue in return. Same pattern, different coordinate. iykyk.
$newvalue(integer)
π§ integer = $rectangle->y
π§ oldvalue = $rectangle->y ($newvalue)
You guessed it bestie β read the y as an integer, or write it with a $newvalue and get the oldvalue back.
$newvalue(integer)
π SEE ALSO
Go read these next, they're the main characters too:
Gtk2Glib::Boxed
π COPYRIGHT
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice. π
okay that's the whole page, you're officially a rectangle expert now π go forth and intersect responsibly
mwah π β this was perl v5.42.0, dated 2025-07-25, and that's the whole manual page. bye bestie!! π¦β¨
π¦ 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