Gtk2::TextTag(3)

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

πŸ’– Gtk2::TextTag πŸ’–

okay bestie, gather round, because today we're talking about Gtk2::TextTag β€” it's the Perl wrapper for GtkTextTag, and honestly? it's giving main character energy in the Gtk2 text world. πŸŽ€

this is a page from the User Contributed Perl Documentation collection, and it's a long one, so buckle up. 🌸


✨ NAME ✨

Gtk2::TextTag β€” wrapper for GtkTextTag πŸ’…

like, that's it. that's the whole vibe. it wraps the C thing so you can use it from Perl without crying. 🫢


🌈 HIERARCHY 🌈

here's the family tree, and yes it's a small one, we love a simple lineage:

  Glib::Object
  +----Gtk2::TextTag

so Gtk2::TextTag is a child of Glib::Object, which means all that Glib::Object goodness is inherited and available. iconic behavior honestly. πŸ‘‘


πŸ¦‹ METHODS πŸ¦‹

🌟 texttag = Gtk2::TextTag->new ($name=undef)

constructor time!! πŸŽ‰ you call new on the class and you get yourself a fresh shiny texttag back. it's giving new beginnings.

the args:

  • $name (string or undef) β€” the name you wanna give your tag. it's optional-ish, defaults to undef if you don't pass anything. no cap.

🌸 boolean = $tag->event ($event_object, $event, $iter)

this one fires an event at the tag and hands you back a boolean. lowkey mysterious but okay we ball. πŸ’«

the args, one by one, because we don't skip details in this house:

  • $event_object (Glib::Object) β€” the object the event is happening on.
  • $event (Gtk2::Gdk::Event) β€” the actual event, from the Gdk side of things.
  • $iter (Gtk2::TextIter) β€” a text iterator, pointing at... wherever it's pointing. you know how iterators are. πŸ™ˆ

πŸ’œ integer = $tag->get_priority

πŸ’œ $tag->set_priority ($priority)

a lil getter/setter duo, as a treat. get_priority hands you back an integer, and set_priority takes one and sets it. ✨

the arg:

  • $priority (integer) β€” the priority value. an integer. that's the whole tea. πŸ“

bestie note: this is part 1 and there is so much more coming, so don't go anywhere. we're just getting started. πŸ’–βœ¨

✨ PROPERTIES ✨

