You may wish to begin by reading the [text widget conceptual overview][TextWidget] 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:
<object class="GtkTextTagTable">
<child type="tag">
<object class="GtkTextTag"/>
</child>
</object>
function "+"
(Widget : access Gtk_Text_Tag_Table_Record'Class)
return Gtk.Buildable.Gtk_Buildable
function "-"
(Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Text_Tag_Table
procedure Add
(Table : not null access Gtk_Text_Tag_Table_Record;
Tag : not null access Gtk.Text_Tag.Gtk_Text_Tag_Record'Class)
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.
a Gtk.Text_Tag.Gtk_Text_Tag
type Cb_GObject_Gtk_Text_Tag_Boolean_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class;
Tag : not null access Gtk.Text_Tag.Gtk_Text_Tag_Record'Class;
Size_Changed : Boolean);
type Cb_GObject_Gtk_Text_Tag_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class;
Tag : not null access Gtk.Text_Tag.Gtk_Text_Tag_Record'Class);
type Cb_Gtk_Text_Tag_Table_Gtk_Text_Tag_Boolean_Void is not null access procedure
(Self : access Gtk_Text_Tag_Table_Record'Class;
Tag : not null access Gtk.Text_Tag.Gtk_Text_Tag_Record'Class;
Size_Changed : Boolean);
type Cb_Gtk_Text_Tag_Table_Gtk_Text_Tag_Void is not null access procedure
(Self : access Gtk_Text_Tag_Table_Record'Class;
Tag : not null access Gtk.Text_Tag.Gtk_Text_Tag_Record'Class);
procedure Foreach
(Table : not null access Gtk_Text_Tag_Table_Record;
Func : Gtk_Text_Tag_Table_Foreach)
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).
a function to call on each tag
function Get_Size
(Table : not null access Gtk_Text_Tag_Table_Record) return Glib.Gint
Returns the size of the table (number of tags)
number of tags in Table
function Get_Type return Glib.GType
procedure Gtk_New (Table : out Gtk_Text_Tag_Table)
Creates a new Gtk.Text_Tag_Table.Gtk_Text_Tag_Table. The table contains no tags by default. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
type Gtk_Text_Tag_Table is access all Gtk_Text_Tag_Table_Record'Class;
type Gtk_Text_Tag_Table_Foreach is access procedure
(Tag : not null access Gtk.Text_Tag.Gtk_Text_Tag_Record'Class);
the Gtk.Text_Tag.Gtk_Text_Tag
function Gtk_Text_Tag_Table_New return Gtk_Text_Tag_Table
Creates a new Gtk.Text_Tag_Table.Gtk_Text_Tag_Table. The table contains no tags by default.
type Gtk_Text_Tag_Table_Record is new GObject_Record with null record;
package Implements_Gtk_Buildable is new Glib.Types.Implements
(Gtk.Buildable.Gtk_Buildable, Gtk_Text_Tag_Table_Record, Gtk_Text_Tag_Table);
procedure Initialize
(Table : not null access Gtk_Text_Tag_Table_Record'Class)
Creates a new Gtk.Text_Tag_Table.Gtk_Text_Tag_Table. The table contains no tags by default. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
function Lookup
(Table : not null access Gtk_Text_Tag_Table_Record;
Name : UTF8_String) return Gtk.Text_Tag.Gtk_Text_Tag
Look up a named tag.
name of a tag
The tag, or null if none by that name is in the table.
procedure On_Tag_Added
(Self : not null access Gtk_Text_Tag_Table_Record;
Call : Cb_GObject_Gtk_Text_Tag_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
procedure On_Tag_Added
(Self : not null access Gtk_Text_Tag_Table_Record;
Call : Cb_Gtk_Text_Tag_Table_Gtk_Text_Tag_Void;
After : Boolean := False)
procedure On_Tag_Changed
(Self : not null access Gtk_Text_Tag_Table_Record;
Call : Cb_GObject_Gtk_Text_Tag_Boolean_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
Callback parameters: -- @param Tag the changed tag. -- @param Size_Changed whether the change affects the -- Gtk.Text_View.Gtk_Text_View layout.
procedure On_Tag_Changed
(Self : not null access Gtk_Text_Tag_Table_Record;
Call : Cb_Gtk_Text_Tag_Table_Gtk_Text_Tag_Boolean_Void;
After : Boolean := False)
Callback parameters: -- @param Tag the changed tag. -- @param Size_Changed whether the change affects the -- Gtk.Text_View.Gtk_Text_View layout.
procedure On_Tag_Removed
(Self : not null access Gtk_Text_Tag_Table_Record;
Call : Cb_GObject_Gtk_Text_Tag_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
procedure On_Tag_Removed
(Self : not null access Gtk_Text_Tag_Table_Record;
Call : Cb_Gtk_Text_Tag_Table_Gtk_Text_Tag_Void;
After : Boolean := False)
procedure Remove
(Table : not null access Gtk_Text_Tag_Table_Record;
Tag : not null access Gtk.Text_Tag.Gtk_Text_Tag_Record'Class)
Remove a tag from the table. If a Gtk.Text_Buffer.Gtk_Text_Buffer 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.
a Gtk.Text_Tag.Gtk_Text_Tag
Signal_Tag_Added : constant Glib.Signal_Name := "tag-added";
Signal_Tag_Changed : constant Glib.Signal_Name := "tag-changed";
Callback parameters: -- @param Tag the changed tag. -- @param Size_Changed whether the change affects the -- Gtk.Text_View.Gtk_Text_View layout.
Signal_Tag_Removed : constant Glib.Signal_Name := "tag-removed";