Goo::Canvas::Item(3)

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

✨ Goo::Canvas::Item ✨

okay bestie, sit DOWN πŸ’… this is Goo::Canvas::Item from the User Contributed Perl Documentation corner of the Perl universe β€” it's the wrapper for GooCanvasItem, and it's literally the little building block that everything you draw on a Goo canvas is made of. every shape, every group, every cute lil thing on your canvas is one of these. no cap. πŸŽ€


🌸 HIERARCHY 🌸

so here's the family tree, and it's giving single parent energy:

Glib::Interface
+----Goo::Canvas::Item

it comes from Glib::Interface, and that's the whole lineage. iconic. πŸ‘‘


πŸ’– METHODS πŸ’–

okay this is the big one. every single method, in order, no skipping, we do NOT leave the group chat on read 🫢

  • $item->add_child ($child, $position) β€” yeet a new child into this item at a given spot.
    • $child (Goo::Canvas::Item)
    • $position (integer)
  • $item->allocate_area ($cr, $requested_area, $allocated_area, $x_offset, $y_offset) β€” does the allocation thing with the cairo context and the two bounds.
    • $cr (cairo_t)
    • $requested_area (GooCanvasBounds)
    • $allocated_area (GooCanvasBounds)
    • $x_offset (double)
    • $y_offset (double)
  • $item->animate ($x, $y, $scale, $degrees, $absolute, $duration, $step_time, $type) β€” set that item in MOTION bestie πŸ’ƒ
    • $x (double)
    • $y (double)
    • $scale (double)
    • $degrees (double)
    • $absolute (boolean)
    • $duration (integer)
    • $step_time (integer)
    • $type (Goo::Canvas::AnimateType)
  • GooCanvasBounds = $item->get_bounds β€” hands you the bounds. that's it, that's the vibe.
  • canvas = $item->get_canvas β€” which canvas is this item living on? this tells you.
  • $item->set_canvas ($canvas) β€” assign it a canvas.
    • $canvas (Goo::Canvas)
  • item = $item->get_child ($child_num) β€” grab one specific child by number.
    • $child_num (integer)
  • list = $item->get_child_properties ($child, ...) β€” get child properties as a list.
    • $child (Goo::Canvas::Item)
    • ... (list)