okay bestie, this is the big one. every single property this tag can carry, with its type, its default, and the lil flag list it rolls with. no skipping, no skimming, we're doing all of them πŸ’…

  • 'accumulative-margin' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether left and right margins accumulate.
  • 'background' β€” string, default undef, writable / private / static-nick / static-blurb. Background color as a string.
  • 'background-full-height' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether the background color fills the entire line height or only the height of the tagged characters.
  • 'background-full-height-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects background height.
  • 'background-gdk' β€” Gtk2::Gdk::Color, default undef, readable / writable / private / static-nick / static-blurb. Background color as a (possibly unallocated) GdkColor.
  • 'background-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the background color.
  • 'background-stipple' β€” Gtk2::Gdk::Pixmap, default undef, readable / writable / private / static-nick / static-blurb. Bitmap to use as a mask when drawing the text background.
  • 'background-stipple-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the background stipple.
  • 'direction' β€” Gtk2::TextDirection, default "none", readable / writable / private / static-nick / static-blurb. Text direction, e.g. right-to-left or left-to-right.
  • 'editable' β€” boolean, default true, readable / writable / private / static-nick / static-blurb. Whether the text can be modified by the user.
  • 'editable-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects text editability.
  • 'family' β€” string, default undef, readable / writable / private / static-nick / static-blurb. Name of the font family, e.g. Sans, Helvetica, Times, Monospace.
  • 'family-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the font family.
  • 'font' β€” string, default undef, readable / writable / private / static-nick / static-blurb. Font description as a string, e.g. "Sans Italic 12".
  • 'font-desc' β€” Pango::FontDescription, default undef, readable / writable / private / static-nick / static-blurb. Font description as a PangoFontDescription struct.
  • 'foreground' β€” string, default undef, writable / private / static-nick / static-blurb. Foreground color as a string.
  • 'foreground-gdk' β€” Gtk2::Gdk::Color, default undef, readable / writable / private / static-nick / static-blurb. Foreground color as a (possibly unallocated) GdkColor.
  • 'foreground-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the foreground color.
  • 'foreground-stipple' β€” Gtk2::Gdk::Pixmap, default undef, readable / writable / private / static-nick / static-blurb. Bitmap to use as a mask when drawing the text foreground.
  • 'foreground-stipple-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the foreground stipple.
  • 'indent' β€” integer, default 0, readable / writable / private / static-nick / static-blurb. Amount to indent the paragraph, in pixels.
  • 'indent-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects indentation.
  • 'invisible' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this text is hidden.
  • 'invisible-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects text visibility.
  • 'justification' β€” Gtk2::Justification, default "left", readable / writable / private / static-nick / static-blurb. Left, right, or center justification.
  • 'justification-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects paragraph justification.
  • 'language' β€” string, default undef, readable / writable / private / static-nick / static-blurb. The language this text is in, as an ISO code. Pango can use this as a hint when rendering the text. If not set, an appropriate default will be used.
  • 'language-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the language the text is rendered as.
  • 'left-margin' β€” integer, default 0, readable / writable / private / static-nick / static-blurb. Width of the left margin in pixels.
  • 'left-margin-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the left margin.
  • 'name' β€” string, default undef, readable / writable / construct-only / private / static-nick / static-blurb. Name used to refer to the text tag. NULL for anonymous tags. πŸ‘€ yes this one is construct-only, so it's a set-it-at-birth situation.
  • 'paragraph-background' β€” string, default undef, writable / private / static-nick / static-blurb. Paragraph background color as a string.
  • 'paragraph-background-gdk' β€” Gtk2::Gdk::Color, default undef, readable / writable / private / static-nick / static-blurb. Paragraph background color as a (possibly unallocated) GdkColor.
  • 'paragraph-background-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the paragraph background color.
  • 'pixels-above-lines' β€” integer, default 0, readable / writable / private / static-nick / static-blurb. Pixels of blank space above paragraphs.
  • 'pixels-above-lines-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the number of pixels above lines.
  • 'pixels-below-lines' β€” integer, default 0, readable / writable / private / static-nick / static-blurb. Pixels of blank space below paragraphs.
  • 'pixels-below-lines-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the number of pixels above lines. (yes bestie, it says above right there in the original, I'm not touching it, that's the manpage's business πŸ’€)
  • 'pixels-inside-wrap' β€” integer, default 0, readable / writable / private / static-nick / static-blurb. Pixels of blank space between wrapped lines in a paragraph.
  • 'pixels-inside-wrap-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the number of pixels between wrapped lines.
  • 'right-margin' β€” integer, default 0, readable / writable / private / static-nick / static-blurb. Width of the right margin in pixels.
  • 'right-margin-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the right margin.
  • 'rise' β€” integer, default 0, readable / writable / private / static-nick / static-blurb. Offset of text above the baseline (below the baseline if rise is negative) in Pango units.
  • 'rise-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the rise.
  • 'scale' β€” double, default 1, readable / writable / private / static-nick / static-blurb. Font size as a scale factor relative to the default font size. This properly adapts to theme changes etc. so is recommended. Pango predefines some scales such as PANGO_SCALE_X_LARGE.
  • 'scale-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag scales the font size by a factor.
  • 'size' β€” integer, default 0, readable / writable / private / static-nick / static-blurb. Font size in Pango units.
  • 'size-points' β€” double, default 0, readable / writable / private / static-nick / static-blurb. Font size in points.
  • 'size-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the font size.
  • 'stretch' β€” Pango::Stretch, default "normal", readable / writable / private / static-nick / static-blurb. Font stretch as a PangoStretch, e.g. PANGO_STRETCH_CONDENSED.
  • 'stretch-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the font stretch.
  • 'strikethrough' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether to strike through the text.
  • 'strikethrough-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects strikethrough.
  • 'style' β€” Pango::Style, default "normal", readable / writable / private / static-nick / static-blurb. Font style as a PangoStyle, e.g. PANGO_STYLE_ITALIC.
  • 'style-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the font style.
  • 'tabs' β€” Pango::TabArray, default undef, readable / writable / private / static-nick / static-blurb. Custom tabs for this text.
  • 'tabs-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects tabs.
  • 'underline' β€” Pango::Underline, default "none", readable / writable / private / static-nick / static-blurb. Style of underline for this text.
  • 'underline-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects underlining.
  • 'variant' β€” Pango::Variant, default "normal", readable / writable / private / static-nick / static-blurb. Font variant as a PangoVariant, e.g. PANGO_VARIANT_SMALL_CAPS.
  • 'variant-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the font variant.
  • 'weight' β€” integer, default 400, readable / writable / private / static-nick / static-blurb. Font weight as an integer, see predefined values in PangoWeight; for example, PANGO_WEIGHT_BOLD.
  • 'weight-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects the font weight.
  • 'wrap-mode' β€” Gtk2::WrapMode, default "none", readable / writable / private / static-nick / static-blurb. Whether to wrap lines never, at word boundaries, or at character boundaries.
  • 'wrap-mode-set' β€” boolean, default false, readable / writable / private / static-nick / static-blurb. Whether this tag affects line wrap mode.

