TextChildAnchor

class TextChildAnchor(**properties: Any)

Superclasses: Object

A GtkTextChildAnchor is a spot in a GtkTextBuffer where child widgets can be “anchored”.

The anchor can have multiple widgets anchored, to allow for multiple views.

Constructors

class TextChildAnchor
classmethod new() TextChildAnchor

Creates a new GtkTextChildAnchor.

Usually you would then insert it into a GtkTextBuffer with insert_child_anchor. To perform the creation and insertion in one step, use the convenience function create_child_anchor.

classmethod new_with_replacement(character: str) TextChildAnchor

Creates a new GtkTextChildAnchor with the given replacement character.

Usually you would then insert it into a GtkTextBuffer with insert_child_anchor.

Added in version 4.6.

Parameters:

character

Methods

class TextChildAnchor
get_deleted() bool

Determines whether a child anchor has been deleted from the buffer.

Keep in mind that the child anchor will be unreferenced when removed from the buffer, so you need to hold your own reference (with ref()) if you plan to use this function — otherwise all deleted child anchors will also be finalized.

get_widgets() list[Widget]

Gets a list of all widgets anchored at this child anchor.

The order in which the widgets are returned is not defined.

Fields

class TextChildAnchor
parent_instance
segment