:right-sidebar: True TextChildAnchor =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: TextChildAnchor(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.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 ------------ .. rst-class:: interim-class .. class:: TextChildAnchor :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.TextChildAnchor Creates a new ``GtkTextChildAnchor``. Usually you would then insert it into a ``GtkTextBuffer`` with :obj:`~gi.repository.Gtk.TextBuffer.insert_child_anchor`. To perform the creation and insertion in one step, use the convenience function :obj:`~gi.repository.Gtk.TextBuffer.create_child_anchor`. .. classmethod:: new_with_replacement(character: str) -> ~gi.repository.Gtk.TextChildAnchor Creates a new ``GtkTextChildAnchor`` with the given replacement character. Usually you would then insert it into a ``GtkTextBuffer`` with :obj:`~gi.repository.Gtk.TextBuffer.insert_child_anchor`. .. versionadded:: 4.6 :param character: Methods ------- .. rst-class:: interim-class .. class:: TextChildAnchor :no-index: .. method:: 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 :func:`~gi.repository.GObject.GObject.Object.ref`) if you plan to use this function — otherwise all deleted child anchors will also be finalized. .. method:: get_widgets() -> list[~gi.repository.Gtk.Widget] Gets a list of all widgets anchored at this child anchor. The order in which the widgets are returned is not defined. Fields ------ .. rst-class:: interim-class .. class:: TextChildAnchor :no-index: .. attribute:: parent_instance .. attribute:: segment