gtk4

Struct 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

GLib type: GObject with reference counted clone semantics.

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

Makes a clone of this shared reference.

This increments the strong reference count of the object. Dropping the object will decrement it again.

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

Source§

type ParamSpec = ParamSpecObject

Source§

type SetValue = TextBuffer

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

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,

Hashes the memory address of this object.

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

Comparison for two GObjects.

Compares the memory addresses of the provided objects.

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,

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

Equality for two GObjects.

Two GObjects are equal if their memory addresses are equal.

1.0.0 · Source§

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

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>

Partial comparison for two GObjects.

Compares the memory addresses of the provided objects.

1.0.0 · Source§

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

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

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

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

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

Source§

type Value = T

Source§

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

Source§

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_commit_notify(&self, commit_notify_handler: u32)

Available on crate feature v4_16 only.
Removes the GtkTextBufferCommitNotify handler previously registered with TextBufferExtManual::add_commit_notify(). 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§

fn add_commit_notify<P: Fn(&TextBuffer, TextBufferNotifyFlags, u32, u32) + 'static>( &self, flags: TextBufferNotifyFlags, commit_notify: P, ) -> u32

Available on crate feature v4_16 only.
Adds a `callback::Gtk::TextBufferCommitNotify to be called when a change is to be made to the [type@Gtk.TextBuffer]. Read more
Source§

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

Source§

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>,

Source§

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>,

Source§

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>,