[]Struct gtk::TreeRowReference

pub struct TreeRowReference(_);

A TreeRowReference 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 TreeRowReference with TreeRowReference::new.

Implementations

impl TreeRowReference[src]

pub fn new<P: IsA<TreeModel>>(
    model: &P,
    path: &TreePath
) -> Option<TreeRowReference>
[src]

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.

model

a TreeModel

path

a valid TreePath-struct to monitor

Returns

a newly allocated TreeRowReference, or None

pub fn new_proxy<P: IsA<Object>, Q: IsA<TreeModel>>(
    proxy: &P,
    model: &Q,
    path: &TreePath
) -> Option<TreeRowReference>
[src]

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 TreeRowReference::new, it does not listen to the model for changes. The creator of the row reference must do this explicitly using TreeRowReference::inserted, TreeRowReference::deleted, TreeRowReference::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.

proxy

a proxy gobject::Object

model

a TreeModel

path

a valid TreePath-struct to monitor

Returns

a newly allocated TreeRowReference, or None

pub fn get_model(&self) -> TreeModel[src]

Returns the model that the row reference is monitoring.

Returns

the model

pub fn get_path(&self) -> Option<TreePath>[src]

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

Returns

a current path, or None

pub fn valid(&self) -> bool[src]

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

Returns

true if self points to a valid path

pub fn deleted<P: IsA<Object>>(proxy: &P, path: &TreePath)[src]

Lets a set of row reference created by TreeRowReference::new_proxy know that the model emitted the TreeModel::row-deleted signal.

proxy

a gobject::Object

path

the path position that was deleted

pub fn inserted<P: IsA<Object>>(proxy: &P, path: &TreePath)[src]

Lets a set of row reference created by TreeRowReference::new_proxy know that the model emitted the TreeModel::row-inserted signal.

proxy

a gobject::Object

path

the row position that was inserted

impl TreeRowReference[src]

pub unsafe fn reordered<T: IsA<Object>>(
    proxy: &T,
    path: &TreePath,
    iter: Option<&TreeIter>,
    new_order: &[u32]
)
[src]

Lets a set of row reference created by TreeRowReference::new_proxy know that the model emitted the TreeModel::rows-reordered signal.

proxy

a gobject::Object

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

Safety

The proxy must be a proxy returned by gtk::TreeRowReference and the new_order bounds must be valid as they cannot be checked.

Trait Implementations

impl Clone for TreeRowReference

impl Debug for TreeRowReference[src]

impl Eq for TreeRowReference[src]

impl Hash for TreeRowReference[src]

impl Ord for TreeRowReference[src]

impl PartialEq<TreeRowReference> for TreeRowReference[src]

impl PartialOrd<TreeRowReference> for TreeRowReference[src]

impl StaticType for TreeRowReference

impl StructuralEq for TreeRowReference[src]

impl StructuralPartialEq for TreeRowReference[src]

Auto Trait Implementations

impl RefUnwindSafe for TreeRowReference

impl !Send for TreeRowReference

impl !Sync for TreeRowReference

impl Unpin for TreeRowReference

impl UnwindSafe for TreeRowReference

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.