Gtk.TextTag


Gtk.TextTag — A tag that can be applied to text in a Gtk.TextBuffer

Object Hierarchy:

    GObject
    ╰── Gtk.TextTag

Functions:

  • new (name:str=None) -> Gtk.TextTag
  • get_priority (self) -> int
  • set_priority (self, priority:int)
  • event (self, event_object:GObject.Object, event:Gdk.Event, iter:Gtk.TextIter) -> bool

Signals:

  • “event” (tag, object, event, iter, 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.

Tags should be in the Gtk.TextTagTable for a given GtkTextBuffer before using them with that buffer.

Gtk.TextBuffer::create_tag() is the best way to create tags.

See gtk3-demo for numerous examples.

For each property of Gtk.TextTag, there is a set property, e.g.

font-set corresponds to font. These set properties reflect whether a property has been set or not.

They are maintained by GTK+ and you should not set them independently.


Function Details:

new()

new (name:str=None) -> Gtk.TextTag

Creates a Gtk.TextTag. Configure the tag using object arguments,i.e. using g_object_set().

  • Returns: a new Gtk.TextTag

get_priority()

get_priority (self) -> int

Get the tag priority.

  • Returns: The tag’s priority.

set_priority()

set_priority (self, priority:int)

Sets the priority of a Gtk.TextTag. Valid prioritiesstart at 0 and go to one less than Gtk.TextTag:table_get_size().Each tag in a table has a unique priority; setting the priorityof one tag shifts the priorities of all the other tags in thetable to maintain a unique priority for each tag. Higher prioritytags “win” if two tags both set the same text attribute. When addinga tag to a tag table, it will be assigned the highest priority inthe table by default; so normally the precedence of a set of tagsis the order in which they were added to the table, or created with`Gtk.TextBuffer:create_tag()`, which adds the tag to the buffer’s tableautomatically.


event()

event (self, event_object:GObject.Object, event:Gdk.Event, iter:Gtk.TextIter) -> bool

Emits the “event” signal on the Gtk.TextTag.

  • Returns: result of signal emission (whether the event was handled)

results matching ""

    No results matching ""