Gnome2:...ichText(3)

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

πŸ¦‹ Gnome2::Canvas::RichText πŸ¦‹

okay so bestie, welcome to the Gnome2:...ichText(3) page πŸ’– it lives in the User Contributed Perl Documentation corner of the perl-verse, and it's serving pure canvas-text energy. This is the wrapper for GnomeCanvasRichText β€” like, a text item that lives on a Gnome2::Canvas and is fully editable. it's giving main character typography. periodt. ✨


✨ NAME ✨

Gnome2::Canvas::RichText β€” wrapper for GnomeCanvasRichText πŸ’…


🌈 HIERARCHY 🌈

here's the family tree, bestie, and yes we're the youngest sibling at the bottom, thriving:

Glib::Object
+----Glib::InitiallyUnowned
     +----Gtk2::Object
          +----Gnome2::Canvas::Item
               +----Gnome2::Canvas::RichText

so it's Glib::Object β†’ Glib::InitiallyUnowned β†’ Gtk2::Object β†’ Gnome2::Canvas::Item β†’ us πŸ‘‘ we inherited everything, no cap.


πŸ’… METHODS πŸ’…

okay the methods, let's go, one by one, no skipping, that's the rule 🫢

  • textbuffer = $text->get_buffer β€” hand over the text buffer please πŸ“₯
  • $text->set_buffer ($buffer) β€” set the buffer, and here's the tea:
    • $buffer (Gtk2::TextBuffer)
  • $text->copy_clipboard β€” copy the selection to the clipboard, iconic behavior βœ‚οΈβœ¨
  • $text->cut_clipboard β€” cut it. gone. into the clipboard it goes πŸ’€
  • textiter = $text->get_iter_at_location ($x, $y) β€” get the text iter at a spot, so you know exactly what's where πŸ”
    • $x (integer)
    • $y (integer)
  • rectangle = $text->get_iter_location ($iter) β€” get the rectangle where that iter lives πŸ“
    • $iter (Gtk2::TextIter)
  • $text->paste_clipboard β€” paste what you copied, the cycle continues πŸŒ€

πŸŽ€ PROPERTIES πŸŽ€

twenty of them. TWENTY. we're not skipping a single one, bestie, every default is staying exactly where it is πŸ’–

  • 'anchor' (Gtk2::AnchorType : default "north-west" : readable / writable) β€” anchor point for text, like where the text anchors itself, vibe-wise βš“
  • 'cursor-blink' (boolean : default true : readable / writable) β€” does the cursor blink in this rich text item? blink blink blink πŸ‘οΈ
  • 'cursor-visible' (boolean : default true : readable / writable) β€” is the cursor visible in this rich text item? don't hide it, it's shy
  • 'direction' (Gtk2::DirectionType : default "tab-backward" : readable / writable) β€” text direction, which way we're heading 🧭
  • 'editable' (boolean : default true : readable / writable) β€” is this rich text item editable? by default yes, go off ✍️
  • 'grow-height' (boolean : default false : readable / writable) β€” should the text box height grow if the text does not fit? πŸ“
  • 'height' (double : default 0 : readable / writable) β€” height for text box
  • 'indent' (integer : default 0 : readable / writable) β€” number of pixels for indentation
  • 'justification' (Gtk2::Justification : default "left" : readable / writable) β€” justification mode, aka which side the text is aligned to
  • 'left-margin' (integer : default 0 : readable / writable) β€” number of pixels in the left margin
  • 'pixels-above-lines' (integer : default 0 : readable / writable) β€” number of pixels to put above lines
  • 'pixels-below-lines' (integer : default 0 : readable / writable) β€” number of pixels to put below lines
  • 'pixels-inside-wrap' (integer : default 0 : readable / writable) β€” number of pixels to put inside the wrap
  • 'right-margin' (integer : default 0 : readable / writable) β€” number of pixels in the right margin
  • 'text' (string : default undef : readable / writable) β€” text to display, y'know, the whole point 🫢
  • 'visible' (boolean : default true : readable / writable) β€” is this rich text item visible? (yes bestie, you're seen πŸ‘‘)
  • 'width' (double : default 0 : readable / writable) β€” width for text box
  • 'wrap-mode' (Gtk2::WrapMode : default "word" : readable / writable) β€” wrap mode for multiline text
  • 'x' (double : default 0 : readable / writable) β€” X position
  • 'y' (double : default 0 : readable / writable) β€” Y position

πŸ”” SIGNALS πŸ””

one signal, and it's a whole moment:

  • tag-changed (Gnome2::Canvas::RichText, Glib::Object)

🌸 ENUMS AND FLAGS 🌸

the alphabet of options, bestie, all of them, in order, no shortcuts πŸ’œ

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 Gtk2::DirectionType

  • 'tab-forward' / 'GTK_DIR_TAB_FORWARD'
  • 'tab-backward' / 'GTK_DIR_TAB_BACKWARD'
  • 'up' / 'GTK_DIR_UP'
  • 'down' / 'GTK_DIR_DOWN'
  • 'left' / 'GTK_DIR_LEFT'
  • 'right' / 'GTK_DIR_RIGHT'

enum Gtk2::Justification

  • 'left' / 'GTK_JUSTIFY_LEFT'
  • 'right' / 'GTK_JUSTIFY_RIGHT'
  • 'center' / 'GTK_JUSTIFY_CENTER'
  • 'fill' / 'GTK_JUSTIFY_FILL'

enum Gtk2::WrapMode

  • 'none' / 'GTK_WRAP_NONE'
  • 'char' / 'GTK_WRAP_CHAR'
  • 'word' / 'GTK_WRAP_WORD'
  • 'word-char' / 'GTK_WRAP_WORD_CHAR'

🫢 SEE ALSO 🫢

go read these next, bestie, they're the friend group:

  • Gnome2::Canvas
  • Glib::Object
  • Glib::InitiallyUnowned
  • Gtk2::Object
  • Gnome2::Canvas::Item

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

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


and that's the whole page, bestie!! ✨ this was perl v5.42.0, dated 2025-07-25, straight from the User Contributed Perl Documentation. go build something cute with it. mwah πŸ’…πŸ’–πŸ¦‹
πŸ“¦ where this page comes from