Class TextChildAnchor

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class TextChildAnchor extends GObject

Marks a spot in a GtkTextBuffer where child widgets can be “anchored”.

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

  • Constructor Details

    • TextChildAnchor

      public TextChildAnchor(MemorySegment address)
      Create a TextChildAnchor instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • TextChildAnchor

      public TextChildAnchor()
      Create a new TextChildAnchor.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the TextChildAnchor class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected TextChildAnchor asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • withReplacement

      public static TextChildAnchor withReplacement(String character)

      Creates a new GtkTextChildAnchor with the given replacement character.

      Usually you would then insert it into a GtkTextBuffer with TextBuffer.insertChildAnchor(TextIter, TextChildAnchor).

      Parameters:
      character - a replacement character
      Returns:
      a new GtkTextChildAnchor
      Since:
      4.6
    • getDeleted

      public boolean getDeleted()

      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 g_object_ref()) if you plan to use this function — otherwise all deleted child anchors will also be finalized.

      Returns:
      true if the child anchor has been deleted from its buffer
    • getWidgets

      public Widget[] getWidgets()

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

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

      Returns:
      an array of widgets anchored at this TextChildAnchor
    • builder

      public static TextChildAnchor.Builder<? extends TextChildAnchor.Builder> builder()
      A TextChildAnchor.Builder object constructs a TextChildAnchor with the specified properties. Use the various set...() methods to set properties, and finish construction with TextChildAnchor.Builder.build().
      Returns:
      the builder object