TreeRowReference#
Deprecated since version 4.10: Use ListModel
instead
- class TreeRowReference(**kwargs)#
A GtkTreeRowReference tracks model changes so that it always refers to the
same row (a GtkTreePath
refers to a position, not a fixed row). Create a
new GtkTreeRowReference with new()
.
Constructors#
- class TreeRowReference
- classmethod new(model: TreeModel, path: TreePath) TreeRowReference | None #
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 onmodel
are propagated, and the path is updated appropriately. Ifpath
isn’t a valid path inmodel
, thenNone
is returned.Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
model – a
GtkTreeModel
path – a valid
GtkTreePath
to monitor
- classmethod new_proxy(proxy: Object, model: TreeModel, path: TreePath) TreeRowReference | None #
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. Ifpath
isn’t a valid path inmodel
, thenNone
is returned. However, unlike references created withnew()
, it does not listen to the model for changes. The creator of the row reference must do this explicitly usinginserted()
,deleted()
,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
GtkTreeView
already use this mechanism internally, using them as the proxy object will produce unpredictable results. Further more, passing the same object asmodel
andproxy
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 version 4.10: Please do not use it in newly written code
- Parameters:
proxy – a proxy
GObject
model – a
GtkTreeModel
path – a valid
GtkTreePath
to monitor
Methods#
- class TreeRowReference
- deleted(proxy: Object, path: TreePath) None #
Lets a set of row reference created by
new_proxy()
know that the model emitted the ::row-deleted signal.Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
proxy – a
GObject
path – the path position that was deleted
- free() None #
Free’s
reference
.reference
may beNone
Deprecated since version 4.10: Please do not use it in newly written code
- get_model() TreeModel #
Returns the model that the row reference is monitoring.
Deprecated since version 4.10: Please do not use it in newly written code
- get_path() TreePath | None #
Returns a path that the row reference currently points to, or
None
if the path pointed to is no longer valid.Deprecated since version 4.10: Please do not use it in newly written code
- inserted(proxy: Object, path: TreePath) None #
Lets a set of row reference created by
new_proxy()
know that the model emitted the ::row-inserted signal.Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
proxy – a
GObject
path – the row position that was inserted