1.202 <GtkTextTagTable>

Class: <GtkTextTagTable>

It derives from <GObject>.

Collects the tags in a <GtkTextBuffer>.

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 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>

Procedures

Method: text-tag-table:add? self tag ⇒ %return
Method: add? self tag ⇒ %return

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.

self

Passed: a <GtkTextTagTable>.

a <GtkTextTagTable>

tag

Passed: a <GtkTextTag>.

a <GtkTextTag>

%return

Returned: a boolean.

#t on success.

Method: text-tag-table:foreach self func
Method: foreach self func

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).

self

Passed: a <GtkTextTagTable>.

a <GtkTextTagTable>

func

Passed: a procedure.

a function to call on each tag

See GtkTextTagTableForeach for how it is called.

data

Not passed: guile-gi supplies it.

user data

Method: text-tag-table:get-size self ⇒ %return
Method: get-size self ⇒ %return

Returns the size of the table (number of tags)

self

Passed: a <GtkTextTagTable>.

a <GtkTextTagTable>

%return

Returned: a 32-bit integer.

number of tags in self

Method: text-tag-table:lookup self name ⇒ %return
Method: lookup self name ⇒ %return

Look up a named tag.

self

Passed: a <GtkTextTagTable>.

a <GtkTextTagTable>

name

Passed: a string.

name of a tag

%return

Returned: a <GtkTextTag>, or #f.

The tag

Procedure: text-tag-table:new ⇒ %return

Creates a new <GtkTextTagTable>.

The table contains no tags by default.

%return

Returned: a <GtkTextTagTable>.

a new <GtkTextTagTable>

Method: text-tag-table:remove self tag
Method: remove self tag

Remove a tag from the table.

If a <GtkTextBuffer> 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.

self

Passed: a <GtkTextTagTable>.

a <GtkTextTagTable>

tag

Passed: a <GtkTextTag>.

a <GtkTextTag>

Signals

Signal: text-tag-table:tag-added

Connect a handler with (connect object text-tag-table:tag-added handler). It is called as (handler self tag).

Emitted every time a new tag is added in the <GtkTextTagTable>.

self

Passed: a <GtkTextTagTable>.

tag

Passed: a <GtkTextTag>.

the added tag.

Signal: text-tag-table:tag-changed

Connect a handler with (connect object text-tag-table:tag-changed handler). It is called as (handler self tag size-changed).

Emitted every time a tag in the <GtkTextTagTable> changes.

self

Passed: a <GtkTextTagTable>.

tag

Passed: a <GtkTextTag>.

the changed tag.

size-changed

Passed: a boolean.

whether the change affects the <GtkTextView> layout.

Signal: text-tag-table:tag-removed

Connect a handler with (connect object text-tag-table:tag-removed handler). It is called as (handler self tag).

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.

self

Passed: a <GtkTextTagTable>.

tag

Passed: a <GtkTextTag>.

the removed tag.