Struct gtk4::TextBuffer

source ·
pub struct TextBuffer { /* private fields */ }
Expand description

Stores text and attributes for display in a TextView.

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 TextBufferExt::set_enable_undo().

§Properties

§can-redo

Denotes that the buffer can reapply the last undone action.

Readable

§can-undo

Denotes that the buffer can undo the last applied action.

Readable

§cursor-position

The position of the insert mark.

This is an offset from the beginning of the buffer. It is useful for getting notified when the cursor moves.

Readable

§enable-undo

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

Readable | Writeable

§has-selection

Whether the buffer has some text currently selected.

Readable

§tag-table

The GtkTextTagTable for the buffer.

Readable | Writeable | Construct Only

§text

The text content of the buffer.

Without child widgets and images, see TextBufferExt::text() for more information.

Readable | Writeable

§Signals

§apply-tag

Emitted to apply a tag to a range of text in a TextBuffer.

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: TextBufferExt::apply_tag(), TextBufferExtManual::insert_with_tags(), TextBufferExt::insert_range().

§begin-user-action

Emitted at the beginning of a single user-visible operation on a TextBuffer.

See also: TextBufferExt::begin_user_action(), TextBufferExt::insert_interactive(), TextBufferExt::insert_range_interactive(), TextBufferExt::delete_interactive(), TextBufferExt::backspace(), TextBufferExt::delete_selection().

§changed

Emitted when the content of a TextBuffer has changed.

§delete-range

Emitted to delete a range from a TextBuffer.

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: TextBufferExt::delete().

§end-user-action

Emitted at the end of a single user-visible operation on the TextBuffer.

See also: TextBufferExt::end_user_action(), TextBufferExt::insert_interactive(), TextBufferExt::insert_range_interactive(), TextBufferExt::delete_interactive(), TextBufferExt::backspace(), TextBufferExt::delete_selection(), TextBufferExt::backspace().

§insert-child-anchor

Emitted to insert a TextChildAnchor in a TextBuffer.

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: TextBufferExt::insert_child_anchor().

§insert-paintable

Emitted to insert a gdk::Paintable in a TextBuffer.

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: TextBufferExt::insert_paintable().

§insert-text

Emitted to insert text in a TextBuffer.

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: TextBufferExt::insert(), TextBufferExt::insert_range().

§mark-deleted

Emitted as notification after a TextMark is deleted.

See also: TextBufferExt::delete_mark().

§mark-set

Emitted as notification after a TextMark is set.

See also: TextBufferExt::create_mark(), TextBufferExt::move_mark().

§modified-changed

Emitted when the modified bit of a TextBuffer flips.

See also: TextBufferExt::set_modified().

§paste-done

Emitted after paste operation has been completed.

This is useful to properly scroll the view to the end of the pasted text. See TextBufferExt::paste_clipboard() for more details.

§redo

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

§remove-tag

Emitted to remove all occurrences of @tag from a range of text in a TextBuffer.

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: TextBufferExt::remove_tag().

§undo

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

§Implements

TextBufferExt, [trait@glib::ObjectExt], TextBufferExtManual

Implementations§

source§

impl TextBuffer

source

pub const NONE: Option<&'static TextBuffer> = None

source

pub fn new(table: Option<&TextTagTable>) -> TextBuffer

Creates a new text buffer.

§table

a tag table, or None to create a new one

§Returns

a new text buffer

source

pub fn builder() -> TextBufferBuilder

Creates a new builder-pattern struct instance to construct TextBuffer objects.

This method returns an instance of TextBufferBuilder which can be used to create TextBuffer objects.

Trait Implementations§

source§

impl Clone for TextBuffer

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TextBuffer

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for TextBuffer

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl HasParamSpec for TextBuffer

§

type ParamSpec = ParamSpecObject

§

type SetValue = TextBuffer

Preferred value to be used as setter for the associated ParamSpec.
§

type BuilderFn = fn(_: &str) -> ParamSpecObjectBuilder<'_, TextBuffer>

source§

fn param_spec_builder() -> Self::BuilderFn

source§

