Goo::Ca...xtModel(3)

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

πŸ’– NAME πŸ’–

Goo::Canvas::TextModel β€” bestie, it's literally just a wrapper for GooCanvasTextModel. That's the whole vibe. It wraps the thing. πŸŽ€


🌸 HIERARCHY 🌸

okay so here's the family tree, and yes it matters:

Glib::Object
+----Goo::Canvas::ItemModelSimple
     +----Goo::Canvas::TextModel

so it's a Glib::Object at heart, raised by Goo::Canvas::ItemModelSimple, and now it's out here being a whole Goo::Canvas::TextModel. generational glow-up fr fr πŸ’…


✨ INTERFACES ✨

it also serves looks via this interface:

  • Goo::Canvas::ItemModel

πŸ¦‹ METHODS πŸ¦‹

itemmodel = Goo::Canvas::TextModel->new ($parent, $string, $x, $y, $width, $anchor, ...)

make a new one, queen πŸ‘‘ here's what you're handing over:

  • $parent (Goo::Canvas::ItemModel) β€” the parent item model, the one who brought you here
  • $string (string) β€” your text, your words, your moment
  • $x (double) β€” x coordinate bestie
  • $y (double) β€” y coordinate bestie
  • $width (double) β€” how wide
  • $anchor (Gtk2::AnchorType) β€” where it anchors
  • ... (list) β€” and then whatever else, the list keeps going, we love a flexible queen

πŸ’œ PROPERTIES πŸ’œ

every single one, no skips, periodt:

  • 'alignment' (Pango::Alignment : default "left" : readable / writable) β€” how to align the text. left is the default because left is safe and we respect that.
  • 'anchor' (Gtk2::AnchorType : default "north-west" : readable / writable) β€” how to position the text relative to the given x and y coordinates. it just wants to know where it stands relative to things, relatable honestly.
  • 'ellipsize' (Pango::EllipsizeMode : default "none" : readable / writable) β€” the preferred place to ellipsize the string, if the label does not have enough room to display the entire string. it's the "…" moment, iykyk.
  • 'height' (double : default -1 : readable / writable) β€” the height to use to layout the text, or -1 to let the text use as much vertical space as needed. -1 = main character energy, take up space bb.
  • 'text' (string : default undef : readable / writable) β€” the text to display. the actual content. the star of the show. 🌟
  • 'use-markup' (boolean : default false : readable / writable) β€” whether to parse PangoMarkup in the text, to support different styles. turn it on and suddenly everything's cute ✨
  • 'width' (double : default -1 : readable / writable) β€” the width to use to layout the text, or -1 to let the text use as much horizontal space as needed.
  • 'wrap' (Pango::WrapMode : default "word" : readable / writable) β€” the preferred method of wrapping the string if a width has been set. yes bestie, we wrap. we don't overflow in this house.
  • 'x' (double : default 0 : readable / writable) β€” the x coordinate of the text.
  • 'y' (double : default 0 : readable / writable) β€” the y coordinate of the text.
ngl all of these are both readable and writable, so go off, change them, customize your little heart out 🫢

🌈 ENUMS AND FLAGS 🌈

the full menu of options, nothing left out:

enum Gtk2::AnchorType

  • 'center' / 'GTK_ANCHOR_CENTER'
  • 'north' / 'GTK_ANCHOR_NORTH'
  • 'north-west' / 'GTK_ANCHOR_NORTH_WEST'
  • 'north-east' / 'GTK_ANCHOR_NORTH_EAST'
  • 'south' / 'GTK_ANCHOR_SOUTH'
  • 'south-west' / 'GTK_ANCHOR_SOUTH_WEST'
  • 'south-east' / 'GTK_ANCHOR_SOUTH_EAST'
  • 'west' / 'GTK_ANCHOR_WEST'
  • 'east' / 'GTK_ANCHOR_EAST'
  • 'n' / 'GTK_ANCHOR_N'
  • 'nw' / 'GTK_ANCHOR_NW'
  • 'ne' / 'GTK_ANCHOR_NE'
  • 's' / 'GTK_ANCHOR_S'
  • 'sw' / 'GTK_ANCHOR_SW'
  • 'se' / 'GTK_ANCHOR_SE'
  • 'w' / 'GTK_ANCHOR_W'
  • 'e' / 'GTK_ANCHOR_E'

enum Pango::Alignment

  • 'left' / 'PANGO_ALIGN_LEFT'
  • 'center' / 'PANGO_ALIGN_CENTER'
  • 'right' / 'PANGO_ALIGN_RIGHT'

enum Pango::EllipsizeMode

  • 'none' / 'PANGO_ELLIPSIZE_NONE'
  • 'start' / 'PANGO_ELLIPSIZE_START'
  • 'middle' / 'PANGO_ELLIPSIZE_MIDDLE'
  • 'end' / 'PANGO_ELLIPSIZE_END'

enum Pango::WrapMode

  • 'word' / 'PANGO_WRAP_WORD'
  • 'char' / 'PANGO_WRAP_CHAR'
  • 'word-char' / 'PANGO_WRAP_WORD_CHAR'
  • 'none' / 'PANGO_WRAP_NONE'

πŸ‘€ SEE ALSO πŸ‘€

go read these too, they're part of the lore:

  • Glib::Object
  • Goo::Canvas::ItemModelSimple

Copyright (C) 2025 Gtk2-Perl Team β€” slay, thank you for your service 🫢


ok that's the whole page bestie, you ate that πŸ’… this was perl v5.42.0, dated 2025-07-25, and it lives in the Goo::Ca...xtModel(3) corner of the User Contributed Perl Documentation. go forth and render text βœ¨πŸ¦‹πŸ’–
πŸ“¦ where this page comes from