GTK+ 3 Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Signals |
#include <gtk/gtk.h> GtkTextTagTable; void (*GtkTextTagTableForeach) (GtkTextTag *tag
,gpointer data
); GtkTextTagTable * gtk_text_tag_table_new (void
); void gtk_text_tag_table_add (GtkTextTagTable *table
,GtkTextTag *tag
); void gtk_text_tag_table_remove (GtkTextTagTable *table
,GtkTextTag *tag
); GtkTextTag * gtk_text_tag_table_lookup (GtkTextTagTable *table
,const gchar *name
); void gtk_text_tag_table_foreach (GtkTextTagTable *table
,GtkTextTagTableForeach func
,gpointer data
); gint gtk_text_tag_table_get_size (GtkTextTagTable *table
);
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.
Example 59. A UI definition fragment specifying tags
1 2 3 4 5 |
<object class="GtkTextTagTable"> <child type="tag"> <object class="GtkTextTag"/> </child> </object> |
GtkTextTagTable * gtk_text_tag_table_new (void
);
Creates a new GtkTextTagTable. The table contains no tags by default.
Returns : |
a new GtkTextTagTable |
void 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.
|
a GtkTextTagTable |
|
a GtkTextTag |
void gtk_text_tag_table_remove (GtkTextTagTable *table
,GtkTextTag *tag
);
Remove a tag from the table. This will remove the table's reference to the tag, so be careful - the tag will end up destroyed if you don't have a reference to it.
|
a GtkTextTagTable |
|
a GtkTextTag |
GtkTextTag * gtk_text_tag_table_lookup (GtkTextTagTable *table
,const gchar *name
);
Look up a named tag.
|
a GtkTextTagTable |
|
name of a tag |
Returns : |
The tag, or NULL if none by that name is in the table. [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).
|
a GtkTextTagTable |
|
a function to call on each tag. [scope call] |
|
user data |
gint gtk_text_tag_table_get_size (GtkTextTagTable *table
);
Returns the size of the table (number of tags)
|
a GtkTextTagTable |
Returns : |
number of tags in table
|
"tag-added"
signalvoid user_function (GtkTextTagTable *texttagtable,
GtkTextTag *tag,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
the added tag. |
|
user data set when the signal handler was connected. |
"tag-changed"
signalvoid user_function (GtkTextTagTable *texttagtable,
GtkTextTag *tag,
gboolean size_changed,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
the changed tag. |
|
whether the size has been changed. |
|
user data set when the signal handler was connected. |
"tag-removed"
signalvoid user_function (GtkTextTagTable *texttagtable,
GtkTextTag *tag,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
the removed tag. |
|
user data set when the signal handler was connected. |