πŸ“‘ SIGNALS πŸ“‘

and last for this part, the signal situation 🫢

boolean = event (Gtk2::TextTag, Glib::Object, Gtk2::Gdk::Event, Gtk2::TextIter)

that's the event signal, it hands you back a boolean, and it arrives with a Gtk2::TextTag, a Glib::Object, a Gtk2::Gdk::Event, and a Gtk2::TextIter in tow ✨

✨ ENUMS AND FLAGS ✨

okay bestie, this is the part where all the little named constants live πŸ’– these are the string values you actually pass in, paired with their C-level twin. slay.


πŸŽ€ enum Gtk2::Justification

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

πŸ¦‹ enum Gtk2::TextDirection

  • 'none' / GTK_TEXT_DIR_NONE
  • 'ltr' / GTK_TEXT_DIR_LTR
  • 'rtl' / GTK_TEXT_DIR_RTL

🌸 enum Gtk2::WrapMode

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

πŸ’… enum Pango::Stretch

  • 'ultra-condensed' / PANGO_STRETCH_ULTRA_CONDENSED
  • 'extra-condensed' / PANGO_STRETCH_EXTRA_CONDENSED
  • 'condensed' / PANGO_STRETCH_CONDENSED
  • 'semi-condensed' / PANGO_STRETCH_SEMI_CONDENSED
  • 'normal' / PANGO_STRETCH_NORMAL
  • 'semi-expanded' / PANGO_STRETCH_SEMI_EXPANDED
  • 'expanded' / PANGO_STRETCH_EXPANDED
  • 'extra-expanded' / PANGO_STRETCH_EXTRA_EXPANDED
  • 'ultra-expanded' / PANGO_STRETCH_ULTRA_EXPANDED

🧚 enum Pango::Style

  • 'normal' / PANGO_STYLE_NORMAL
  • 'oblique' / PANGO_STYLE_OBLIQUE
  • 'italic' / PANGO_STYLE_ITALIC

🌈 enum Pango::Underline

  • 'none' / PANGO_UNDERLINE_NONE
  • 'single' / PANGO_UNDERLINE_SINGLE
  • 'double' / PANGO_UNDERLINE_DOUBLE
  • 'low' / PANGO_UNDERLINE_LOW
  • 'error' / PANGO_UNDERLINE_ERROR
  • 'single-line' / PANGO_UNDERLINE_SINGLE_LINE
  • 'double-line' / PANGO_UNDERLINE_DOUBLE_LINE
  • 'error-line' / PANGO_UNDERLINE_ERROR_LINE

πŸ‘‘ enum Pango::Variant

  • 'normal' / PANGO_VARIANT_NORMAL
  • 'small-caps' / PANGO_VARIANT_SMALL_CAPS
  • 'all-small-caps' / PANGO_VARIANT_ALL_SMALL_CAPS
  • 'petite-caps' / PANGO_VARIANT_PETITE_CAPS
  • 'all-petite-caps' / PANGO_VARIANT_ALL_PETITE_CAPS
  • 'unicase' / PANGO_VARIANT_UNICASE
  • 'title-caps' / PANGO_VARIANT_TITLE_CAPS

πŸ”­ SEE ALSO

  • Gtk2
  • Glib::Object

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Gtk2 for a full notice.


and that's a wrap on the whole thing, bestie πŸ’œ you just read a page generated by perl v5.42.0, dated 2025-07-25, and it was for Gtk2::TextTag(3). go make those tags pretty, you absolute icon 🫢✨

πŸ“¦ where this page comes from