impl Hash for TextBuffer

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T: TextBufferImpl> IsSubclassable<T> for TextBuffer

source§

fn class_init(class: &mut Class<Self>)

Override the virtual methods of this class for the given subclass and do other class initialization. Read more
source§

fn instance_init(instance: &mut InitializingObject<T>)

Instance specific initialization. Read more
source§

impl Ord for TextBuffer

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl ParentClassIs for TextBuffer

source§

impl<OT: ObjectType> PartialEq<OT> for TextBuffer

source§

fn eq(&self, other: &OT) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<OT: ObjectType> PartialOrd<OT> for TextBuffer

source§

fn partial_cmp(&self, other: &OT) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl StaticType for TextBuffer

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl Write for TextBuffer

source§

fn write_str(&mut self, s: &str) -> Result

Writes a string slice into this writer, returning whether the write succeeded. Read more
1.1.0 · source§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a char into this writer, returning whether the write succeeded. Read more
1.0.0 · source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the write! macro with implementors of this trait. Read more
source§

impl Eq for TextBuffer

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Cast for T
where T: ObjectType,

source§

fn upcast<T>(self) -> T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a superclass or interface T. Read more
source§

fn upcast_ref<T>(&self) -> &T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a reference of its superclass or interface T. Read more
source§

fn downcast<T>(self) -> Result<T, Self>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a subclass or interface implementor T. Read more
source§

fn downcast_ref<T>(&self) -> Option<&T>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a reference of its subclass or interface implementor T. Read more
source§

fn dynamic_cast<T>(self) -> Result<T, Self>
where T: ObjectType,

Tries to cast to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while upcast will do many checks at compile-time already. downcast will perform the same checks at runtime as dynamic_cast, but will also ensure some amount of compile-time safety. Read more
source§

fn dynamic_cast_ref<T>(&self) -> Option<&T>
where T: ObjectType,

Tries to cast to reference to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more
source§

unsafe fn unsafe_cast<T>(self) -> T
where T: ObjectType,

Casts to T unconditionally. Read more
source§

unsafe fn unsafe_cast_ref<T>(&self) -> &T
where T: ObjectType,

Casts to &T unconditionally. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( _: *const GPtrArray, _: usize ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GPtrArray, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GPtrArray, num: usize ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>

source§

impl<O> GObjectPropertyExpressionExt for O
where O: IsA<Object>,

source§

fn property_expression(&self, property_name: &str) -> PropertyExpression

Create an expression looking up an object’s property.
source§

fn property_expression_weak(&self, property_name: &str) -> PropertyExpression

Create an expression looking up an object’s property with a weak reference.
source§

fn this_expression(property_name: &str) -> PropertyExpression

Create an expression looking up a property in the bound this object.
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoClosureReturnValue for T
where T: Into<Value>,

source§

impl<U> IsSubclassableExt for U

source§

impl<T> ObjectExt for T
where T: ObjectType,

source§

fn is<U>(&self) -> bool
where U: StaticType,

Returns true if the object is an instance of (can be cast to) T.
source§

fn type_(&self) -> Type

Returns the type of the object.
source§

fn object_class(&self) -> &Class<Object>

Returns the ObjectClass of the object. Read more
source§

fn class(&self) -> &Class<T>
where T: IsClass,

Returns the class of the object.
source§

fn class_of<U>(&self) -> Option<&Class<U>>
where U: IsClass,

Returns the class of the object in the given type T. Read more
source§

fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>
where U: IsInterface,

Returns the interface T of the object. Read more
source§

fn set_property(&self, property_name: &str, value: impl Into<Value>)

Sets the property property_name of the object to value value. Read more
source§

fn set_property_from_value(&self, property_name: &str, value: &Value)

Sets the property property_name of the object to value value. Read more
source§

fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])

Sets multiple properties of the object at once. Read more
source§

fn set_properties_from_value(&self, property_values: &[(&str, Value)])

Sets multiple properties of the object at once. Read more
source§

fn property<V>(&self, property_name: &str) -> V
where V: for<'b> FromValue<'b> + 'static,

Gets the property property_name of the object and cast it to the type V. Read more
source§

