Struct gtk4::TreeRowReference

source ·
#[repr(transparent)]
pub struct TreeRowReference { /* private fields */ }
Expand description

A GtkTreeRowReference tracks model changes so that it always refers to the same row (a TreePath refers to a position, not a fixed row). Create a new GtkTreeRowReference with gtk_tree_row_reference_new().

Implementations§

Return the inner pointer to the underlying C value.

Creates a row reference based on @path.

This reference will keep pointing to the node pointed to by @path, so long as it exists. Any changes that occur on @model are propagated, and the path is updated appropriately. If @path isn’t a valid path in @model, then None is returned.

Deprecated since 4.10
model

a TreeModel

path

a valid TreePath to monitor

Returns

a newly allocated TreeRowReference

You do not need to use this function.

Creates a row reference based on @path.

This reference will keep pointing to the node pointed to by @path, so long as it exists. If @path isn’t a valid path in @model, then None is returned. However, unlike references created with gtk_tree_row_reference_new(), it does not listen to the model for changes. The creator of the row reference must do this explicitly using gtk_tree_row_reference_inserted(), gtk_tree_row_reference_deleted(), gtk_tree_row_reference_reordered().

These functions must be called exactly once per proxy when the corresponding signal on the model is emitted. This single call updates all row references for that proxy. Since built-in GTK objects like TreeView already use this mechanism internally, using them as the proxy object will produce unpredictable results. Further more, passing the same object as @model and @proxy doesn’t work for reasons of internal implementation.

This type of row reference is primarily meant by structures that need to carefully monitor exactly when a row reference updates itself, and is not generally needed by most applications.

Deprecated since 4.10
proxy

a proxy GObject

model

a TreeModel

path

a valid TreePath to monitor

Returns

a newly allocated TreeRowReference

Returns the model that the row reference is monitoring.

Deprecated since 4.10
Returns

the model

Returns a path that the row reference currently points to, or None if the path pointed to is no longer valid.

Deprecated since 4.10
Returns

a current path

Returns true if the @self is non-None and refers to a current valid path.

Deprecated since 4.10
Returns

true if @self points to a valid path

Lets a set of row reference created by gtk_tree_row_reference_new_proxy() know that the model emitted the ::row-deleted signal.

Deprecated since 4.10
proxy

a GObject

path

the path position that was deleted

Lets a set of row reference created by gtk_tree_row_reference_new_proxy() know that the model emitted the ::row-inserted signal.

Deprecated since 4.10
proxy

a GObject

path

the row position that was inserted

Lets a set of row reference created by gtk_tree_row_reference_new_proxy() know that the model emitted the ::rows-reordered signal.

Deprecated since 4.10
proxy

a GObject

path

the parent path of the reordered signal

iter

the iter pointing to the parent of the reordered

new_order

the new order of rows

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Returns the type identifier of Self.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Ensures that the type has been registered with the type system.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.