[−]Struct gtk::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]
model: &P,
path: &TreePath
) -> Option<TreeRowReference>
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]
proxy: &P,
model: &Q,
path: &TreePath
) -> Option<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 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]
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]
impl TreeRowReference
[src]
pub unsafe fn reordered<T: IsA<Object>>(
proxy: &T,
path: &TreePath,
iter: Option<&TreeIter>,
new_order: &[u32]
)
[src]
proxy: &T,
path: &TreePath,
iter: Option<&TreeIter>,
new_order: &[u32]
)
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
fn clone(&self) -> TreeRowReference
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for TreeRowReference
[src]
impl Eq for TreeRowReference
[src]
impl Hash for TreeRowReference
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for TreeRowReference
[src]
fn cmp(&self, other: &TreeRowReference) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<TreeRowReference> for TreeRowReference
[src]
fn eq(&self, other: &TreeRowReference) -> bool
[src]
fn ne(&self, other: &TreeRowReference) -> bool
[src]
impl PartialOrd<TreeRowReference> for TreeRowReference
[src]
fn partial_cmp(&self, other: &TreeRowReference) -> Option<Ordering>
[src]
fn lt(&self, other: &TreeRowReference) -> bool
[src]
fn le(&self, other: &TreeRowReference) -> bool
[src]
fn gt(&self, other: &TreeRowReference) -> bool
[src]
fn ge(&self, other: &TreeRowReference) -> bool
[src]
impl StaticType for TreeRowReference
fn static_type() -> Type
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToSendValue for T where
T: ToValue + SetValue + Send + ?Sized,
T: ToValue + SetValue + Send + ?Sized,
fn to_send_value(&self) -> SendValue
impl<T> ToValue for T where
T: SetValue + ?Sized,
T: SetValue + ?Sized,
fn to_value(&self) -> Value
fn to_value_type(&self) -> Type
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,