Goo::Canvas::Item(3)
β¨ 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 likegoo_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 π
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
- fedora 43: perl-Goo-Canvas 0.06-60.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms