GtkTextTagTable — Collection of tags that can be used together
void | (*GtkTextTagTableForeach) () |
GtkTextTagTable * | gtk_text_tag_table_new () |
gboolean | gtk_text_tag_table_add () |
void | gtk_text_tag_table_remove () |
GtkTextTag * | gtk_text_tag_table_lookup () |
void | gtk_text_tag_table_foreach () |
int | gtk_text_tag_table_get_size () |
void | tag-added | Run Last |
void | tag-changed | Run Last |
void | tag-removed | Run Last |
GObject ╰── GtkTextTagTable
GtkTextTagTable implements GtkBuildable.
#include <gtk/gtk.h>
You may wish to begin by reading the text widget conceptual overview which gives an overview of all the objects and data types related to the text widget and how they work together.
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>
void (*GtkTextTagTableForeach) (GtkTextTag *tag
,gpointer data
);
A function used with gtk_text_tag_table_foreach()
, to iterate over every GtkTextTag inside a GtkTextTagTable.
tag | the GtkTextTag | |
data | data passed to | [closure] |
GtkTextTagTable *
gtk_text_tag_table_new (void
);
Creates a new GtkTextTagTable. The table contains no tags by default.
a new GtkTextTagTable
gboolean gtk_text_tag_table_add (GtkTextTagTable *table
,GtkTextTag *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.
table | ||
tag |
TRUE
on success.
void gtk_text_tag_table_remove (GtkTextTagTable *table
,GtkTextTag *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.
table | ||
tag |
GtkTextTag * gtk_text_tag_table_lookup (GtkTextTagTable *table
,const char *name
);
Look up a named tag.
table | ||
name | name of a tag |
The tag, or NULL
if none by that name is in the table.
[nullable][transfer none]
void gtk_text_tag_table_foreach (GtkTextTagTable *table
,GtkTextTagTableForeach func
,gpointer 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).
table | ||
func | a function to call on each tag. | [scope call] |
data | user data |
int
gtk_text_tag_table_get_size (GtkTextTagTable *table
);
Returns the size of the table (number of tags)
table |
number of tags in table
typedef struct _GtkTextTagTable GtkTextTagTable;
An object holding all the GtkTextTag instances for a GtkTextBuffer.
“tag-added”
signalvoid user_function (GtkTextTagTable *texttagtable, GtkTextTag *tag, gpointer user_data)
Emitted every time a new tag is added in the GtkTextTagTable.
texttagtable | the object which received the signal. | |
tag | the added tag. | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
“tag-changed”
signalvoid user_function (GtkTextTagTable *texttagtable, GtkTextTag *tag, gboolean size_changed, gpointer user_data)
Emitted every time a tag in the GtkTextTagTable changes.
texttagtable | the object which received the signal. | |
tag | the changed tag. | |
size_changed | whether the change affects the GtkTextView layout. | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
“tag-removed”
signalvoid user_function (GtkTextTagTable *texttagtable, GtkTextTag *tag, gpointer user_data)
Emitted every time a tag is removed from the GtkTextTagTable.
The tag
is still valid by the time the signal is emitted, but it is not associated with a tag table any more.
texttagtable | the object which received the signal. | |
tag | the removed tag. | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkTextTagTable.html