Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: TextBufferInsertpaintableCallback

[1823:7] extends: object

Generated low-level callback wrapper for GIR callback insert-paintable.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TextBufferInsertpaintableCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, location, paintable, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: TextBufferEnduseractionCallback

[1682:7] extends: object

Generated low-level callback wrapper for GIR callback end-user-action.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TextBufferEnduseractionCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: TextBufferInsertchildanchorCallback

[1752:7] extends: object

Generated low-level callback wrapper for GIR callback insert-child-anchor.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TextBufferInsertchildanchorCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, location, anchor, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: TextBufferBeginuseractionCallback

[1472:7] extends: object

Generated low-level callback wrapper for GIR callback begin-user-action.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TextBufferBeginuseractionCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: TextBufferRemovetagCallback

[2317:7] extends: object

Generated low-level callback wrapper for GIR callback remove-tag.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TextBufferRemovetagCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, tag, start, end, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: TextBufferMeta

[2458:14] static extends: object

Generated metadata helpers for TextBuffer class surfaces.

Methods

  • properties ()

    Returns property metadata for TextBuffer.

    • @r A list.
  • signals ()

    Returns signal metadata for TextBuffer.

    • @r A list.

class: TextBufferDeleterangeCallback

[1612:7] extends: object

Generated low-level callback wrapper for GIR callback delete-range.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TextBufferDeleterangeCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, start, end, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: TextBufferInserttextCallback

[1894:7] extends: object

Generated low-level callback wrapper for GIR callback insert-text.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TextBufferInserttextCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, location, text, len, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: TextBufferModifiedchangedCallback

[2106:7] extends: object

Generated low-level callback wrapper for GIR callback modified-changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TextBufferModifiedchangedCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: TextBufferMarksetCallback

[2035:7] extends: object

Generated low-level callback wrapper for GIR callback mark-set.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TextBufferMarksetCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, location, mark, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: TextBufferMarkdeletedCallback

[1964:7] extends: object

Generated low-level callback wrapper for GIR callback mark-deleted.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TextBufferMarkdeletedCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, mark, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: TextBufferPastedoneCallback

[2176:7] extends: object

Generated low-level callback wrapper for GIR callback paste-done.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TextBufferPastedoneCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, clipboard, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: TextBufferApplytagCallback

[1401:7] extends: object

Generated low-level callback wrapper for GIR callback apply-tag.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TextBufferApplytagCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, tag, start, end, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: TextBuffer

[18:7] extends: object