fn property_value(&self, property_name: &str) -> Value

Gets the property property_name of the object. Read more
source§

fn has_property(&self, property_name: &str, type_: Option<Type>) -> bool

Check if the object has a property property_name of the given type_. Read more
source§

fn property_type(&self, property_name: &str) -> Option<Type>

Get the type of the property property_name of this object. Read more
source§

fn find_property(&self, property_name: &str) -> Option<ParamSpec>

Get the ParamSpec of the property property_name of this object.
source§

fn list_properties(&self) -> PtrSlice<ParamSpec>

Return all ParamSpec of the properties of this object.
source§

fn freeze_notify(&self) -> PropertyNotificationFreezeGuard

Freeze all property notifications until the return guard object is dropped. Read more
source§

unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
source§

unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn set_data<QD>(&self, key: &str, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
source§

unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
source§

unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
source§

fn block_signal(&self, handler_id: &SignalHandlerId)

Block a given signal handler. Read more
source§

fn unblock_signal(&self, handler_id: &SignalHandlerId)

Unblock a given signal handler.
source§

fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)

Stop emission of the currently emitted signal.
source§

fn stop_signal_emission_by_name(&self, signal_name: &str)

Stop emission of the currently emitted signal by the (possibly detailed) signal name.
source§

fn connect<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_name on this object. Read more
source§

fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_id on this object. Read more
source§

fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_name on this object. Read more
source§

fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_id on this object. Read more
source§

unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_name on this object. Read more
source§

unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_id on this object. Read more
source§

fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure ) -> SignalHandlerId

Connect a closure to the signal signal_name on this object. Read more
source§

fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure ) -> SignalHandlerId

Connect a closure to the signal signal_id on this object. Read more
source§

fn watch_closure(&self, closure: &impl AsRef<Closure>)

Limits the lifetime of closure to the lifetime of the object. When the object’s reference count drops to zero, the closure will be invalidated. An invalidated closure will ignore any calls to invoke_with_values, or invoke when using Rust closures.
source§

fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> R

Emit signal by signal id. Read more
source§

fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>

Same as Self::emit but takes Value for the arguments.
source§

fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> R

Emit signal by its name. Read more
source§

fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value] ) -> Option<Value>

Emit signal by its name. Read more
source§

fn emit_by_name_with_details<R>( &self, signal_name: &str, details: Quark, args: &[&dyn ToValue] ) -> R

Emit signal by its name with details. Read more
source§

fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value] ) -> Option<Value>

Emit signal by its name with details. Read more
source§

fn emit_with_details<R>( &self, signal_id: SignalId, details: Quark, args: &[&dyn ToValue] ) -> R

Emit signal by signal id with details. Read more
source§

fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value] ) -> Option<Value>

Emit signal by signal id with details. Read more
source§

fn disconnect(&self, handler_id: SignalHandlerId)

Disconnect a previously connected signal handler.
source§

fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + Send + Sync + 'static,

Connect to the notify signal of the object. Read more
source§

fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + 'static,

Connect to the notify signal of the object. Read more
source§

unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F ) -> SignalHandlerId
where F: Fn(&T, &ParamSpec),

Connect to the notify signal of the object. Read more
source§

fn notify(&self, property_name: &str)

Notify that the given property has changed its value. Read more
source§

fn notify_by_pspec(&self, pspec: &ParamSpec)

Notify that the given property has changed its value. Read more
source§

fn downgrade(&self) -> WeakRef<T>

Downgrade this object to a weak reference.
source§

fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + Send + 'static,

Add a callback to be notified when the Object is disposed.
source§

fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + 'static,

Add a callback to be notified when the Object is disposed. Read more
source§

fn bind_property<'a, 'f, 't, O>( &'a self, source_property: &'a str, target: &'a O, target_property: &'a str ) -> BindingBuilder<'a, 'f, 't>
where O: ObjectType,

Bind property source_property on this object to the target_property on the target object. Read more
source§

fn ref_count(&self) -> u32

Returns the strong reference count of this object.
source§

unsafe fn run_dispose(&self)

