Gnome2:...:PathDef(3)

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

πŸ’– NAME πŸ’–

Gnome2::Canvas::PathDef β€” bestie, it's a wrapper for GnomeCanvasPathDef. That's the whole vibe. She's a little boxed object who holds a whole path (like, lines and curves and shapes, the works) so your canvas can draw it. ✨


πŸ¦‹ HIERARCHY πŸ¦‹

Glib::Boxed
+----Gnome2::Canvas::PathDef

So she's a Glib::Boxed girly, which means she gets all the boxed-type energy from Glib, and then adds her own path stuff on top. Main character lineage fr. πŸ‘‘


✨ METHODS ✨

pathdef = Gnome2::Canvas::PathDef->new

Makes you a brand-new, empty path. Blank slate, no thoughts, just vibes. πŸŽ€

pathdef = Gnome2::Canvas::PathDef->new_sized ($length)

Same thing but you tell her how big she's gonna get up front.

  • $length β€” an integer. That's your size hint, bestie. πŸ’…

boolean = $path->all_closed

Returns true if literally every part of the path is closed. All of them. No stragglers. 🫢

boolean = $path->all_open

Returns true if every single part is open. Not one of them is closed. Iconic behaviour. 🌸

boolean = $path->any_closed

True if at least one part is closed. Low bar but she clears it. 😌

boolean = $path->any_open

True if at least one part is open. Same energy, opposite check. 🌈

pathdef = $path->close_all

Closes every part of the path. Returns a pathdef. πŸŽ€

pathdef = $path->closed_parts

Gives you back just the closed parts, as a pathdef. Only the closed girlies make the cut. πŸ’…

$path->closepath

Closes the current path. That's it, that's the method. ✨

$path->closepath_current

Closes the current subpath. Different thing, very important distinction, no notes. πŸ’–

pathdef = Gnome2::Canvas::PathDef->concat (...)

Glues a bunch of pathdefs together into one big pathdef. Friendship bracelet energy. 🫢

  • ... β€” a list of Gnome2::Canvas::PathDef objects to concatenate.

$dst->copy ($src)

  • $src β€” a Gnome2::Canvas::PathDef.

Copies the path from $src into $dst. πŸ’«

Heads up bestie, this is NOT the same as the copy that Glib::Boxed gives you. The semantics are very different. If you want the Glib::Boxed-flavoured behaviour, duplicate is the one you actually want. Do not mix these up, I am begging. 😭

$path->curveto ($x0, $y0, $x1, $y1, $x2, $y2)

Draws a cubic curve. Six numbers, three points, one slay. 🌈

  • $x0 β€” a double.
  • $y0 β€” a double.
  • $x1 β€” a double.
  • $y1 β€” a double.
  • $x2 β€” a double.
  • $y2 β€” a double.

pathdef = $path->duplicate

Hands you a copy of the path. This is the analog to Glib::Boxed's copy, remember that. 🧚

$path->ensure_space ($space)

Makes sure there's room for more.

  • $space β€” an integer. Your space budget, bestie. πŸ“

$path->finish

Finishes the path off. Wrap it up, we're done here. βœ…

boolean = $path->has_currentpoint

True if there's a current point hanging out. Sometimes there isn't. She's mysterious like that. πŸ™ˆ

boolean = $path->is_empty

True if the path is empty. Empty path = no thoughts, head empty. πŸ’€

integer = $path->length

Tells you how long the path is, as an integer. πŸ”’

$path->lineto ($x, $y)

Draws a straight line to a point. Simple, clean, effective. πŸ“

  • $x β€” a double.
  • $y β€” a double.

$path->lineto_moving ($x, $y)

A line to a point, but moving. Yes that's vague, no I will not elaborate, the docs didn't either. πŸ’…

  • $x β€” a double.
  • $y β€” a double.

$path->moveto ($x, $y)

Moves the current point without drawing anything. Just repositioning, no ink spilled. ✨

  • $x β€” a double.
  • $y β€” a double.

pathdef = $path->open_parts

Gives you back only the open parts, as a pathdef. The opposite of closed_parts, they're sisters. πŸ¦‹

$path->reset

Wipes the path back to nothing. Clean slate, fresh start, new semester energy. πŸŽ€

@pathdefs = $path->split

Splits the path into a list of pathdefs. One becomes many. She contains multitudes. 🌸


🌈 SEE ALSO 🌈

  • Gnome2::Canvas
  • Glib::Boxed

Copyright (C) 2003-2004 by the Gtk2-Perl Team.

This software is licensed under the LGPL; see Gnome2::Canvas for a full notice.


okay that's the whole page bestie, you ate that 🫢 this was pulled straight from the user contributed perl documentation for Gnome2:...:PathDef, perl v5.42.0, dated 2025-07-25 β€” mwah, periodt πŸ’…βœ¨

πŸ“¦ where this page comes from