gtk4::subclass::text_buffer

Trait 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§

Source

fn apply_tag(&self, tag: &TextTag, start: &TextIter, end: &TextIter)

Emits the “apply-tag” signal on @self.

The default handler for the signal applies @tag to the given range. @start and @end do not have to be in order.

§tag

a TextTag

§start

one bound of range to be tagged

§end

other bound of range to be tagged

Source

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.

Source

fn changed(&self)

The class handler for the GtkTextBuffer::changed signal.

Source

fn delete_range(&self, start: &mut TextIter, end: &mut TextIter)

The class handler for the GtkTextBuffer::delete-range signal.

Source

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.

Source

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

a TextChildAnchor

Source

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

§paintable

a gdk::Paintable

Source

fn insert_text(&self, iter: &mut TextIter, new_text: &str)

The class handler for the GtkTextBuffer::insert-text signal.

Source

fn mark_deleted(&self, mark: &TextMark)

The class handler for the GtkTextBuffer::mark-deleted signal.

Source

fn mark_set(&self, location: &TextIter, mark: &TextMark)

The class handler for the GtkTextBuffer::mark-set signal.

Source

fn modified_changed(&self)

The class handler for the GtkTextBuffer::modified-changed signal.

Source

fn paste_done(&self, clipboard: &Clipboard)

The class handler for the GtkTextBuffer::paste-done signal.

Source

fn redo(&self)

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

Source

fn remove_tag(&self, tag: &TextTag, start: &TextIter, end: &TextIter)

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.

§tag

a TextTag

§start

one bound of range to be untagged

§end

other bound of range to be untagged

Source

fn undo(&self)

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§