Runs the dispose mechanism of the object. Read more
source§

impl<T> Property for T
where T: HasParamSpec,

§

type Value = T

source§

impl<T> PropertyGet for T
where T: HasParamSpec,

§

type Value = T

source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

source§

impl<T> StaticTypeExt for T
where T: StaticType,

source§

fn ensure_type()

Ensures that the type has been registered with the type system.
source§

impl<O> TextBufferExt for O
where O: IsA<TextBuffer>,

source§

fn add_mark(&self, mark: &impl IsA<TextMark>, where_: &TextIter)

Adds the mark at position @where_. Read more
source§

fn add_selection_clipboard(&self, clipboard: &Clipboard)

Adds @clipboard to the list of clipboards in which the selection contents of @self are available. Read more
source§

fn apply_tag(&self, tag: &impl IsA<TextTag>, start: &TextIter, end: &TextIter)

Emits the “apply-tag” signal on @self. Read more
source§

fn apply_tag_by_name(&self, name: &str, start: &TextIter, end: &TextIter)

Emits the “apply-tag” signal on @self. Read more
source§

fn backspace( &self, iter: &mut TextIter, interactive: bool, default_editable: bool ) -> bool

Performs the appropriate action as if the user hit the delete key with the cursor at the position specified by @iter. Read more
source§

fn begin_irreversible_action(&self)

Denotes the beginning of an action that may not be undone. Read more
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. Read more
source§

fn copy_clipboard(&self, clipboard: &Clipboard)

Copies the currently-selected text to a clipboard. Read more
source§

fn create_child_anchor(&self, iter: &mut TextIter) -> TextChildAnchor

Creates and inserts a child anchor. Read more
source§

fn create_mark( &self, mark_name: Option<&str>, where_: &TextIter, left_gravity: bool ) -> TextMark

Creates a mark at position @where_. Read more
source§

fn cut_clipboard(&self, clipboard: &Clipboard, default_editable: bool)

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

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

Deletes text between @start and @end. Read more
source§

fn delete_interactive( &self, start_iter: &mut TextIter, end_iter: &mut TextIter, default_editable: bool ) -> bool

Deletes all editable text in the given range. Read more
source§

fn delete_mark(&self, mark: &impl IsA<TextMark>)

Deletes @mark, so that it’s no longer located anywhere in the buffer. Read more
source§

fn delete_mark_by_name(&self, name: &str)

Deletes the mark named @name; the mark must exist. Read more
source§

fn delete_selection(&self, interactive: bool, default_editable: bool) -> bool

Deletes the range between the “insert” and “selection_bound” marks, that is, the currently-selected text. Read more
source§

fn end_irreversible_action(&self)

Denotes the end of an action that may not be undone. Read more
source§

fn end_user_action(&self)

Ends a user-visible operation. Read more
source§

fn bounds(&self) -> (TextIter, TextIter)

Retrieves the first and last iterators in the buffer, i.e. the entire buffer lies within the range [@start,@end). Read more
source§

fn can_redo(&self) -> bool

Gets whether there is a redoable action in the history. Read more
source§

fn can_undo(&self) -> bool

Gets whether there is an undoable action in the history. Read more
source§

fn char_count(&self) -> i32

Gets the number of characters in the buffer. Read more
source§

fn enables_undo(&self) -> bool

Gets whether the buffer is saving modifications to the buffer to allow for undo and redo actions. Read more
source§

fn end_iter(&self) -> TextIter

Initializes @iter with the “end iterator,” one past the last valid character in the text buffer. Read more
source§

fn has_selection(&self) -> bool

Indicates whether the buffer has some text currently selected. Read more
source§

fn get_insert(&self) -> TextMark

Returns the mark that represents the cursor (insertion point). Read more
source§

fn iter_at_child_anchor(&self, anchor: &impl IsA<TextChildAnchor>) -> TextIter

Obtains the location of @anchor within @self. Read more
source§

fn iter_at_line(&self, line_number: i32) -> Option<TextIter>

Initializes @iter to the start of the given line. Read more
source§

