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)

source

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

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)

source

fn mark_deleted(&self, mark: &TextMark)

source

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

source

fn modified_changed(&self)

source

fn paste_done(&self, clipboard: &Clipboard)

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.

Implementors§