Gtk.TextTagTable
Gtk.TextTagTable — Collection of tags that can be used together
Object Hierarchy:
GObject
╰── Gtk.TextTagTable
Functions:
- new
() -> Gtk.TextTagTable
- add
(self, tag:Gtk.TextTag) -> bool
- remove
(self, tag:Gtk.TextTag)
- lookup
(self, name:str) -> Gtk.TextTag
- foreach
(self, func:Gtk.TextTagTableForeach, data=None)
- get_size
(self) -> int
Signals:
- “tag-added”
(texttagtable, tag, user_data)
- “tag-changed”
(texttagtable, tag, size_changed, user_data)
- “tag-removed”
(texttagtable, tag, user_data)
Description:
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.
Gtk.TextTagTable
s as GtkBuildable:
The Gtk.TextTagTable
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 Details:
new()
new () -> Gtk.TextTagTable
Creates a new Gtk.TextTagTable
. The table contains no tags bydefault.
- Returns: a new Gtk.TextTagTable
add()
add (self, tag:Gtk.TextTag) -> bool
Add a tag to the table. The tag is assigned the highest priorityin the table.
tag
must not be in a tag table already, and may not havethe same name as an already-added tag.
- Returns:
True
on success.
remove()
remove (self, tag:Gtk.TextTag)
Remove a tag from the table. If a Gtk.TextBuffer
has table
as its tag table,the tag is removed from the buffer. The table’s reference to the tag isremoved, so the tag will end up destroyed if you don’t have a reference toit.
lookup()
lookup (self, name:str) -> Gtk.TextTag
Look up a named tag.
- Returns:
The tag, or
None
if none by that name is in the table.
foreach()
foreach (self, func:Gtk.TextTagTableForeach, data=None)
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).
get_size()
get_size (self) -> int
Returns the size of the table (number of tags)
- Returns:
number of tags in
table