Gtk2::G...ctangle(3)

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

πŸ’– 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:

  • 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. πŸ’–


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