Package ch.bailu.gtk.gtk
Class TextBuffer
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.TextBuffer
- All Implemented Interfaces:
PointerInterface
Stores text and attributes for display in a `GtkTextView`.
You may wish to begin by reading the
[text widget conceptual overview](section-text-widget.html),
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].
You may wish to begin by reading the
[text widget conceptual overview](section-text-widget.html),
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].
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
ConstructorDescriptionTextBuffer
(TextTagTable table) Creates a new text buffer.TextBuffer
(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the mark at position @where.void
addSelectionClipboard
(Clipboard clipboard) Adds @clipboard to the list of clipboards in which the selection
contents of @buffer are available.void
Emits the “apply-tag” signal on @buffer.void
applyTagByName
(Str name, TextIter start, TextIter end) Emits the “apply-tag” signal on @buffer.void
applyTagByName
(String name, TextIter start, TextIter end) Emits the “apply-tag” signal on @buffer.boolean
Performs the appropriate action as if the user hit the delete
key with the cursor at the position specified by @iter.void
Denotes the beginning of an action that may not be undone.void
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.void
copyClipboard
(Clipboard clipboard) Copies the currently-selected text to a clipboard.createChildAnchor
(TextIter iter) Creates and inserts a child anchor.createMark
(Str mark_name, TextIter where, boolean left_gravity) Creates a mark at position @where.createMark
(String mark_name, TextIter where, boolean left_gravity) Creates a mark at position @where.Creates a tag and adds it to the tag table for @buffer.Creates a tag and adds it to the tag table for @buffer.void
cutClipboard
(Clipboard clipboard, boolean default_editable) Copies the currently-selected text to a clipboard,
then deletes said text if it’s editable.void
Deletes text between @start and @end.boolean
deleteInteractive
(TextIter start_iter, TextIter end_iter, boolean default_editable) Deletes all editable text in the given range.void
deleteMark
(TextMark mark) Deletes @mark, so that it’s no longer located anywhere in the
buffer.void
deleteMarkByName
(Str name) Deletes the mark named @name; the mark must exist.void
deleteMarkByName
(String name) Deletes the mark named @name; the mark must exist.boolean
deleteSelection
(boolean interactive, boolean default_editable) Deletes the range between the “insert” and “selection_bound” marks,
that is, the currently-selected text.void
Denotes the end of an action that may not be undone.void
Ends a user-visible operation.void
Retrieves the first and last iterators in the buffer, i.e. the
entire buffer lies within the range [@start,@end).boolean
Gets whether there is a redoable action in the history.boolean
Gets whether there is an undoable action in the history.int
Gets the number of characters in the buffer.static ClassHandler
boolean
Gets whether the buffer is saving modifications to the buffer
to allow for undo and redo actions.void
getEndIter
(TextIter iter) Initializes @iter with the “end iterator,” one past the last valid
character in the text buffer.boolean
Indicates whether the buffer has some text currently selected.Returns the mark that represents the cursor (insertion point).static int
void
getIterAtChildAnchor
(TextIter iter, TextChildAnchor anchor) Obtains the location of @anchor within @buffer.boolean
getIterAtLine
(TextIter iter, int line_number) Initializes @iter to the start of the given line.boolean
getIterAtLineIndex
(TextIter iter, int line_number, int byte_index) Obtains an iterator pointing to @byte_index within the given line.boolean
getIterAtLineOffset
(TextIter iter, int line_number, int char_offset) Obtains an iterator pointing to @char_offset within the given line.void
getIterAtMark
(TextIter iter, TextMark mark) Initializes @iter with the current position of @mark.void
getIterAtOffset
(TextIter iter, int char_offset) Initializes @iter to a position @char_offset chars from the start
of the entire buffer.int
Obtains the number of lines in the buffer.Returns the mark named @name in buffer @buffer, or %NULL if no such
mark exists in the buffer.Returns the mark named @name in buffer @buffer, or %NULL if no such
mark exists in the buffer.int
Gets the maximum number of undo levels to perform.boolean
Indicates whether the buffer has been modified since the last call
to [method@Gtk.TextBuffer.set_modified] set the modification flag to
%FALSE.static long
static TypeSystem.TypeSize
Returns the mark that represents the selection bound.boolean
getSelectionBounds
(TextIter start, TextIter end) Returns %TRUE if some text is selected; places the bounds
of the selection in @start and @end.Get a content provider for this buffer.Returns the text in the range [@start,@end).void
getStartIter
(TextIter iter) Initialized @iter with the first position in the text buffer.Get the `GtkTextTagTable` associated with this buffer.Returns the text in the range [@start,@end).static long
static TypeSystem.TypeSize
void
Inserts @len bytes of @text at position @iter.void
Inserts @len bytes of @text at position @iter.void
insertAtCursor
(Str text, int len) Inserts @text in @buffer.void
insertAtCursor
(String text, int len) Inserts @text in @buffer.void
insertChildAnchor
(TextIter iter, TextChildAnchor anchor) Inserts a child widget anchor into the text buffer at @iter.boolean
insertInteractive
(TextIter iter, Str text, int len, boolean default_editable) Inserts @text in @buffer.boolean
insertInteractive
(TextIter iter, String text, int len, boolean default_editable) Inserts @text in @buffer.boolean
insertInteractiveAtCursor
(Str text, int len, boolean default_editable) Inserts @text in @buffer.boolean
insertInteractiveAtCursor
(String text, int len, boolean default_editable) Inserts @text in @buffer.void
insertMarkup
(TextIter iter, Str markup, int len) Inserts the text in @markup at position @iter.void
insertMarkup
(TextIter iter, String markup, int len) Inserts the text in @markup at position @iter.void
insertPaintable
(TextIter iter, Paintable paintable) Inserts an image into the text buffer at @iter.void
insertRange
(TextIter iter, TextIter start, TextIter end) Copies text, tags, and paintables between @start and @end
and inserts the copy at @iter.boolean
insertRangeInteractive
(TextIter iter, TextIter start, TextIter end, boolean default_editable) Copies text, tags, and paintables between @start and @end
and inserts the copy at @iter.void
insertWithTags
(TextIter iter, Str text, int len, TextTag first_tag, Object... _elipse) Inserts @text into @buffer at @iter, applying the list of tags to
the newly-inserted text.void
insertWithTags
(TextIter iter, String text, int len, TextTag first_tag, Object... _elipse) Inserts @text into @buffer at @iter, applying the list of tags to
the newly-inserted text.void
insertWithTagsByName
(TextIter iter, Str text, int len, Str first_tag_name, Object... _elipse) Inserts @text into @buffer at @iter, applying the list of tags to
the newly-inserted text.void
insertWithTagsByName
(TextIter iter, String text, int len, String first_tag_name, Object... _elipse) Inserts @text into @buffer at @iter, applying the list of tags to
the newly-inserted text.void
Moves @mark to the new location @where.void
moveMarkByName
(Str name, TextIter where) Moves the mark named @name (which must exist) to location @where.void
moveMarkByName
(String name, TextIter where) Moves the mark named @name (which must exist) to location @where.onApplyTag
(TextBuffer.OnApplyTag signal) Connect to signal "apply-tag".Connect to signal "begin-user-action".onChanged
(TextBuffer.OnChanged signal) Connect to signal "changed".Connect to signal "delete-range".Connect to signal "end-user-action".Connect to signal "insert-child-anchor".Connect to signal "insert-paintable".onInsertText
(TextBuffer.OnInsertText signal) Connect to signal "insert-text".Connect to signal "mark-deleted".onMarkSet
(TextBuffer.OnMarkSet signal) Connect to signal "mark-set".Connect to signal "modified-changed".onPasteDone
(TextBuffer.OnPasteDone signal) Connect to signal "paste-done".onRedo
(TextBuffer.OnRedo signal) Connect to signal "redo".onRemoveTag
(TextBuffer.OnRemoveTag signal) Connect to signal "remove-tag".onUndo
(TextBuffer.OnUndo signal) Connect to signal "undo".void
pasteClipboard
(Clipboard clipboard, TextIter override_location, boolean default_editable) Pastes the contents of a clipboard.void
placeCursor
(TextIter where) This function moves the “insert” and “selection_bound” marks
simultaneously.void
redo()
Redoes the next redoable action on the buffer, if there is one.void
removeAllTags
(TextIter start, TextIter end) Removes all tags in the range between @start and @end.void
removeSelectionClipboard
(Clipboard clipboard) Removes a `GdkClipboard` added with
gtk_text_buffer_add_selection_clipboard().void
Emits the “remove-tag” signal.void
removeTagByName
(Str name, TextIter start, TextIter end) Emits the “remove-tag” signal.void
removeTagByName
(String name, TextIter start, TextIter end) Emits the “remove-tag” signal.void
selectRange
(TextIter ins, TextIter bound) This function moves the “insert” and “selection_bound” marks
simultaneously.void
setEnableUndo
(boolean enable_undo) Sets whether or not to enable undoable actions in the text buffer.void
setMaxUndoLevels
(int max_undo_levels) Sets the maximum number of undo levels to perform.void
setModified
(boolean setting) Used to keep track of whether the buffer has been
modified since the last time it was saved.void
Deletes current contents of @buffer, and inserts @text instead.void
Deletes current contents of @buffer, and inserts @text instead.void
undo()
Undoes the last undoable action on the buffer, if there is one.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
SIGNAL_ON_APPLY_TAG
- See Also:
-
SIGNAL_ON_BEGIN_USER_ACTION
- See Also:
-
SIGNAL_ON_CHANGED
- See Also:
-
SIGNAL_ON_DELETE_RANGE
- See Also:
-
SIGNAL_ON_END_USER_ACTION
- See Also:
-
SIGNAL_ON_INSERT_CHILD_ANCHOR
- See Also:
-
SIGNAL_ON_INSERT_PAINTABLE
- See Also:
-
SIGNAL_ON_INSERT_TEXT
- See Also:
-
SIGNAL_ON_MARK_DELETED
- See Also:
-
SIGNAL_ON_MARK_SET
- See Also:
-
SIGNAL_ON_MODIFIED_CHANGED
- See Also:
-
SIGNAL_ON_PASTE_DONE
- See Also:
-
SIGNAL_ON_REDO
- See Also:
-
SIGNAL_ON_REMOVE_TAG
- See Also:
-
SIGNAL_ON_UNDO
- See Also:
-
-
Constructor Details
-
TextBuffer
-
TextBuffer
Creates a new text buffer.- Parameters:
table
- a tag table, or %NULL to create a new one
-
-
Method Details
-
getClassHandler
-
addMark
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.- Parameters:
mark
- the mark to addwhere
- location to place mark
-
addSelectionClipboard
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.- Parameters:
clipboard
- a `GdkClipboard`
-
applyTag
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.- Parameters:
tag
- a `GtkTextTag`start
- one bound of range to be taggedend
- other bound of range to be tagged
-
applyTagByName
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].- Parameters:
name
- name of a named `GtkTextTag`start
- one bound of range to be taggedend
- other bound of range to be tagged
-
applyTagByName
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].- Parameters:
name
- name of a named `GtkTextTag`start
- one bound of range to be taggedend
- other bound of range to be tagged
-
backspace
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.- Parameters:
iter
- a position in @bufferinteractive
- whether the deletion is caused by user interactiondefault_editable
- whether the buffer is editable by default- Returns:
- %TRUE if the buffer was modified
-
beginIrreversibleAction
public void beginIrreversibleAction()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. -
beginUserAction
public void beginUserAction()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. -
copyClipboard
Copies the currently-selected text to a clipboard.- Parameters:
clipboard
- the `GdkClipboard` object to copy to
-
createChildAnchor
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.- Parameters:
iter
- location in the buffer- Returns:
- the created child anchor
-
createMark
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.- Parameters:
mark_name
- name for markwhere
- location to place markleft_gravity
- whether the mark has left gravity- Returns:
- the new `GtkTextMark` object
-
createMark
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.- Parameters:
mark_name
- name for markwhere
- location to place markleft_gravity
- whether the mark has left gravity- Returns:
- the new `GtkTextMark` object
-
createTag
public TextTag createTag(@Nullable Str tag_name, @Nullable Str first_property_name, Object... _elipse) Creates a tag and adds it to the tag table for @buffer.
Equivalent to calling [ctor@Gtk.TextTag.new] and then adding the
tag to the buffer’s tag table. The returned tag is owned by
the buffer’s tag table, so the ref count will be equal to one.
If @tag_name is %NULL, the tag is anonymous.
If @tag_name is non-%NULL, a tag called @tag_name must not already
exist in the tag table for this buffer.
The @first_property_name argument and subsequent arguments are a list
of properties to set on the tag, as with g_object_set().- Parameters:
tag_name
- name of the new tagfirst_property_name
- name of first property to set_elipse
- %NULL-terminated list of property names and values- Returns:
- a new tag
-
createTag
Creates a tag and adds it to the tag table for @buffer.
Equivalent to calling [ctor@Gtk.TextTag.new] and then adding the
tag to the buffer’s tag table. The returned tag is owned by
the buffer’s tag table, so the ref count will be equal to one.
If @tag_name is %NULL, the tag is anonymous.
If @tag_name is non-%NULL, a tag called @tag_name must not already
exist in the tag table for this buffer.
The @first_property_name argument and subsequent arguments are a list
of properties to set on the tag, as with g_object_set().- Parameters:
tag_name
- name of the new tagfirst_property_name
- name of first property to set_elipse
- %NULL-terminated list of property names and values- Returns:
- a new tag
-
cutClipboard
Copies the currently-selected text to a clipboard,
then deletes said text if it’s editable.- Parameters:
clipboard
- the `GdkClipboard` object to cut todefault_editable
- default editability of the buffer
-
delete
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.- Parameters:
start
- a position in @bufferend
- another position in @buffer
-
deleteInteractive
public boolean deleteInteractive(@Nonnull TextIter start_iter, @Nonnull TextIter end_iter, boolean 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.- Parameters:
start_iter
- start of range to deleteend_iter
- end of rangedefault_editable
- whether the buffer is editable by default- Returns:
- whether some text was actually deleted
-
deleteMark
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.- Parameters:
mark
- a `GtkTextMark` in @buffer
-
deleteMarkByName
Deletes the mark named @name; the mark must exist.
See [method@Gtk.TextBuffer.delete_mark] for details.- Parameters:
name
- name of a mark in @buffer
-
deleteMarkByName
Deletes the mark named @name; the mark must exist.
See [method@Gtk.TextBuffer.delete_mark] for details.- Parameters:
name
- name of a mark in @buffer
-
deleteSelection
public boolean deleteSelection(boolean interactive, boolean 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).- Parameters:
interactive
- whether the deletion is caused by user interactiondefault_editable
- whether the buffer is editable by default- Returns:
- whether there was a non-empty selection to delete
-
endIrreversibleAction
public void endIrreversibleAction()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. -
endUserAction
public void endUserAction()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. -
getBounds
Retrieves the first and last iterators in the buffer, i.e. the
entire buffer lies within the range [@start,@end).- Parameters:
start
- iterator to initialize with first position in the bufferend
- iterator to initialize with the end iterator
-
getCanRedo
public boolean getCanRedo()Gets whether there is a redoable action in the history.- Returns:
- %TRUE if there is an redoable action
-
getCanUndo
public boolean getCanUndo()Gets whether there is an undoable action in the history.- Returns:
- %TRUE if there is an undoable action
-
getCharCount
public int getCharCount()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.- Returns:
- number of characters in the buffer
-
getEnableUndo
public boolean getEnableUndo()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.- Returns:
-
getEndIter
Initializes @iter with the “end iterator,” one past the last valid
character in the text buffer.
If dereferenced with [method@Gtk.TextIter.get_char], the end
iterator has a character value of 0.
The entire buffer lies in the range from the first position in
the buffer (call [method@Gtk.TextBuffer.get_start_iter] to get
character position 0) to the end iterator.- Parameters:
iter
- iterator to initialize
-
getHasSelection
public boolean getHasSelection()Indicates whether the buffer has some text currently selected.- Returns:
- %TRUE if the there is text selected
-
getInsert
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.- Returns:
- insertion point mark
-
getIterAtChildAnchor
Obtains the location of @anchor within @buffer.- Parameters:
iter
- an iterator to be initializedanchor
- a child anchor that appears in @buffer
-
getIterAtLine
Initializes @iter to the start of the given line.
If @line_number is greater than or equal to the number of lines
in the @buffer, the end iterator is returned.- Parameters:
iter
- iterator to initializeline_number
- line number counting from 0- Returns:
- whether the exact position has been found
-
getIterAtLineIndex
Obtains an iterator pointing to @byte_index within the given line.
@byte_index must be the start of a UTF-8 character. Note bytes, not
characters; UTF-8 may encode one character as multiple bytes.
If @line_number is greater than or equal to the number of lines in the @buffer,
the end iterator is returned. And if @byte_index is off the
end of the line, the iterator at the end of the line is returned.- Parameters:
iter
- iterator to initializeline_number
- line number counting from 0byte_index
- byte index from start of line- Returns:
- whether the exact position has been found
-
getIterAtLineOffset
Obtains an iterator pointing to @char_offset within the given line.
Note characters, not bytes; UTF-8 may encode one character as multiple
bytes.
If @line_number is greater than or equal to the number of lines in the @buffer,
the end iterator is returned. And if @char_offset is off the
end of the line, the iterator at the end of the line is returned.- Parameters:
iter
- iterator to initializeline_number
- line number counting from 0char_offset
- char offset from start of line- Returns:
- whether the exact position has been found
-
getIterAtMark
Initializes @iter with the current position of @mark.- Parameters:
iter
- iterator to initializemark
- a `GtkTextMark` in @buffer
-
getIterAtOffset
Initializes @iter to a position @char_offset chars from the start
of the entire buffer.
If @char_offset is -1 or greater than the number
of characters in the buffer, @iter is initialized to the end iterator,
the iterator one past the last valid character in the buffer.- Parameters:
iter
- iterator to initializechar_offset
- char offset from start of buffer, counting from 0, or -1
-
getLineCount
public int getLineCount()Obtains the number of lines in the buffer.
This value is cached, so the function is very fast.- Returns:
- number of lines in the buffer
-
getMark
Returns the mark named @name in buffer @buffer, or %NULL if no such
mark exists in the buffer.- Parameters:
name
- a mark name- Returns:
- a `GtkTextMark`
-
getMark
Returns the mark named @name in buffer @buffer, or %NULL if no such
mark exists in the buffer.- Parameters:
name
- a mark name- Returns:
- a `GtkTextMark`
-
getMaxUndoLevels
public int getMaxUndoLevels()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.- Returns:
-
getModified
public boolean getModified()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.- Returns:
- %TRUE if the buffer has been modified
-
getSelectionBound
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.- Returns:
- selection bound mark
-
getSelectionBounds
Returns %TRUE if some text is selected; places the bounds
of the selection in @start and @end.
If the selection has length 0, then @start and @end are filled
in with the same value. @start and @end will be in ascending order.
If @start and @end are %NULL, then they are not filled in, but the
return value still indicates whether text is selected.- Parameters:
start
- iterator to initialize with selection startend
- iterator to initialize with selection end- Returns:
- whether the selection has nonzero length
-
getSelectionContent
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].- Returns:
- a new `GdkContentProvider`.
-
getSlice
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.- Parameters:
start
- start of a rangeend
- end of a rangeinclude_hidden_chars
- whether to include invisible text- Returns:
- an allocated UTF-8 string
-
getStartIter
Initialized @iter with the first position in the text buffer.
This is the same as using [method@Gtk.TextBuffer.get_iter_at_offset]
to get the iter at character offset 0.- Parameters:
iter
- iterator to initialize
-
getTagTable
Get the `GtkTextTagTable` associated with this buffer.- Returns:
- the buffer’s tag table
-
getText
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].- Parameters:
start
- start of a rangeend
- end of a rangeinclude_hidden_chars
- whether to include invisible text- Returns:
- an allocated UTF-8 string
-
insert
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.- Parameters:
iter
- a position in the buffertext
- text in UTF-8 formatlen
- length of text in bytes, or -1
-
insert
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.- Parameters:
iter
- a position in the buffertext
- text in UTF-8 formatlen
- length of text in bytes, or -1
-
insertAtCursor
Inserts @text in @buffer.
Simply calls [method@Gtk.TextBuffer.insert],
using the current cursor position as the insertion point.- Parameters:
text
- text in UTF-8 formatlen
- length of text, in bytes
-
insertAtCursor
Inserts @text in @buffer.
Simply calls [method@Gtk.TextBuffer.insert],
using the current cursor position as the insertion point.- Parameters:
text
- text in UTF-8 formatlen
- length of text, in bytes
-
insertChildAnchor
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.- Parameters:
iter
- location to insert the anchoranchor
- a `GtkTextChildAnchor`
-
insertInteractive
public boolean insertInteractive(@Nonnull TextIter iter, @Nonnull Str text, int len, boolean 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.- Parameters:
iter
- a position in @buffertext
- some UTF-8 textlen
- length of text in bytes, or -1default_editable
- default editability of buffer- Returns:
- whether text was actually inserted
-
insertInteractive
public boolean insertInteractive(@Nonnull TextIter iter, String text, int len, boolean 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.- Parameters:
iter
- a position in @buffertext
- some UTF-8 textlen
- length of text in bytes, or -1default_editable
- default editability of buffer- Returns:
- whether text was actually inserted
-
insertInteractiveAtCursor
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.- Parameters:
text
- text in UTF-8 formatlen
- length of text in bytes, or -1default_editable
- default editability of buffer- Returns:
- whether text was actually inserted
-
insertInteractiveAtCursor
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.- Parameters:
text
- text in UTF-8 formatlen
- length of text in bytes, or -1default_editable
- default editability of buffer- Returns:
- whether text was actually inserted
-
insertMarkup
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.- Parameters:
iter
- location to insert the markupmarkup
- a nul-terminated UTF-8 string containing Pango markuplen
- length of @markup in bytes, or -1
-
insertMarkup
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.- Parameters:
iter
- location to insert the markupmarkup
- a nul-terminated UTF-8 string containing Pango markuplen
- length of @markup in bytes, or -1
-
insertPaintable
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].- Parameters:
iter
- location to insert the paintablepaintable
- a `GdkPaintable`
-
insertRange
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.- Parameters:
iter
- a position in @bufferstart
- a position in a `GtkTextBuffer`end
- another position in the same buffer as @start
-
insertRangeInteractive
public boolean insertRangeInteractive(@Nonnull TextIter iter, @Nonnull TextIter start, @Nonnull TextIter end, boolean 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.- Parameters:
iter
- a position in @bufferstart
- a position in a `GtkTextBuffer`end
- another position in the same buffer as @startdefault_editable
- default editability of the buffer- Returns:
- whether an insertion was possible at @iter
-
insertWithTags
public void insertWithTags(@Nonnull TextIter iter, @Nonnull Str text, int len, @Nonnull TextTag first_tag, Object... _elipse) Inserts @text into @buffer at @iter, applying the list of tags to
the newly-inserted text.
The last tag specified must be %NULL to terminate the list.
Equivalent to calling [method@Gtk.TextBuffer.insert],
then [method@Gtk.TextBuffer.apply_tag] on the inserted text;
this is just a convenience function.- Parameters:
iter
- an iterator in @buffertext
- UTF-8 textlen
- length of @text, or -1first_tag
- first tag to apply to @text_elipse
- %NULL-terminated list of tags to apply
-
insertWithTags
public void insertWithTags(@Nonnull TextIter iter, String text, int len, @Nonnull TextTag first_tag, Object... _elipse) Inserts @text into @buffer at @iter, applying the list of tags to
the newly-inserted text.
The last tag specified must be %NULL to terminate the list.
Equivalent to calling [method@Gtk.TextBuffer.insert],
then [method@Gtk.TextBuffer.apply_tag] on the inserted text;
this is just a convenience function.- Parameters:
iter
- an iterator in @buffertext
- UTF-8 textlen
- length of @text, or -1first_tag
- first tag to apply to @text_elipse
- %NULL-terminated list of tags to apply
-
insertWithTagsByName
public void insertWithTagsByName(@Nonnull TextIter iter, @Nonnull Str text, int len, @Nonnull Str first_tag_name, Object... _elipse) Inserts @text into @buffer at @iter, applying the list of tags to
the newly-inserted text.
Same as [method@Gtk.TextBuffer.insert_with_tags], but allows you
to pass in tag names instead of tag objects.- Parameters:
iter
- position in @buffertext
- UTF-8 textlen
- length of @text, or -1first_tag_name
- name of a tag to apply to @text_elipse
- more tag names
-
insertWithTagsByName
public void insertWithTagsByName(@Nonnull TextIter iter, String text, int len, String first_tag_name, Object... _elipse) Inserts @text into @buffer at @iter, applying the list of tags to
the newly-inserted text.
Same as [method@Gtk.TextBuffer.insert_with_tags], but allows you
to pass in tag names instead of tag objects.- Parameters:
iter
- position in @buffertext
- UTF-8 textlen
- length of @text, or -1first_tag_name
- name of a tag to apply to @text_elipse
- more tag names
-
moveMark
Moves @mark to the new location @where.
Emits the [signal@Gtk.TextBuffer::mark-set] signal
as notification of the move.- Parameters:
mark
- a `GtkTextMark`where
- new location for @mark in @buffer
-
moveMarkByName
Moves the mark named @name (which must exist) to location @where.
See [method@Gtk.TextBuffer.move_mark] for details.- Parameters:
name
- name of a markwhere
- new location for mark
-
moveMarkByName
Moves the mark named @name (which must exist) to location @where.
See [method@Gtk.TextBuffer.move_mark] for details.- Parameters:
name
- name of a markwhere
- new location for mark
-
pasteClipboard
public void pasteClipboard(@Nonnull Clipboard clipboard, @Nullable TextIter override_location, boolean 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.- Parameters:
clipboard
- the `GdkClipboard` to paste fromoverride_location
- location to insert pasted textdefault_editable
- whether the buffer is editable by default
-
placeCursor
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.- Parameters:
where
- where to put the cursor
-
redo
public void redo()Redoes the next redoable action on the buffer, if there is one. -
removeAllTags
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.- Parameters:
start
- one bound of range to be untaggedend
- other bound of range to be untagged
-
removeSelectionClipboard
Removes a `GdkClipboard` added with
gtk_text_buffer_add_selection_clipboard().- Parameters:
clipboard
- a `GdkClipboard` added to @buffer by [method@Gtk.TextBuffer.add_selection_clipboard]
-
removeTag
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.- Parameters:
tag
- a `GtkTextTag`start
- one bound of range to be untaggedend
- other bound of range to be untagged
-
removeTagByName
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].- Parameters:
name
- name of a `GtkTextTag`start
- one bound of range to be untaggedend
- other bound of range to be untagged
-
removeTagByName
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].- Parameters:
name
- name of a `GtkTextTag`start
- one bound of range to be untaggedend
- other bound of range to be untagged
-
selectRange
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.- Parameters:
ins
- where to put the “insert” markbound
- where to put the “selection_bound” mark
-
setEnableUndo
public void setEnableUndo(boolean 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.- Parameters:
enable_undo
- %TRUE to enable undo
-
setMaxUndoLevels
public void setMaxUndoLevels(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.- Parameters:
max_undo_levels
- the maximum number of undo actions to perform
-
setModified
public void setModified(boolean 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
toggled on the modified bit again. When the modified
bit flips, the buffer emits the
[signal@Gtk.TextBuffer::modified-changed] signal.- Parameters:
setting
- modification flag setting
-
setText
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.- Parameters:
text
- UTF-8 text to insertlen
- length of @text in bytes
-
setText
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.- Parameters:
text
- UTF-8 text to insertlen
- length of @text in bytes
-
undo
public void undo()Undoes the last undoable action on the buffer, if there is one. -
onApplyTag
Connect to signal "apply-tag".
SeeTextBuffer.OnApplyTag.onApplyTag(ch.bailu.gtk.gtk.TextTag, ch.bailu.gtk.gtk.TextIter, ch.bailu.gtk.gtk.TextIter)
for signal description.
FieldSIGNAL_ON_APPLY_TAG
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onBeginUserAction
Connect to signal "begin-user-action".
SeeTextBuffer.OnBeginUserAction.onBeginUserAction()
for signal description.
FieldSIGNAL_ON_BEGIN_USER_ACTION
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onChanged
Connect to signal "changed".
SeeTextBuffer.OnChanged.onChanged()
for signal description.
FieldSIGNAL_ON_CHANGED
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onDeleteRange
Connect to signal "delete-range".
SeeTextBuffer.OnDeleteRange.onDeleteRange(ch.bailu.gtk.gtk.TextIter, ch.bailu.gtk.gtk.TextIter)
for signal description.
FieldSIGNAL_ON_DELETE_RANGE
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onEndUserAction
Connect to signal "end-user-action".
SeeTextBuffer.OnEndUserAction.onEndUserAction()
for signal description.
FieldSIGNAL_ON_END_USER_ACTION
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onInsertChildAnchor
Connect to signal "insert-child-anchor".
SeeTextBuffer.OnInsertChildAnchor.onInsertChildAnchor(ch.bailu.gtk.gtk.TextIter, ch.bailu.gtk.gtk.TextChildAnchor)
for signal description.
FieldSIGNAL_ON_INSERT_CHILD_ANCHOR
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onInsertPaintable
Connect to signal "insert-paintable".
SeeTextBuffer.OnInsertPaintable.onInsertPaintable(ch.bailu.gtk.gtk.TextIter, ch.bailu.gtk.gdk.Paintable)
for signal description.
FieldSIGNAL_ON_INSERT_PAINTABLE
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onInsertText
Connect to signal "insert-text".
SeeTextBuffer.OnInsertText.onInsertText(ch.bailu.gtk.gtk.TextIter, ch.bailu.gtk.type.Str, int)
for signal description.
FieldSIGNAL_ON_INSERT_TEXT
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onMarkDeleted
Connect to signal "mark-deleted".
SeeTextBuffer.OnMarkDeleted.onMarkDeleted(ch.bailu.gtk.gtk.TextMark)
for signal description.
FieldSIGNAL_ON_MARK_DELETED
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onMarkSet
Connect to signal "mark-set".
SeeTextBuffer.OnMarkSet.onMarkSet(ch.bailu.gtk.gtk.TextIter, ch.bailu.gtk.gtk.TextMark)
for signal description.
FieldSIGNAL_ON_MARK_SET
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onModifiedChanged
Connect to signal "modified-changed".
SeeTextBuffer.OnModifiedChanged.onModifiedChanged()
for signal description.
FieldSIGNAL_ON_MODIFIED_CHANGED
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onPasteDone
Connect to signal "paste-done".
SeeTextBuffer.OnPasteDone.onPasteDone(ch.bailu.gtk.gdk.Clipboard)
for signal description.
FieldSIGNAL_ON_PASTE_DONE
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onRedo
Connect to signal "redo".
SeeTextBuffer.OnRedo.onRedo()
for signal description.
FieldSIGNAL_ON_REDO
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onRemoveTag
Connect to signal "remove-tag".
SeeTextBuffer.OnRemoveTag.onRemoveTag(ch.bailu.gtk.gtk.TextTag, ch.bailu.gtk.gtk.TextIter, ch.bailu.gtk.gtk.TextIter)
for signal description.
FieldSIGNAL_ON_REMOVE_TAG
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onUndo
Connect to signal "undo".
SeeTextBuffer.OnUndo.onUndo()
for signal description.
FieldSIGNAL_ON_UNDO
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-