gtk.TreeRowReference
Prev | The gtk Class Reference | Next

## gtk.TreeRowReference

gtk.TreeRowReference — an object maintaining a persistent reference to a `gtk.TreeModel` row (new in PyGTK 2.4)

## Synopsis

    class gtk.TreeRowReference(gobject.GBoxed):
        gtk.TreeRowReference(model, path)
        def get_path()
        def get_model()
        def valid()
        def copy()
        def free()

## Description

### Note

This object is available in PyGTK 2.4 and above.

A `gtk.TreeRowReference` is an object that points to a row in a `gtk.TreeModel` similar to a `gtk.TreeIter`. A `gtk.TreeRowReference`, unlike a `gtk.TreeIter`, maintains a persistent reference in spite of changes in the model.

## Constructor

        gtk.TreeRowReference(model, path)

`model` : | a `gtk.TreeModel`
`path` : | a valid tree path to monitor
Returns : | a `gtk.TreeRowReference`, or `None`

### Note

This constructor is available in PyGTK 2.4 and above.

Creates a row reference pointing to the treemodel row specified by `model` and `path`. This reference will continue pointing to the node in spite of changes in `model`. It listens to all signals emitted by `model`, and updates its path appropriately. If `path` isn't a valid path in `model`, `None` is returned.

## Methods

### gtk.TreeRowReference.get_path

        def get_path()

Returns : | A current path, or `None`.

### Note

This method is available in PyGTK 2.4 and above.

The `get_path`() method returns the path that the row reference currently points to, or `None` if the path pointed to is no longer valid.

### gtk.TreeRowReference.get_model

        def get_model()

Returns : | the model, or `None`.

### Note

This method is available in PyGTK 2.8 and above.

The `get_model`() method returns the model that the row reference currently monitors, or `None` if the model is not set.

### gtk.TreeRowReference.valid

        def valid()

Returns : | `True` if the row reference points to a valid path.

### Note

This method is available in PyGTK 2.4 and above.

The `valid`() method returns `True` if the row reference is not `None` and refers to a current valid path.

### gtk.TreeRowReference.copy

        def copy()

Returns : | a copy of the row reference

### Note

This method is available in PyGTK 2.4 and above.

The `copy`() method returns a copy of the tree row reference.

### gtk.TreeRowReference.free

        def free()

### Note

This method is available in PyGTK 2.4 and above.

### Warning

This method is deprecated and should not be used since it may crash your application.

The free() method frees the tree row reference. The row reference may be `None`.

Prev | Up | Next
gtk.TreeModelRowIter | Home | gtk.TreeSelection