Gtk.TextTagTable

g GObject.GInterface GObject.GInterface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.Object GObject.Object Gtk.TextTagTable Gtk.TextTagTable GObject.Object->Gtk.TextTagTable Gtk.Buildable->Gtk.TextTagTable

Subclasses:None

Methods

Inherited:GObject.Object (37), Gtk.Buildable (10)
Structs:GObject.ObjectClass (5)
class new ()
  add (tag)
  foreach (func, *data)
  get_size ()
  lookup (name)
  remove (tag)

Virtual Methods

Inherited:GObject.Object (7), Gtk.Buildable (10)
  do_tag_added (tag)
  do_tag_changed (tag, size_changed)
  do_tag_removed (tag)

Properties

None

Signals

Inherited:GObject.Object (1)
Name Short Description
tag-added  
tag-changed  
tag-removed  

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent_instance GObject.Object r  

Class Details

class Gtk.TextTagTable(**kwargs)
Bases:GObject.Object, Gtk.Buildable
Abstract:No
Structure:Gtk.TextTagTableClass

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.

GtkTextTagTables as Gtk.Buildable

The Gtk.TextTagTable implementation of the Gtk.Buildable 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>
classmethod new()[source]
Returns:a new Gtk.TextTagTable
Return type:Gtk.TextTagTable

Creates a new Gtk.TextTagTable. The table contains no tags by default.

add(tag)[source]
Parameters:tag (Gtk.TextTag) – a Gtk.TextTag
Returns:True on success.
Return type:bool

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.

foreach(func, *data)[source]
Parameters:

Calls func on each tag in self, with user data data. Note that the table may not be modified while iterating over it (you can’t add/remove tags).

get_size()[source]
Returns:number of tags in self
Return type:int

Returns the size of the table (number of tags)

lookup(name)[source]
Parameters:name (str) – name of a tag
Returns:The tag, or None if none by that name is in the table.
Return type:Gtk.TextTag or None

Look up a named tag.

remove(tag)[source]
Parameters:tag (Gtk.TextTag) – a Gtk.TextTag

Remove a tag from the table. If a Gtk.TextBuffer has self 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.

do_tag_added(tag) virtual
Parameters:tag (Gtk.TextTag) –
do_tag_changed(tag, size_changed) virtual
Parameters:
do_tag_removed(tag) virtual
Parameters:tag (Gtk.TextTag) –

Signal Details

Gtk.TextTagTable.signals.tag_added(text_tag_table, tag)
Signal Name:

tag-added

Flags:

RUN_LAST

Parameters:
Gtk.TextTagTable.signals.tag_changed(text_tag_table, tag, size_changed)
Signal Name:

tag-changed

Flags:

RUN_LAST

Parameters:
Gtk.TextTagTable.signals.tag_removed(text_tag_table, tag)
Signal Name:

tag-removed

Flags:

RUN_LAST

Parameters: