Class TextTagTable

All Implemented Interfaces:
PointerInterface

public class TextTagTable extends Object
The collection of tags in a `GtkTextBuffer`

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.

# GtkTextTagTables as GtkBuildable

The `GtkTextTagTable` implementation of the `GtkBuildable` interface
supports adding tags by specifying “tag” as the “type” attribute
of a <child> element.

An example of a UI definition fragment specifying tags:
```xml
<object class="GtkTextTagTable">
<child type="tag">
<object class="GtkTextTag"/>
</child>
</object>
```

https://docs.gtk.org/gtk4/class.TextTagTable.html

  • Field Details

  • Constructor Details

    • TextTagTable

      public TextTagTable(PointerContainer pointer)
    • TextTagTable

      public TextTagTable()
      Creates a new `GtkTextTagTable`.

      The table contains no tags by default.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • add

      public boolean add(@Nonnull TextTag tag)
      Add a tag to the table.

      The tag is assigned the highest priority in the table.

      @tag must not be in a tag table already, and may not have
      the same name as an already-added tag.
      Parameters:
      tag - a `GtkTextTag`
      Returns:
      %TRUE on success.
    • foreach

      public void foreach(TextTagTable.OnTextTagTableForeach func, @Nullable Pointer data)
      Calls @func on each tag in @table, with user data @data.

      Note that the table may not be modified while iterating
      over it (you can’t add/remove tags).
      Parameters:
      func - a function to call on each tag
      data - user data
    • getSize

      public int getSize()
      Returns the size of the table (number of tags)
      Returns:
      number of tags in @table
    • lookup

      public TextTag lookup(@Nonnull Str name)
      Look up a named tag.
      Parameters:
      name - name of a tag
      Returns:
      The tag
    • lookup

      public TextTag lookup(String name)
      Look up a named tag.
      Parameters:
      name - name of a tag
      Returns:
      The tag
    • remove

      public void remove(@Nonnull TextTag tag)
      Remove a tag from the table.

      If a `GtkTextBuffer` has @table as its tag table, the tag is
      removed from the buffer. The table’s reference to the tag is
      removed, so the tag will end up destroyed if you don’t have
      a reference to it.
      Parameters:
      tag - a `GtkTextTag`
    • onTagAdded

      public SignalHandler onTagAdded(TextTagTable.OnTagAdded signal)
      Connect to signal "tag-added".
      See TextTagTable.OnTagAdded.onTagAdded(ch.bailu.gtk.gtk.TextTag) for signal description.
      Field SIGNAL_ON_TAG_ADDED contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onTagChanged

      public SignalHandler onTagChanged(TextTagTable.OnTagChanged signal)
      Connect to signal "tag-changed".
      See TextTagTable.OnTagChanged.onTagChanged(ch.bailu.gtk.gtk.TextTag, boolean) for signal description.
      Field SIGNAL_ON_TAG_CHANGED contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onTagRemoved

      public SignalHandler onTagRemoved(TextTagTable.OnTagRemoved signal)
      Connect to signal "tag-removed".
      See TextTagTable.OnTagRemoved.onTagRemoved(ch.bailu.gtk.gtk.TextTag) for signal description.
      Field SIGNAL_ON_TAG_REMOVED contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Returns:
      Buildable
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()