fn iter_at_line_index( &self, line_number: i32, byte_index: i32 ) -> Option<TextIter>

Obtains an iterator pointing to @byte_index within the given line. Read more
source§

fn iter_at_line_offset( &self, line_number: i32, char_offset: i32 ) -> Option<TextIter>

Obtains an iterator pointing to @char_offset within the given line. Read more
source§

fn iter_at_mark(&self, mark: &impl IsA<TextMark>) -> TextIter

Initializes @iter with the current position of @mark. Read more
source§

fn iter_at_offset(&self, char_offset: i32) -> TextIter

Initializes @iter to a position @char_offset chars from the start of the entire buffer. Read more
source§

fn line_count(&self) -> i32

Obtains the number of lines in the buffer. Read more
source§

fn mark(&self, name: &str) -> Option<TextMark>

Returns the mark named @name in buffer @self, or None if no such mark exists in the buffer. Read more
source§

fn max_undo_levels(&self) -> u32

Gets the maximum number of undo levels to perform. Read more
source§

fn is_modified(&self) -> bool

Indicates whether the buffer has been modified since the last call to set_modified() set the modification flag to false. Read more
source§

fn selection_bound(&self) -> TextMark

Returns the mark that represents the selection bound. Read more
source§

fn selection_bounds(&self) -> Option<(TextIter, TextIter)>

Returns true if some text is selected; places the bounds of the selection in @start and @end. Read more
source§

fn selection_content(&self) -> ContentProvider

Get a content provider for this buffer. Read more
source§

fn slice( &self, start: &TextIter, end: &TextIter, include_hidden_chars: bool ) -> GString

Returns the text in the range [@start,@end). Read more
source§

fn start_iter(&self) -> TextIter

Initialized @iter with the first position in the text buffer. Read more
source§

fn tag_table(&self) -> TextTagTable

Get the TextTagTable associated with this buffer. Read more
source§

fn text( &self, start: &TextIter, end: &TextIter, include_hidden_chars: bool ) -> GString

Returns the text in the range [@start,@end). Read more
source§

fn insert(&self, iter: &mut TextIter, text: &str)

Inserts @len bytes of @text at position @iter. Read more
source§

fn insert_at_cursor(&self, text: &str)

Inserts @text in @self. Read more
source§

fn insert_child_anchor( &self, iter: &mut TextIter, anchor: &impl IsA<TextChildAnchor> )

Inserts a child widget anchor into the text buffer at @iter. Read more
source§

fn insert_interactive( &self, iter: &mut TextIter, text: &str, default_editable: bool ) -> bool

Inserts @text in @self. Read more
source§

fn insert_interactive_at_cursor( &self, text: &str, default_editable: bool ) -> bool

Inserts @text in @self. Read more
source§

fn insert_markup(&self, iter: &mut TextIter, markup: &str)

Inserts the text in @markup at position @iter. Read more
source§

fn insert_paintable(&self, iter: &mut TextIter, paintable: &impl IsA<Paintable>)

Inserts an image into the text buffer at @iter. Read more
source§

fn insert_range(&self, iter: &mut TextIter, start: &TextIter, end: &TextIter)

Copies text, tags, and paintables between @start and @end and inserts the copy at @iter. Read more
source§

fn insert_range_interactive( &self, iter: &mut TextIter, start: &TextIter, end: &TextIter, default_editable: bool ) -> bool

Copies text, tags, and paintables between @start and @end and inserts the copy at @iter. Read more
source§

fn move_mark(&self, mark: &impl IsA<TextMark>, where_: &TextIter)

Moves @mark to the new location @where_. Read more
source§

fn move_mark_by_name(&self, name: &str, where_: &TextIter)

Moves the mark named @name (which must exist) to location @where_. Read more
source§

fn paste_clipboard( &self, clipboard: &Clipboard, override_location: Option<&TextIter>, default_editable: bool )

Pastes the contents of a clipboard. Read more
source§

fn place_cursor(&self, where_: &TextIter)

This function moves the “insert” and “selection_bound” marks simultaneously. Read more
source§

fn redo(&self)

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