🚨 okay listen up because this one is DIFFERENT from the original C function. the C version is called like goo_canvas_item_get_child_properties(item, child, key1, &val1, key2, &val2, ..., NULL). this Perl one gets called like $item->get_child_properties($child, $key1, $key2, ...) and it returns a list ($key1, $val1, $key2, $val2, ...) instead. so you can literally do %pair = $item->get_child_properties($child, $key1, $key2) and then use $pair{$key1} and $pair{$key2} to get at the values. slay. 🧚
  • $item->set_child_properties ($child, ...) β€” set child properties.
    • $child (Goo::Canvas::Item)
    • ... (list)
  • $item->ensure_updated β€” make sure it's updated. self care. ✨
  • integer = $item->find_child ($child) β€” find a child, get back an integer.
    • $child (Goo::Canvas::Item)
  • boolean = $item->is_container β€” is it a container? true or false, bestie.
  • boolean = $item->is_visible β€” is it visible? same energy.
  • arrayref = $item->get_items_at ($x, $y, $cr, $is_pointer_event, $parent_is_visible) β€” everything sitting at that spot, as an arrayref.
    • $x (double)
    • $y (double)
    • $cr (cairo_t)
    • $is_pointer_event (boolean)
    • $parent_is_visible (boolean)
  • $item->lower (...) β€” send it down the stack.
    • ... (list)
  • itemmodel = $item->get_model β€” get the model.
  • $item->set_model ($model) β€” set the model.
    • $model (Goo::Canvas::ItemModel)
  • $item->move_child ($old_position, $new_position) β€” relocate a child from one position to another.
    • $old_position (integer)
    • $new_position (integer)
  • integer = $item->get_n_children β€” how many children does it have? an integer, obviously.
  • $item->paint ($cr, $bounds, $scale) β€” the paint job 🎨
    • $cr (cairo_t)
    • $bounds (GooCanvasBounds)
    • $scale (double)
  • item = $item->get_parent β€” who's your parent? returns the item.
  • $item->set_parent ($parent) β€” assign a parent.
    • $parent (Goo::Canvas::Item)
  • $item->raise (...) β€” bring it up the stack, main character energy πŸ‘‘
    • ... (list)
  • $item->remove_child ($child_num) β€” bye bestie πŸ‘‹ remove a child by number.
    • $child_num (integer)
  • $item->request_update β€” request an update.
  • GooCanvasBounds = $item->get_requested_area ($cr) β€” get the requested area.
    • $cr (cairo_t)
  • $item->rotate ($degrees, $cx, $cy) β€” spin it around a center point πŸŒ€
    • $degrees (double)
    • $cx (double)
    • $cy (double)
  • $item->scale ($sx, $sy) β€” resize it.
    • $sx (double)
    • $sy (double)
  • $item->set_simple_transform ($x, $y, $scale, $rotation) β€” the simple transform, all four values at once.
    • $x (double)
    • $y (double)
    • $scale (double)
    • $rotation (double)
  • $item->skew_x ($degrees, $cx, $cy) β€” skew on the x axis.
    • $degrees (double)
    • $cx (double)
    • $cy (double)
  • $item->skew_y ($degrees, $cx, $cy) β€” skew on the y axis.
    • $degrees (double)
    • $cx (double)
    • $cy (double)
  • $item->stop_animation β€” okay animation's over, everybody freeze πŸ›‘
  • style = $item->get_style β€” get the style.
  • $item->set_style ($style) β€” set the style.
    • $style (Goo::Canvas::Style)
  • boolean = $item->get_transform_for_child ($child, $transform) β€” returns a boolean for a child's transform.
    • $child (Goo::Canvas::Item)
    • $transform (cairo_matrix_t)
  • list = $item->get_transform β€” the transform, as a list.
  • $item->set_transform ($matrix) β€” set the transform.
    • $matrix (cairo_matrix_t)
  • $item->translate ($tx, $ty) β€” move it, move it πŸ•Ί
    • $tx (double)
    • $ty (double)
  • GooCanvasBounds = $item->update ($entire_tree, $cr) β€” update it and get bounds back.
    • $entire_tree (boolean)
    • $cr (cairo_t)

πŸ¦‹ PROPERTIES πŸ¦‹

the whole property roster, with defaults, readability and writability β€” all of it πŸ’œ

  • 'can-focus' (boolean : default false : readable / writable) β€” if the item can take the keyboard focus.
  • 'description' (string : default undef : readable / writable) β€” a description of the item for use by assistive technologies.
  • 'parent' (Goo::Canvas::Item : default undef : readable / writable) β€” the parent item.
  • 'pointer-events' (Goo::Canvas::PointerEvents : default visible-mask,painted-mask,fill-mask,stroke-mask,none : readable / writable) β€” specifies when the item receives pointer events.
  • 'title' (string : default undef : readable / writable) β€” a short context-rich description of the item for use by assistive technologies.
  • 'tooltip' (string : default undef : readable / writable) β€” the tooltip to display for the item.
  • 'transform' (Goo::Cairo::Matrix : default undef : readable / writable) β€” the transformation matrix of the item.
  • 'visibility' (Goo::Canvas::ItemVisibility : default "visible" : readable / writable) β€” when the canvas item is visible.
  • 'visibility-threshold' (double : default 0 : readable / writable) β€” the scale threshold at which the item becomes visible.

🌈 SIGNALS 🌈

