About my projects, examples and tutorials
Gnome::Gtk4::TextTag

Gnome::Gtk4::TextTag

Description§

A tag that can be applied to text contained in a Gnome::Gtk4::TextBuffer.

You may wish to begin by reading the [text widget conceptual overview](section-text-widget.html), which gives an overview of all the objects and data types related to the text widget and how they work together.

Tags should be in the Gnome::Gtk4::TextTagTable for a given Gnome::Gtk4::TextBuffer before using them with that buffer.

.create-tag() in class Gnome is the best way to create tags. See ā€œgtk4-demoā€ for numerous examples.

For each property of Gnome::Gtk4::TextTag, there is a ā€œsetā€ property, e.g. ā€œfont-setā€ corresponds to ā€œfontā€. These ā€œsetā€ properties reflect whether a property has been set or not.

They are maintained by GTK and you should not set them independently.

Uml Diagram§

UNKNOWN image§

=for image :class<inline> :src<asset_files/images/plantuml/TextTag.png> :width<70\%>

Class initialization§

new§

:native-object§

Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object() :$native-object! )
Code

new-texttag§

Creates a Gnome::Gtk4::TextTag.

method new-texttag ( Str $name --> Gnome::Gtk4::TextTag )
Code
  • $name; tag name.

Methods§

changed§

Emits the tag-changed defined in TextTagTable signal on the Gnome::Gtk4::TextTagTable where the tag is included.

The signal is already emitted when setting a Gnome::Gtk4::TextTag property. This function is useful for a Gnome::Gtk4::TextTag subclass.

method changed ( Bool() $size-changed )
Code

get-priority§

Get the tag priority.

method get-priority (--> Int )
Code

Return value; The tag’s priority..

set-priority§

Sets the priority of a Gnome::Gtk4::TextTag.

Valid priorities start at 0 and go to one less than .get-size() in class Gnome. Each tag in a table has a unique priority; setting the priority of one tag shifts the priorities of all the other tags in the table to maintain a unique priority for each tag.

Higher priority tags ā€œwinā€ if two tags both set the same text attribute. When adding a tag to a tag table, it will be assigned the highest priority in the table by default; so normally the precedence of a set of tags is the order in which they were added to the table, or created with .create-tag() in class Gnome, which adds the tag to the buffer’s table automatically.

method set-priority ( Int() $priority )
Code
  • $priority; the new priority.