fn remove_all_tags(&self, start: &TextIter, end: &TextIter)

Removes all tags in the range between @start and @end. Read more
source§

fn remove_selection_clipboard(&self, clipboard: &Clipboard)

source§

fn remove_tag(&self, tag: &impl IsA<TextTag>, start: &TextIter, end: &TextIter)

Emits the “remove-tag” signal. Read more
source§

fn remove_tag_by_name(&self, name: &str, start: &TextIter, end: &TextIter)

Emits the “remove-tag” signal. Read more
source§

fn select_range(&self, ins: &TextIter, bound: &TextIter)

This function moves the “insert” and “selection_bound” marks simultaneously. Read more
source§

fn set_enable_undo(&self, enable_undo: bool)

Sets whether or not to enable undoable actions in the text buffer. Read more
source§

fn set_max_undo_levels(&self, max_undo_levels: u32)

Sets the maximum number of undo levels to perform. Read more
source§

fn set_modified(&self, setting: bool)

Used to keep track of whether the buffer has been modified since the last time it was saved. Read more
source§

fn set_text(&self, text: &str)

Deletes current contents of @self, 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 delete() and insert() directly instead. Read more
source§

fn undo(&self)

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

fn cursor_position(&self) -> i32

The position of the insert mark. Read more
source§

fn connect_apply_tag<F: Fn(&Self, &TextTag, &TextIter, &TextIter) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted to apply a tag to a range of text in a TextBuffer. Read more
source§

fn connect_begin_user_action<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted at the beginning of a single user-visible operation on a TextBuffer. Read more
source§

fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Emitted when the content of a TextBuffer has changed.
source§

fn connect_delete_range<F: Fn(&Self, &TextIter, &TextIter) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted to delete a range from a TextBuffer. Read more
source§

fn connect_end_user_action<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted at the end of a single user-visible operation on the TextBuffer. Read more
source§

fn connect_insert_child_anchor<F: Fn(&Self, &TextIter, &TextChildAnchor) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted to insert a TextChildAnchor in a TextBuffer. Read more
source§

fn connect_insert_paintable<F: Fn(&Self, &TextIter, &Paintable) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted to insert a gdk::Paintable in a TextBuffer. Read more
source§

fn connect_mark_deleted<F: Fn(&Self, &TextMark) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted as notification after a TextMark is deleted. Read more
source§

fn connect_mark_set<F: Fn(&Self, &TextIter, &TextMark) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted as notification after a TextMark is set. Read more
source§

fn connect_modified_changed<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted when the modified bit of a TextBuffer flips. Read more
source§

fn connect_paste_done<F: Fn(&Self, &Clipboard) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted after paste operation has been completed. Read more
source§

fn connect_redo<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

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

fn connect_remove_tag<F: Fn(&Self, &TextTag, &TextIter, &TextIter) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted to remove all occurrences of @tag from a range of text in a TextBuffer. Read more
source§

fn connect_undo<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

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

fn connect_can_redo_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source§

fn connect_can_undo_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source§

fn connect_cursor_position_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source§

fn connect_enable_undo_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source§

fn connect_has_selection_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

source§

fn connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source§

impl<O> TextBufferExtManual for O
where O: IsA<TextBuffer>,

source§

fn create_tag( &self, tag_name: Option<&str>, properties: &[(&str, &dyn ToValue)] ) -> Option<TextTag>

Panics Read more
source§

fn insert_with_tags(&self, iter: &mut TextIter, text: &str, tags: &[&TextTag])

Inserts @text into @self at @iter, applying the list of tags to the newly-inserted text. Read more
source§

fn insert_with_tags_by_name( &self, iter: &mut TextIter, text: &str, tags_names: &[&str] )

Inserts @text into @self at @iter, applying the list of tags to the newly-inserted text. Read more
source§

fn connect_insert_text<F: Fn(&Self, &mut TextIter, &str) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted to insert text in a TextBuffer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> TransparentType for T

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,

source§

impl<Super, Sub> MayDowncastTo<Sub> for Super
where Super: IsA<Super>, Sub: IsA<Super>,