the signals section, all fourteen, we're not cutting a single one:

  • animation-finished (Goo::Canvas::Item, boolean)
  • boolean = button-press-event (Goo::Canvas::Item, Goo::Canvas::Item, Gtk2::Gdk::Event)
  • boolean = button-release-event (Goo::Canvas::Item, Goo::Canvas::Item, Gtk2::Gdk::Event)
  • child-notify (Goo::Canvas::Item, Glib::ParamSpec)
  • boolean = enter-notify-event (Goo::Canvas::Item, Goo::Canvas::Item, Gtk2::Gdk::Event)
  • boolean = focus-in-event (Goo::Canvas::Item, Goo::Canvas::Item, Gtk2::Gdk::Event)
  • boolean = focus-out-event (Goo::Canvas::Item, Goo::Canvas::Item, Gtk2::Gdk::Event)
  • boolean = grab-broken-event (Goo::Canvas::Item, Goo::Canvas::Item, Gtk2::Gdk::Event)
  • boolean = key-press-event (Goo::Canvas::Item, Goo::Canvas::Item, Gtk2::Gdk::Event)
  • boolean = key-release-event (Goo::Canvas::Item, Goo::Canvas::Item, Gtk2::Gdk::Event)
  • boolean = leave-notify-event (Goo::Canvas::Item, Goo::Canvas::Item, Gtk2::Gdk::Event)
  • boolean = motion-notify-event (Goo::Canvas::Item, Goo::Canvas::Item, Gtk2::Gdk::Event)
  • boolean = query-tooltip (Goo::Canvas::Item, double, double, boolean, Gtk2::Tooltip)
  • boolean = scroll-event (Goo::Canvas::Item, Goo::Canvas::Item, Gtk2::Gdk::Event)

πŸŽ€ ENUMS AND FLAGS πŸŽ€

enum Goo::Canvas::AnimateType

  • 'freeze' / GOO_CANVAS_ANIMATE_FREEZE
  • 'reset' / GOO_CANVAS_ANIMATE_RESET
  • 'restart' / GOO_CANVAS_ANIMATE_RESTART
  • 'bounce' / GOO_CANVAS_ANIMATE_BOUNCE

enum Goo::Canvas::ItemVisibility

  • 'hidden' / GOO_CANVAS_ITEM_HIDDEN
  • 'invisible' / GOO_CANVAS_ITEM_INVISIBLE
  • 'visible' / GOO_CANVAS_ITEM_VISIBLE
  • 'visible-above-threshold' / GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD

flags Goo::Canvas::PointerEvents

  • 'visible-mask' / GOO_CANVAS_EVENTS_VISIBLE_MASK
  • 'painted-mask' / GOO_CANVAS_EVENTS_PAINTED_MASK
  • 'fill-mask' / GOO_CANVAS_EVENTS_FILL_MASK
  • 'stroke-mask' / GOO_CANVAS_EVENTS_STROKE_MASK
  • 'none' / GOO_CANVAS_EVENTS_NONE
  • 'visible-painted' / GOO_CANVAS_EVENTS_VISIBLE_PAINTED
  • 'visible-fill' / GOO_CANVAS_EVENTS_VISIBLE_FILL
  • 'visible-stroke' / GOO_CANVAS_EVENTS_VISIBLE_STROKE
  • 'visible' / GOO_CANVAS_EVENTS_VISIBLE
  • 'painted' / GOO_CANVAS_EVENTS_PAINTED
  • 'fill' / GOO_CANVAS_EVENTS_FILL
  • 'stroke' / GOO_CANVAS_EVENTS_STROKE
  • 'all' / GOO_CANVAS_EVENTS_ALL

πŸ‘€ SEE ALSO πŸ‘€

  • Glib::Interface

Copyright (C) 2025 Gtk2-Perl Team


and that's the whole page bestie, you ate that πŸ“ stay hydrated, go make something iconic on a canvas, and remember β€” this doc lives at Goo::Canvas::Item(3), it's perl v5.42.0, and it was cooked up on 2025-07-25. byeeee πŸ’…βœ¨

πŸ“¦ where this page comes from