gtkmm: Gtk::TreeRowReference Class Reference

gtkmm 3.24.6

Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Related Functions | List of all members
Gtk::TreeRowReference Class Reference
TreeView Classes

Typedefed as Gtk::TreeModel::RowReference. More...

`#include <gtkmm/treerowreference.h>`

## Public Types
typedef const void * | BoolExpr
| This typedef is just to make it more obvious that our operator const void* should be used like operator bool(). More...

## Public Member Functions
| TreeRowReference ()
| TreeRowReference (GtkTreeRowReference * gobject, bool make_a_copy=true)
| TreeRowReference (const TreeRowReference & other)
TreeRowReference & | operator= (const TreeRowReference & other)
| TreeRowReference (TreeRowReference && other) noexcept
TreeRowReference & | operator= (TreeRowReference && other) noexcept
| ~TreeRowReference () noexcept
void | swap (TreeRowReference & other) noexcept
GtkTreeRowReference * | gobj ()
| Provides access to the underlying C instance. More...
const GtkTreeRowReference * | gobj () const
| Provides access to the underlying C instance. More...
GtkTreeRowReference * | gobj_copy () const
| Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs. More...
| TreeRowReference (const Glib::RefPtr< TreeModel > & model, const TreeModel::Path & path)
| operator BoolExpr () const
| The same as is_valid(). More...
| operator bool () const
| The same as is_valid(). More...
TreeModel::Path | get_path () const
| Returns a path that the row reference currently points to, or `nullptr` if the path pointed to is no longer valid. More...
Glib::RefPtr< TreeModel > | get_model ()
| Returns the model that the row reference is monitoring. More...
Glib::RefPtr< const TreeModel > | get_model () const
| Returns the model that the row reference is monitoring. More...
bool | is_valid () const
| Returns `true` if the reference is non-`nullptr` and refers to a current valid path. More...

## Static Public Member Functions
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...

## Protected Attributes
GtkTreeRowReference * | gobject_

## Related Functions
(Note that these are not member functions.)
void | swap (TreeRowReference & lhs, TreeRowReference & rhs) noexcept
Gtk::TreeRowReference | wrap (GtkTreeRowReference * object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Detailed Description

Typedefed as Gtk::TreeModel::RowReference.

This reference will keep pointing to the node pointed to by the Path, so long as it exists. It listens to all signals emitted by the Model, and updates its Path appropriately.

## Member Typedef Documentation

## ◆ BoolExpr

typedef const void* Gtk::TreeRowReference::BoolExpr

This typedef is just to make it more obvious that our operator const void* should be used like operator bool().

Deprecated:
  Use the explicit operator bool() instead.

## Constructor & Destructor Documentation

## ◆ TreeRowReference() [1/5]

Gtk::TreeRowReference::TreeRowReference | ( |  | ) |

## ◆ TreeRowReference() [2/5]

Gtk::TreeRowReference::TreeRowReference | ( | GtkTreeRowReference * | gobject,
|  | bool | make_a_copy = `true`
| ) |  |
| explicit

## ◆ TreeRowReference() [3/5]

Gtk::TreeRowReference::TreeRowReference | ( | const TreeRowReference & | other | ) |

## ◆ TreeRowReference() [4/5]

Gtk::TreeRowReference::TreeRowReference | ( | TreeRowReference && | other | ) |
| noexcept

## ◆ ~TreeRowReference()

Gtk::TreeRowReference::~TreeRowReference | ( |  | ) |
| noexcept

## ◆ TreeRowReference() [5/5]

Gtk::TreeRowReference::TreeRowReference | ( | const Glib::RefPtr< TreeModel > & | model,
|  | const TreeModel::Path & | path
| ) |  |

## Member Function Documentation

## ◆ get_model() [1/2]

Glib::RefPtr< TreeModel > Gtk::TreeRowReference::get_model | ( |  | ) |

Returns the model that the row reference is monitoring.

Since gtkmm 2.8:

Returns
  The model.

## ◆ get_model() [2/2]

Glib::RefPtr< const TreeModel > Gtk::TreeRowReference::get_model | ( |  | ) | const

Returns the model that the row reference is monitoring.

Since gtkmm 2.8:

Returns
  The model.

## ◆ get_path()

TreeModel::Path Gtk::TreeRowReference::get_path | ( |  | ) | const

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

Returns
  A current path, or `nullptr`.

## ◆ get_type()

static GType Gtk::TreeRowReference::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

## ◆ gobj() [1/2]

GtkTreeRowReference * Gtk::TreeRowReference::gobj | ( |  | ) |
| inline

Provides access to the underlying C instance.

## ◆ gobj() [2/2]

const GtkTreeRowReference * Gtk::TreeRowReference::gobj | ( |  | ) | const
| inline

Provides access to the underlying C instance.

## ◆ gobj_copy()

GtkTreeRowReference * Gtk::TreeRowReference::gobj_copy | ( |  | ) | const

Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.

## ◆ is_valid()

bool Gtk::TreeRowReference::is_valid | ( |  | ) | const

Returns `true` if the reference is non-`nullptr` and refers to a current valid path.

Returns
  `true` if reference points to a valid path.

## ◆ operator bool()

Gtk::TreeRowReference::operator bool | ( |  | ) | const
| explicit

The same as is_valid().

For instance,

if(treerowreference)
do_something()

Since gtkmm 3.22:

## ◆ operator BoolExpr()

Gtk::TreeRowReference::operator BoolExpr | ( |  | ) | const

The same as is_valid().

For instance,

if(treerowreference)
do_something()

Deprecated:
  Use the explicit operator bool() instead.

## ◆ operator=() [1/2]

TreeRowReference & Gtk::TreeRowReference::operator= | ( | const TreeRowReference & | other | ) |

## ◆ operator=() [2/2]

TreeRowReference & Gtk::TreeRowReference::operator= | ( | TreeRowReference && | other | ) |
| noexcept

## ◆ swap()

void Gtk::TreeRowReference::swap | ( | TreeRowReference & | other | ) |
| noexcept

## Friends And Related Function Documentation

## ◆ swap()

void swap | ( | TreeRowReference & | lhs,
|  | TreeRowReference & | rhs
| ) |  |
| related

Parameters

  lhs | The left-hand side
  rhs | The right-hand side

## ◆ wrap()

Gtk::TreeRowReference wrap | ( | GtkTreeRowReference * | object,
|  | bool | take_copy = `false`
| ) |  |
| related

A Glib::wrap() method for this object.

Parameters

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns
  A C++ instance that wraps this C instance.

## Member Data Documentation

## ◆ gobject_

GtkTreeRowReference* Gtk::TreeRowReference::gobject_
| protected