Stores text and attributes for display in a GtkTextView. 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. GtkTextBuffer can support undoing changes to the buffer content, see [method@Gtk.TextBuffer.set_enable_undo].

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • TextBuffer (table = null)

    Creates a new text buffer.

    • @p table is a tag table, or %NULL to create a new one.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object object.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnApplytag (callback Fn, UserData = null)

    Emitted to apply a tag to a range of text in a GtkTextBuffer. Applying actually occurs in the default handler. Note that if your handler runs before the default handler it must not invalidate the @start and @end iters (or has to revalidate them). See also: [method@Gtk.TextBuffer.apply_tag], [method@Gtk.TextBuffer.insert_with_tags], [method@Gtk.TextBuffer.insert_range].

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TextBuffer Self, TextTag Tag, object Start, object End).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnBeginuseraction (callback Fn, UserData = null)

    Emitted at the beginning of a single user-visible operation on a GtkTextBuffer. See also: [method@Gtk.TextBuffer.begin_user_action], [method@Gtk.TextBuffer.insert_interactive], [method@Gtk.TextBuffer.insert_range_interactive], [method@Gtk.TextBuffer.delete_interactive], [method@Gtk.TextBuffer.backspace], [method@Gtk.TextBuffer.delete_selection].

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TextBuffer Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnChanged (callback Fn, UserData = null)

    Emitted when the content of a GtkTextBuffer has changed.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TextBuffer Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnDeleterange (callback Fn, UserData = null)

    Emitted to delete a range from a GtkTextBuffer. Note that if your handler runs before the default handler it must not invalidate the @start and @end iters (or has to revalidate them). The default signal handler revalidates the @start and @end iters to both point to the location where text was deleted. Handlers which run after the default handler (see g_signal_connect_after()) do not have access to the deleted text. See also: [method@Gtk.TextBuffer.delete].

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TextBuffer Self, object Start, object End).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnEnduseraction (callback Fn, UserData = null)

    Emitted at the end of a single user-visible operation on the GtkTextBuffer. See also: [method@Gtk.TextBuffer.end_user_action], [method@Gtk.TextBuffer.insert_interactive], [method@Gtk.TextBuffer.insert_range_interactive], [method@Gtk.TextBuffer.delete_interactive], [method@Gtk.TextBuffer.backspace], [method@Gtk.TextBuffer.delete_selection], [method@Gtk.TextBuffer.backspace].

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TextBuffer Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnInsertchildanchor (callback Fn, UserData = null)

    Emitted to insert a GtkTextChildAnchor in a GtkTextBuffer. Insertion actually occurs in the default handler. Note that if your handler runs before the default handler it must not invalidate the @location iter (or has to revalidate it). The default signal handler revalidates it to be placed after the inserted @anchor. See also: [method@Gtk.TextBuffer.insert_child_anchor].

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TextBuffer Self, object Location, TextChildAnchor Anchor).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnInsertpaintable (callback Fn, UserData = null)

    Emitted to insert a GdkPaintable in a GtkTextBuffer. Insertion actually occurs in the default handler. Note that if your handler runs before the default handler it must not invalidate the @location iter (or has to revalidate it). The default signal handler revalidates it to be placed after the inserted @paintable. See also: [method@Gtk.TextBuffer.insert_paintable].

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TextBuffer Self, object Location, Paintable Paintable).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnInserttext (callback Fn, UserData = null)

    Emitted to insert text in a GtkTextBuffer. Insertion actually occurs in the default handler. Note that if your handler runs before the default handler it must not invalidate the @location iter (or has to revalidate it). The default signal handler revalidates it to point to the end of the inserted text. See also: [method@Gtk.TextBuffer.insert], [method@Gtk.TextBuffer.insert_range].

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TextBuffer Self, object Location, string Text, int Len).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnMarkdeleted (callback Fn, UserData = null)

    Emitted as notification after a GtkTextMark is deleted. See also: [method@Gtk.TextBuffer.delete_mark].

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TextBuffer Self, TextMark Mark).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnMarkset (callback Fn, UserData = null)

    Emitted as notification after a GtkTextMark is set. See also: [method@Gtk.TextBuffer.create_mark], [method@Gtk.TextBuffer.move_mark].

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TextBuffer Self, object Location, TextMark Mark).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnModifiedchanged (callback Fn, UserData = null)

    Emitted when the modified bit of a GtkTextBuffer flips. See also: [method@Gtk.TextBuffer.set_modified].

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TextBuffer Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnPastedone (callback Fn, UserData = null)

    Emitted after paste operation has been completed. This is useful to properly scroll the view to the end of the pasted text. See [method@Gtk.TextBuffer.paste_clipboard] for more details.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TextBuffer Self, Clipboard Clipboard).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnRedo (callback Fn, UserData = null)

    Emitted when a request has been made to redo the previously undone operation.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TextBuffer Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnRemovetag (callback Fn, UserData = null)

    Emitted to remove all occurrences of @tag from a range of text in a GtkTextBuffer. Removal actually occurs in the default handler. Note that if your handler runs before the default handler it must not invalidate the @start and @end iters (or has to revalidate them). See also: [method@Gtk.TextBuffer.remove_tag].

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TextBuffer Self, TextTag Tag, object Start, object End).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnUndo (callback Fn, UserData = null)

    Emitted when a request has been made to undo the previous operation or set of operations that have been grouped together.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (TextBuffer Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setEnableundo (bool Value)

    Denotes if support for undoing and redoing changes to the buffer is allowed.

    • @p Value is the new property value.
    • @r None.
  • setText (string Value)

    The text content of the buffer. Without child widgets and images, see [method@Gtk.TextBuffer.get_text] for more information.

    • @p Value is the new property value.
    • @r None.
  • add_mark (object mark, where)

    Adds the mark at position @where. The mark must not be added to another buffer, and if its name is not %NULL then there must not be another mark in the buffer with the same name. Emits the [signal@Gtk.TextBuffer::mark-set] signal as notification of the mark's initial placement.

    • @p mark is the mark to add.
    • @p where is location to place mark.
    • @r None.
  • add_selection_clipboard (object clipboard)

    Adds @clipboard to the list of clipboards in which the selection contents of @buffer are available. In most cases, @clipboard will be the GdkClipboard returned by [method@Gtk.Widget.get_primary_clipboard] for a view of @buffer.

    • @p clipboard is a GdkClipboard.
    • @r None.
  • apply_tag (object tag, start, end)

    Emits the “apply-tag” signal on @buffer. The default handler for the signal applies @tag to the given range. @start and @end do not have to be in order.

    • @p tag is a GtkTextTag.
    • @p start is one bound of range to be tagged.
    • @p end is other bound of range to be tagged.
    • @r None.
  • apply_tag_by_name (string name, start, end)

    Emits the “apply-tag” signal on @buffer. Calls [method@Gtk.TextTagTable.lookup] on the buffer’s tag table to get a GtkTextTag, then calls [method@Gtk.TextBuffer.apply_tag].

    • @p name is name of a named GtkTextTag.
    • @p start is one bound of range to be tagged.
    • @p end is other bound of range to be tagged.
    • @r None.
  • backspace (iter, bool interactive, bool default_editable)

    Performs the appropriate action as if the user hit the delete key with the cursor at the position specified by @iter. In the normal case a single character will be deleted, but when combining accents are involved, more than one character can be deleted, and when precomposed character and accent combinations are involved, less than one character will be deleted. Because the buffer is modified, all outstanding iterators become invalid after calling this function; however, the @iter will be re-initialized to point to the location where text was deleted.

    • @p iter is a position in @buffer.
    • @p interactive is whether the deletion is caused by user interaction.
    • @p default_editable is whether the buffer is editable by default.
  • begin_irreversible_action ()

    Denotes the beginning of an action that may not be undone. This will cause any previous operations in the undo/redo queue to be cleared. This should be paired with a call to [method@Gtk.TextBuffer.end_irreversible_action] after the irreversible action has completed. You may nest calls to gtk_text_buffer_begin_irreversible_action() and gtk_text_buffer_end_irreversible_action() pairs.

    • @r None.
  • begin_user_action ()

    Called to indicate that the buffer operations between here and a call to gtk_text_buffer_end_user_action() are part of a single user-visible operation. The operations between gtk_text_buffer_begin_user_action() and gtk_text_buffer_end_user_action() can then be grouped when creating an undo stack. GtkTextBuffer maintains a count of calls to gtk_text_buffer_begin_user_action() that have not been closed with a call to gtk_text_buffer_end_user_action(), and emits the “begin-user-action” and “end-user-action” signals only for the outermost pair of calls. This allows you to build user actions from other user actions. The “interactive” buffer mutation functions, such as [method@Gtk.TextBuffer.insert_interactive], automatically call begin/end user action around the buffer operations they perform, so there's no need to add extra calls if you user action consists solely of a single call to one of those functions.

    • @r None.
  • copy_clipboard (object clipboard)

    Copies the currently-selected text to a clipboard.

    • @p clipboard is the GdkClipboard object to copy to.
    • @r None.
  • create_child_anchor (iter)

    Creates and inserts a child anchor. This is a convenience function which simply creates a child anchor with [ctor@Gtk.TextChildAnchor.new] and inserts it into the buffer with [method@Gtk.TextBuffer.insert_child_anchor]. The new anchor is owned by the buffer; no reference count is returned to the caller of this function.

    • @p iter is location in the buffer.
  • create_mark (string mark_name, where, bool left_gravity)

    Creates a mark at position @where. If @mark_name is %NULL, the mark is anonymous; otherwise, the mark can be retrieved by name using [method@Gtk.TextBuffer.get_mark]. If a mark has left gravity, and text is inserted at the mark’s current location, the mark will be moved to the left of the newly-inserted text. If the mark has right gravity (@left_gravity = %FALSE), the mark will end up on the right of newly-inserted text. The standard left-to-right cursor is a mark with right gravity (when you type, the cursor stays on the right side of the text you’re typing). The caller of this function does not own a reference to the returned GtkTextMark, so you can ignore the return value if you like. Marks are owned by the buffer and go away when the buffer does. Emits the [signal@Gtk.TextBuffer::mark-set] signal as notification of the mark's initial placement.

    • @p mark_name is name for mark.
    • @p where is location to place mark.
    • @p left_gravity is whether the mark has left gravity.
  • cut_clipboard (object clipboard, bool default_editable)

    Copies the currently-selected text to a clipboard, then deletes said text if it’s editable.

    • @p clipboard is the GdkClipboard object to cut to.
    • @p default_editable is default editability of the buffer.
    • @r None.
  • delete (start, end)

    Deletes text between @start and @end. The order of @start and @end is not actually relevant; gtk_text_buffer_delete() will reorder them. This function actually emits the “delete-range” signal, and the default handler of that signal deletes the text. Because the buffer is modified, all outstanding iterators become invalid after calling this function; however, the @start and @end will be re-initialized to point to the location where text was deleted.

    • @p start is a position in @buffer.
    • @p end is another position in @buffer.
    • @r None.
  • delete_interactive (start_iter, end_iter, bool default_editable)

    Deletes all editable text in the given range. Calls [method@Gtk.TextBuffer.delete] for each editable sub-range of [@start,@end). @start and @end are revalidated to point to the location of the last deleted range, or left untouched if no text was deleted.

    • @p start_iter is start of range to delete.
    • @p end_iter is end of range.
    • @p default_editable is whether the buffer is editable by default.
  • delete_mark (object mark)

    Deletes @mark, so that it’s no longer located anywhere in the buffer. Removes the reference the buffer holds to the mark, so if you haven’t called g_object_ref() on the mark, it will be freed. Even if the mark isn’t freed, most operations on @mark become invalid, until it gets added to a buffer again with [method@Gtk.TextBuffer.add_mark]. Use [method@Gtk.TextMark.get_deleted] to find out if a mark has been removed from its buffer. The [signal@Gtk.TextBuffer::mark-deleted] signal will be emitted as notification after the mark is deleted.

    • @p mark is a GtkTextMark in @buffer.
    • @r None.
  • delete_mark_by_name (string name)

    Deletes the mark named @name; the mark must exist. See [method@Gtk.TextBuffer.delete_mark] for details.

    • @p name is name of a mark in @buffer.
    • @r None.
  • delete_selection (bool interactive, bool default_editable)

    Deletes the range between the “insert” and “selection_bound” marks, that is, the currently-selected text. If @interactive is %TRUE, the editability of the selection will be considered (users can’t delete uneditable text).

    • @p interactive is whether the deletion is caused by user interaction.
    • @p default_editable is whether the buffer is editable by default.
  • end_irreversible_action ()

    Denotes the end of an action that may not be undone. This will cause any previous operations in the undo/redo queue to be cleared. This should be called after completing modifications to the text buffer after [method@Gtk.TextBuffer.begin_irreversible_action] was called. You may nest calls to gtk_text_buffer_begin_irreversible_action() and gtk_text_buffer_end_irreversible_action() pairs.

    • @r None.
  • end_user_action ()

    Ends a user-visible operation. Should be paired with a call to [method@Gtk.TextBuffer.begin_user_action]. See that function for a full explanation.

    • @r None.
  • get_can_redo ()

    Gets whether there is a redoable action in the history.

  • get_can_undo ()

    Gets whether there is an undoable action in the history.

  • get_char_count ()

    Gets the number of characters in the buffer. Note that characters and bytes are not the same, you can’t e.g. expect the contents of the buffer in string form to be this many bytes long. The character count is cached, so this function is very fast.

  • get_enable_undo ()

    Gets whether the buffer is saving modifications to the buffer to allow for undo and redo actions. See [method@Gtk.TextBuffer.begin_irreversible_action] and [method@Gtk.TextBuffer.end_irreversible_action] to create changes to the buffer that cannot be undone.

  • get_has_selection ()

    Indicates whether the buffer has some text currently selected.

  • get_insert ()

    Returns the mark that represents the cursor (insertion point). Equivalent to calling [method@Gtk.TextBuffer.get_mark] to get the mark named “insert”, but very slightly more efficient, and involves less typing.

  • get_line_count ()

    Obtains the number of lines in the buffer. This value is cached, so the function is very fast.

  • get_mark (string name)

    Returns the mark named @name in buffer @buffer, or %NULL if no such mark exists in the buffer.

    • @p name is a mark name.
  • get_max_undo_levels ()

    Gets the maximum number of undo levels to perform. If 0, unlimited undo actions may be performed. Note that this may have a memory usage impact as it requires storing an additional copy of the inserted or removed text within the text buffer.

  • get_modified ()

    Indicates whether the buffer has been modified since the last call to [method@Gtk.TextBuffer.set_modified] set the modification flag to %FALSE. Used for example to enable a “save” function in a text editor.

  • get_selection_bound ()

    Returns the mark that represents the selection bound. Equivalent to calling [method@Gtk.TextBuffer.get_mark] to get the mark named “selection_bound”, but very slightly more efficient, and involves less typing. The currently-selected text in @buffer is the region between the “selection_bound” and “insert” marks. If “selection_bound” and “insert” are in the same place, then there is no current selection. [method@Gtk.TextBuffer.get_selection_bounds] is another convenient function for handling the selection, if you just want to know whether there’s a selection and what its bounds are.

  • get_selection_content ()

    Get a content provider for this buffer. It can be used to make the content of @buffer available in a GdkClipboard, see [method@Gdk.Clipboard.set_content].

  • get_slice (start, end, bool include_hidden_chars)

    Returns the text in the range [@start,@end). Excludes undisplayed text (text marked with tags that set the invisibility attribute) if

    • @include_hidden_chars is %FALSE. The returned string includes a 0xFFFC character whenever the buffer contains embedded images, so byte and character indexes into the returned string do correspond to byte and character indexes into the buffer. Contrast with [method@Gtk.TextBuffer.get_text]. Note that 0xFFFC can occur in normal text as well, so it is not a reliable indicator that a paintable or widget is in the buffer.
    • @p start is start of a range.
    • @p end is end of a range.
    • @p include_hidden_chars is whether to include invisible text.
  • get_tag_table ()

    Get the GtkTextTagTable associated with this buffer.

  • get_text (start, end, bool include_hidden_chars)

    Returns the text in the range [@start,@end). Excludes undisplayed text (text marked with tags that set the invisibility attribute) if

    • @include_hidden_chars is %FALSE. Does not include characters representing embedded images, so byte and character indexes into the returned string do not correspond to byte and character indexes into the buffer. Contrast with [method@Gtk.TextBuffer.get_slice].
    • @p start is start of a range.
    • @p end is end of a range.
    • @p include_hidden_chars is whether to include invisible text.
  • insert (iter, string text, int len)

    Inserts @len bytes of @text at position @iter. If @len is -1, @text must be nul-terminated and will be inserted in its entirety. Emits the “insert-text” signal; insertion actually occurs in the default handler for the signal. @iter is invalidated when insertion occurs (because the buffer contents change), but the default signal handler revalidates it to point to the end of the inserted text.

    • @p iter is a position in the buffer.
    • @p text is text in UTF-8 format.
    • @p len is length of text in bytes, or -1.
    • @r None.
  • insert_at_cursor (string text, int len)

    Inserts @text in @buffer. Simply calls [method@Gtk.TextBuffer.insert], using the current cursor position as the insertion point.

    • @p text is text in UTF-8 format.
    • @p len is length of text, in bytes.
    • @r None.
  • insert_child_anchor (iter, object anchor)

    Inserts a child widget anchor into the text buffer at @iter. The anchor will be counted as one character in character counts, and when obtaining the buffer contents as a string, will be represented by the Unicode “object replacement character” 0xFFFC. Note that the “slice” variants for obtaining portions of the buffer as a string include this character for child anchors, but the “text” variants do not. E.g. see [method@Gtk.TextBuffer.get_slice] and [method@Gtk.TextBuffer.get_text]. Consider [method@Gtk.TextBuffer.create_child_anchor] as a more convenient alternative to this function. The buffer will add a reference to the anchor, so you can unref it after insertion.

    • @p iter is location to insert the anchor.
    • @p anchor is a GtkTextChildAnchor.
    • @r None.
  • insert_interactive (iter, string text, int len, bool default_editable)

    Inserts @text in @buffer. Like [method@Gtk.TextBuffer.insert], but the insertion will not occur if @iter is at a non-editable location in the buffer. Usually you want to prevent insertions at ineditable locations if the insertion results from a user action (is interactive).

    • @default_editable indicates the editability of text that doesn't have a tag affecting editability applied to it. Typically the result of [method@Gtk.TextView.get_editable] is appropriate here.
    • @p iter is a position in @buffer.
    • @p text is some UTF-8 text.
    • @p len is length of text in bytes, or -1.
    • @p default_editable is default editability of buffer.
  • insert_interactive_at_cursor (string text, int len, bool default_editable)

    Inserts @text in @buffer. Calls [method@Gtk.TextBuffer.insert_interactive] at the cursor position.

    • @default_editable indicates the editability of text that doesn't have a tag affecting editability applied to it. Typically the result of [method@Gtk.TextView.get_editable] is appropriate here.
    • @p text is text in UTF-8 format.
    • @p len is length of text in bytes, or -1.
    • @p default_editable is default editability of buffer.
  • insert_markup (iter, string markup, int len)

    Inserts the text in @markup at position @iter. @markup will be inserted in its entirety and must be nul-terminated and valid UTF-8. Emits the [signal@Gtk.TextBuffer::insert-text] signal, possibly multiple times; insertion actually occurs in the default handler for the signal. @iter will point to the end of the inserted text on return.

    • @p iter is location to insert the markup.
    • @p markup is a nul-terminated UTF-8 string containing Pango markup.
    • @p len is length of @markup in bytes, or -1.
    • @r None.
  • insert_paintable (iter, object paintable)

    Inserts an image into the text buffer at @iter. The image will be counted as one character in character counts, and when obtaining the buffer contents as a string, will be represented by the Unicode “object replacement character” 0xFFFC. Note that the “slice” variants for obtaining portions of the buffer as a string include this character for paintable, but the “text” variants do not. e.g. see [method@Gtk.TextBuffer.get_slice] and [method@Gtk.TextBuffer.get_text].

    • @p iter is location to insert the paintable.
    • @p paintable is a GdkPaintable.
    • @r None.
  • insert_range (iter, start, end)

    Copies text, tags, and paintables between @start and @end and inserts the copy at @iter. The order of @start and @end doesn’t matter. Used instead of simply getting/inserting text because it preserves images and tags. If

    • @start and @end are in a different buffer from @buffer, the two buffers must share the same tag table. Implemented via emissions of the ::insert-text and ::apply-tag signals, so expect those.
    • @p iter is a position in @buffer.
    • @p start is a position in a GtkTextBuffer.
    • @p end is another position in the same buffer as @start.
    • @r None.
  • insert_range_interactive (iter, start, end, bool default_editable)

    Copies text, tags, and paintables between @start and @end and inserts the copy at @iter. Same as [method@Gtk.TextBuffer.insert_range], but does nothing if the insertion point isn’t editable. The @default_editable parameter indicates whether the text is editable at @iter if no tags enclosing @iter affect editability. Typically the result of [method@Gtk.TextView.get_editable] is appropriate here.

    • @p iter is a position in @buffer.
    • @p start is a position in a GtkTextBuffer.
    • @p end is another position in the same buffer as @start.
    • @p default_editable is default editability of the buffer.
  • move_mark (object mark, where)

    Moves @mark to the new location @where. Emits the [signal@Gtk.TextBuffer::mark-set] signal as notification of the move.

    • @p mark is a GtkTextMark.
    • @p where is new location for @mark in @buffer.
    • @r None.
  • move_mark_by_name (string name, where)

    Moves the mark named @name (which must exist) to location @where. See [method@Gtk.TextBuffer.move_mark] for details.

    • @p name is name of a mark.
    • @p where is new location for mark.
    • @r None.
  • paste_clipboard (object clipboard, override_location, bool default_editable)

    Pastes the contents of a clipboard. If @override_location is %NULL, the pasted text will be inserted at the cursor position, or the buffer selection will be replaced if the selection is non-empty. Note: pasting is asynchronous, that is, we’ll ask for the paste data and return, and at some point later after the main loop runs, the paste data will be inserted.

    • @p clipboard is the GdkClipboard to paste from.
    • @p override_location is location to insert pasted text.
    • @p default_editable is whether the buffer is editable by default.
    • @r None.
  • place_cursor (where)

    This function moves the “insert” and “selection_bound” marks simultaneously. If you move them to the same place in two steps with [method@Gtk.TextBuffer.move_mark], you will temporarily select a region in between their old and new locations, which can be pretty inefficient since the temporarily-selected region will force stuff to be recalculated. This function moves them as a unit, which can be optimized.

    • @p where is where to put the cursor.
    • @r None.
  • redo ()

    Redoes the next redoable action on the buffer, if there is one.

    • @r None.
  • remove_all_tags (start, end)

    Removes all tags in the range between @start and @end. Be careful with this function; it could remove tags added in code unrelated to the code you’re currently writing. That is, using this function is probably a bad idea if you have two or more unrelated code sections that add tags.

    • @p start is one bound of range to be untagged.
    • @p end is other bound of range to be untagged.
    • @r None.
  • remove_commit_notify (int commit_notify_handler)

    Removes the GtkTextBufferCommitNotify handler previously registered with [method@Gtk.TextBuffer.add_commit_notify]. This may result in the user_data_destroy being called that was passed when registering the commit notify functions.

    • @p commit_notify_handler is the notify handler identifier returned from [method@Gtk.TextBuffer.add_commit_notify]..
    • @r None.
  • remove_selection_clipboard (object clipboard)

    Removes a GdkClipboard added with [method@Gtk.TextBuffer.add_selection_clipboard]

    • @p clipboard is a GdkClipboard added to @buffer by [method@Gtk.TextBuffer.add_selection_clipboard].
    • @r None.
  • remove_tag (object tag, start, end)

    Emits the “remove-tag” signal. The default handler for the signal removes all occurrences of @tag from the given range. @start and @end don’t have to be in order.

    • @p tag is a GtkTextTag.
    • @p start is one bound of range to be untagged.
    • @p end is other bound of range to be untagged.
    • @r None.
  • remove_tag_by_name (string name, start, end)

    Emits the “remove-tag” signal. Calls [method@Gtk.TextTagTable.lookup] on the buffer’s tag table to get a GtkTextTag, then calls [method@Gtk.TextBuffer.remove_tag].

    • @p name is name of a GtkTextTag.
    • @p start is one bound of range to be untagged.
    • @p end is other bound of range to be untagged.
    • @r None.
  • select_range (ins, bound)

    This function moves the “insert” and “selection_bound” marks simultaneously. If you move them in two steps with [method@Gtk.TextBuffer.move_mark], you will temporarily select a region in between their old and new locations, which can be pretty inefficient since the temporarily-selected region will force stuff to be recalculated. This function moves them as a unit, which can be optimized.

    • @p ins is where to put the “insert” mark.
    • @p bound is where to put the “selection_bound” mark.
    • @r None.
  • set_enable_undo (bool enable_undo)

    Sets whether or not to enable undoable actions in the text buffer. Undoable actions in this context are changes to the text content of the buffer. Changes to tags and marks are not tracked. If enabled, the user will be able to undo the last number of actions up to [method@Gtk.TextBuffer.get_max_undo_levels]. See [method@Gtk.TextBuffer.begin_irreversible_action] and [method@Gtk.TextBuffer.end_irreversible_action] to create changes to the buffer that cannot be undone.

    • @p enable_undo is %TRUE to enable undo.
    • @r None.
  • set_max_undo_levels (int max_undo_levels)

    Sets the maximum number of undo levels to perform. If 0, unlimited undo actions may be performed. Note that this may have a memory usage impact as it requires storing an additional copy of the inserted or removed text within the text buffer.

    • @p max_undo_levels is the maximum number of undo actions to perform.
    • @r None.
  • set_modified (bool setting)

    Used to keep track of whether the buffer has been modified since the last time it was saved. Whenever the buffer is saved to disk, call gtk_text_buffer_set_modified (@buffer, FALSE). When the buffer is modified, it will automatically toggle on the modified bit again. When the modified bit flips, the buffer emits the [signal@Gtk.TextBuffer::modified-changed] signal.

    • @p setting is modification flag setting.
    • @r None.
  • set_text (string text, int len)

    Deletes current contents of @buffer, and inserts @text instead. This is automatically marked as an irreversible action in the undo stack. If you wish to mark this action as part of a larger undo operation, call [method@TextBuffer.delete] and [method@TextBuffer.insert] directly instead. If @len is -1, @text must be nul-terminated. @text must be valid UTF-8.

    • @p text is UTF-8 text to insert.
    • @p len is length of @text in bytes.
    • @r None.
  • undo ()

    Undoes the last undoable action on the buffer, if there is one.

    • @r None.

class: TextBufferChangedCallback

[1542:7] extends: object

Generated low-level callback wrapper for GIR callback changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TextBufferChangedCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: TextBufferRedoCallback

[2247:7] extends: object

Generated low-level callback wrapper for GIR callback redo.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TextBufferRedoCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: TextBufferUndoCallback

[2388:7] extends: object

Generated low-level callback wrapper for GIR callback undo.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • TextBufferUndoCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.