Gtk2::TextTag(3)
π 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 toundefif 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, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether left and right margins accumulate.'background'β string, defaultundef,writable / private / static-nick / static-blurb. Background color as a string.'background-full-height'β boolean, defaultfalse,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, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects background height.'background-gdk'β Gtk2::Gdk::Color, defaultundef,readable / writable / private / static-nick / static-blurb. Background color as a (possibly unallocated) GdkColor.'background-set'β boolean, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects the background color.'background-stipple'β Gtk2::Gdk::Pixmap, defaultundef,readable / writable / private / static-nick / static-blurb. Bitmap to use as a mask when drawing the text background.'background-stipple-set'β boolean, defaultfalse,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, defaulttrue,readable / writable / private / static-nick / static-blurb. Whether the text can be modified by the user.'editable-set'β boolean, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects text editability.'family'β string, defaultundef,readable / writable / private / static-nick / static-blurb. Name of the font family, e.g. Sans, Helvetica, Times, Monospace.'family-set'β boolean, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects the font family.'font'β string, defaultundef,readable / writable / private / static-nick / static-blurb. Font description as a string, e.g."Sans Italic 12".'font-desc'β Pango::FontDescription, defaultundef,readable / writable / private / static-nick / static-blurb. Font description as a PangoFontDescription struct.'foreground'β string, defaultundef,writable / private / static-nick / static-blurb. Foreground color as a string.'foreground-gdk'β Gtk2::Gdk::Color, defaultundef,readable / writable / private / static-nick / static-blurb. Foreground color as a (possibly unallocated) GdkColor.'foreground-set'β boolean, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects the foreground color.'foreground-stipple'β Gtk2::Gdk::Pixmap, defaultundef,readable / writable / private / static-nick / static-blurb. Bitmap to use as a mask when drawing the text foreground.'foreground-stipple-set'β boolean, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects the foreground stipple.'indent'β integer, default0,readable / writable / private / static-nick / static-blurb. Amount to indent the paragraph, in pixels.'indent-set'β boolean, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects indentation.'invisible'β boolean, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this text is hidden.'invisible-set'β boolean, defaultfalse,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, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects paragraph justification.'language'β string, defaultundef,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, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects the language the text is rendered as.'left-margin'β integer, default0,readable / writable / private / static-nick / static-blurb. Width of the left margin in pixels.'left-margin-set'β boolean, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects the left margin.'name'β string, defaultundef,readable / writable / construct-only / private / static-nick / static-blurb. Name used to refer to the text tag.NULLfor anonymous tags. π yes this one isconstruct-only, so it's a set-it-at-birth situation.'paragraph-background'β string, defaultundef,writable / private / static-nick / static-blurb. Paragraph background color as a string.'paragraph-background-gdk'β Gtk2::Gdk::Color, defaultundef,readable / writable / private / static-nick / static-blurb. Paragraph background color as a (possibly unallocated) GdkColor.'paragraph-background-set'β boolean, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects the paragraph background color.'pixels-above-lines'β integer, default0,readable / writable / private / static-nick / static-blurb. Pixels of blank space above paragraphs.'pixels-above-lines-set'β boolean, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects the number of pixels above lines.'pixels-below-lines'β integer, default0,readable / writable / private / static-nick / static-blurb. Pixels of blank space below paragraphs.'pixels-below-lines-set'β boolean, defaultfalse,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, default0,readable / writable / private / static-nick / static-blurb. Pixels of blank space between wrapped lines in a paragraph.'pixels-inside-wrap-set'β boolean, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects the number of pixels between wrapped lines.'right-margin'β integer, default0,readable / writable / private / static-nick / static-blurb. Width of the right margin in pixels.'right-margin-set'β boolean, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects the right margin.'rise'β integer, default0,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, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects the rise.'scale'β double, default1,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 asPANGO_SCALE_X_LARGE.'scale-set'β boolean, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag scales the font size by a factor.'size'β integer, default0,readable / writable / private / static-nick / static-blurb. Font size in Pango units.'size-points'β double, default0,readable / writable / private / static-nick / static-blurb. Font size in points.'size-set'β boolean, defaultfalse,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, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects the font stretch.'strikethrough'β boolean, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether to strike through the text.'strikethrough-set'β boolean, defaultfalse,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, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects the font style.'tabs'β Pango::TabArray, defaultundef,readable / writable / private / static-nick / static-blurb. Custom tabs for this text.'tabs-set'β boolean, defaultfalse,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, defaultfalse,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, defaultfalse,readable / writable / private / static-nick / static-blurb. Whether this tag affects the font variant.'weight'β integer, default400,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, defaultfalse,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, defaultfalse,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
Gtk2Glib::Object
π COPYRIGHT
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
- fedora 43: perl-Gtk2 1.24993-23.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms