Trait gtk4::subclass::text_buffer::TextBufferImpl
source · pub trait TextBufferImpl: TextBufferImplExt + ObjectImpl {
Show 15 methods
// Provided methods
fn apply_tag(&self, tag: &TextTag, start: &TextIter, end: &TextIter) { ... }
fn begin_user_action(&self) { ... }
fn changed(&self) { ... }
fn delete_range(&self, start: &mut TextIter, end: &mut TextIter) { ... }
fn end_user_action(&self) { ... }
fn insert_child_anchor(&self, iter: &mut TextIter, anchor: &TextChildAnchor) { ... }
fn insert_paintable(&self, iter: &mut TextIter, paintable: &Paintable) { ... }
fn insert_text(&self, iter: &mut TextIter, new_text: &str) { ... }
fn mark_deleted(&self, mark: &TextMark) { ... }
fn mark_set(&self, location: &TextIter, mark: &TextMark) { ... }
fn modified_changed(&self) { ... }
fn paste_done(&self, clipboard: &Clipboard) { ... }
fn redo(&self) { ... }
fn remove_tag(&self, tag: &TextTag, start: &TextIter, end: &TextIter) { ... }
fn undo(&self) { ... }
}
Provided Methods§
sourcefn begin_user_action(&self)
fn begin_user_action(&self)
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. TextBuffer
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
TextBufferExt::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.
fn changed(&self)
fn delete_range(&self, start: &mut TextIter, end: &mut TextIter)
sourcefn end_user_action(&self)
fn end_user_action(&self)
Ends a user-visible operation.
Should be paired with a call to
TextBufferExt::begin_user_action()
.
See that function for a full explanation.
sourcefn insert_child_anchor(&self, iter: &mut TextIter, anchor: &TextChildAnchor)
fn insert_child_anchor(&self, iter: &mut TextIter, anchor: &TextChildAnchor)
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 TextBufferExt::slice()
and
TextBufferExt::text()
.
Consider TextBufferExt::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.
iter
location to insert the anchor
anchor
sourcefn insert_paintable(&self, iter: &mut TextIter, paintable: &Paintable)
fn insert_paintable(&self, iter: &mut TextIter, paintable: &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 TextBufferExt::slice()
and
TextBufferExt::text()
.
iter
location to insert the paintable