gtkmm: Gtk::TreeListRow Class Reference

A row in a Gtk::TreeListModel. More...

#include <gtkmm/treelistrow.h>

Inheritance diagram for Gtk::TreeListRow:

Public Member Functions

 TreeListRow (TreeListRow&& src) noexcept
 
TreeListRowoperator= (TreeListRow&& src) noexcept
 
 ~TreeListRow () noexcept override
 
GtkTreeListRow* gobj ()
 Provides access to the underlying C GObject. More...

 
const GtkTreeListRow* gobj () const
 Provides access to the underlying C GObject. More...

 
GtkTreeListRow* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...

 
Glib::RefPtr< Glib::ObjectBaseget_item ()
 Gets the item corresponding to this row,. More...

 
Glib::RefPtr< const Glib::ObjectBaseget_item () const
 Gets the item corresponding to this row,. More...

 
void set_expanded (bool expanded=true)
 Expands or collapses a row. More...

 
bool get_expanded () const
 Gets if a row is currently expanded. More...

 
bool is_expandable () const
 Checks if a row can be expanded. More...

 
guint get_position () const
 Returns the position in the Gtk::TreeListModel that self occupies at the moment. More...

 
guint get_depth () const
 Gets the depth of this row. More...

 
Glib::RefPtr< Gio::ListModelget_children ()
 If the row is expanded, gets the model holding the children of self. More...

 
Glib::RefPtr< const Gio::ListModelget_children () const
 If the row is expanded, gets the model holding the children of self. More...

 
Glib::RefPtr< TreeListRowget_parent ()
 Gets the row representing the parent for self. More...

 
Glib::RefPtr< const TreeListRowget_parent () const
 Gets the row representing the parent for self. More...

 
Glib::RefPtr< TreeListRowget_child_row (guint position)
 If self is not expanded or position is greater than the number of children, nullptr is returned. More...

 
Glib::RefPtr< const TreeListRowget_child_row (guint position) const
 If self is not expanded or position is greater than the number of children, nullptr is returned. More...

 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gio::ListModel > > property_children () const
 The model holding the row's children. More...

 
Glib::PropertyProxy_ReadOnly< guint > property_depth () const
 The depth in the tree of this row. More...

 
Glib::PropertyProxy_ReadOnly< bool > property_expandable () const
 If this row can ever be expanded. More...

 
Glib::PropertyProxy< bool > property_expanded ()
 If this row is currently expanded. More...

 
Glib::PropertyProxy_ReadOnly< bool > property_expanded () const
 If this row is currently expanded. More...

 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Glib::ObjectBase > > property_item () const
 The item held in this row. More...

 
- Public Member Functions inherited from Glib::Object
 Object (const Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&src) noexcept
 
Objectoperator= (Object &&src) noexcept
 
void * get_data (const QueryQuark &key)
 
void set_data (const Quark &key, void *data)
 
void set_data (const Quark &key, void *data, DestroyNotify notify)
 
void remove_data (const QueryQuark &quark)
 
void * steal_data (const QueryQuark &quark)
 
Glib::RefPtr< Glib::Objectwrap (GObject *object, bool take_copy=false)
 
- Public Member Functions inherited from Glib::ObjectBase
 ObjectBase (const ObjectBase &)=delete
 
ObjectBaseoperator= (const ObjectBase &)=delete
 
void set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
 
void get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
 
void set_property (const Glib::ustring &property_name, const PropertyType &value)
 
void get_property (const Glib::ustring &property_name, PropertyType &value) const
 
PropertyType get_property (const Glib::ustring &property_name) const
 
sigc::connection connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void()> &slot)
 
sigc::connection connect_property_changed (const Glib::ustring &property_name, sigc::slot< void()> &&slot)
 
void freeze_notify ()
 
void thaw_notify ()
 
virtual void reference () const
 
virtual void unreference () const
 
GObject * gobj ()
 
const GObject * gobj () const
 
GObject * gobj_copy () const
 
- Public Member Functions inherited from sigc::trackable
 trackable () noexcept
 
 trackable (const trackable &src) noexcept
 
 trackable (trackable &&src) noexcept
 
 ~trackable ()
 
void add_destroy_notify_callback (notifiable *data, func_destroy_notify func) const
 
void notify_callbacks ()
 
trackableoperator= (const trackable &src)
 
trackableoperator= (trackable &&src) noexcept
 
void remove_destroy_notify_callback (notifiable *data) const
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...

 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gtk::TreeListRowwrap (GtkTreeListRow* object, bool take_copy=false)
 A Glib::wrap() method for this object. More...

 

Additional Inherited Members

- Public Types inherited from Glib::Object
typedef void(*)(gpointer data DestroyNotify)
 
- Public Types inherited from sigc::trackable
typedef internal::func_destroy_notify func_destroy_notify
 
- Public Types inherited from sigc::notifiable
typedef internal::func_destroy_notify func_destroy_notify
 
- Protected Member Functions inherited from Glib::Object
 Object ()
 
 Object (const Glib::ConstructParams &construct_params)
 
 Object (GObject *castitem)
 
 ~Object () noexcept override
 
- Protected Member Functions inherited from Glib::ObjectBase
 ObjectBase ()
 
 ObjectBase (const char *custom_type_name)
 
 ObjectBase (const std::type_info &custom_type_info)
 
 ObjectBase (ObjectBase &&src) noexcept
 
ObjectBaseoperator= (ObjectBase &&src) noexcept
 
virtual ~ObjectBase () noexcept=0
 
void initialize (GObject *castitem)
 
void initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper)
 

Detailed Description

A row in a Gtk::TreeListModel.

Gtk::TreeListRow is the object used by Gtk::TreeListModel to represent items. It allows navigating the model as a tree and modify the state of rows.

Gtk::TreeListRow instances are created by a Gtk::TreeListModel only when the Gtk::TreeListModel::property_passthrough() property is not set.

There are various support objects that can make use of Gtk::TreeListRow objects, such as the Gtk::TreeExpander widget that allows displaying an icon to expand or collapse a row or Gtk::TreeListRowSorter that makes it possible to sort trees properly.

See also
Gtk::TreeListModel
Since gtkmm 3.98:

Constructor & Destructor Documentation

Gtk::TreeListRow::TreeListRow ( TreeListRow&&  src)
noexcept
Gtk::TreeListRow::~TreeListRow ( )
overridenoexcept

Member Function Documentation

Glib::RefPtr<TreeListRow> Gtk::TreeListRow::get_child_row ( guint  position)

If self is not expanded or position is greater than the number of children, nullptr is returned.

Parameters
positionPosition of the child to get.
Returns
The child in position.
Glib::RefPtr<const TreeListRow> Gtk::TreeListRow::get_child_row ( guint  position) const

If self is not expanded or position is greater than the number of children, nullptr is returned.

Parameters
positionPosition of the child to get.
Returns
The child in position.
Glib::RefPtr<Gio::ListModel> Gtk::TreeListRow::get_children ( )

If the row is expanded, gets the model holding the children of self.

This model is the model created by the Gtk::TreeListModelCreateModelFunc and contains the original items, no matter what value Gtk::TreeListModel::property_passthrough() is set to.

Returns
The model containing the children.
Glib::RefPtr<const Gio::ListModel> Gtk::TreeListRow::get_children ( ) const

If the row is expanded, gets the model holding the children of self.

This model is the model created by the Gtk::TreeListModelCreateModelFunc and contains the original items, no matter what value Gtk::TreeListModel::property_passthrough() is set to.

Returns
The model containing the children.
guint Gtk::TreeListRow::get_depth ( ) const

Gets the depth of this row.

Rows that correspond to items in the root model have a depth of zero, rows corresponding to items of models of direct children of the root model have a depth of 1 and so on.

The depth of a row never changes until the row is destroyed.

Returns
The depth of this row.
bool Gtk::TreeListRow::get_expanded ( ) const

Gets if a row is currently expanded.

Returns
true if the row is expanded.
Glib::RefPtr<Glib::ObjectBase> Gtk::TreeListRow::get_item ( )

Gets the item corresponding to this row,.

The value returned by this function never changes until the row is destroyed.

Returns
The item of this row or nullptr when the row was destroyed.
Glib::RefPtr<const Glib::ObjectBase> Gtk::TreeListRow::get_item ( ) const

Gets the item corresponding to this row,.

The value returned by this function never changes until the row is destroyed.

Returns
The item of this row or nullptr when the row was destroyed.
Glib::RefPtr<TreeListRow> Gtk::TreeListRow::get_parent ( )

Gets the row representing the parent for self.

That is the row that would need to be collapsed to make this row disappear.

If self is a row corresponding to the root model, nullptr is returned.

The value returned by this function never changes until the row is destroyed.

Returns
The parent of self.
Glib::RefPtr<const TreeListRow> Gtk::TreeListRow::get_parent ( ) const

Gets the row representing the parent for self.

That is the row that would need to be collapsed to make this row disappear.

If self is a row corresponding to the root model, nullptr is returned.

The value returned by this function never changes until the row is destroyed.

Returns
The parent of self.
guint Gtk::TreeListRow::get_position ( ) const

Returns the position in the Gtk::TreeListModel that self occupies at the moment.

Returns
The position in the model.
static GType Gtk::TreeListRow::get_type ( )
static

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

GtkTreeListRow* Gtk::TreeListRow::gobj ( )
inline

Provides access to the underlying C GObject.

const GtkTreeListRow* Gtk::TreeListRow::gobj ( ) const
inline

Provides access to the underlying C GObject.

GtkTreeListRow* Gtk::TreeListRow::gobj_copy ( )

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

bool Gtk::TreeListRow::is_expandable ( ) const

Checks if a row can be expanded.

This does not mean that the row is actually expanded, this can be checked with get_expanded()

If a row is expandable never changes until the row is destroyed.

Returns
true if the row is expandable.
TreeListRow& Gtk::TreeListRow::operator= ( TreeListRow&&  src)
noexcept
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gio::ListModel> > Gtk::TreeListRow::property_children ( ) const

The model holding the row's children.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< guint > Gtk::TreeListRow::property_depth ( ) const

The depth in the tree of this row.

Default value: 0

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeListRow::property_expandable ( ) const

If this row can ever be expanded.

Default value: false

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy< bool > Gtk::TreeListRow::property_expanded ( )

If this row is currently expanded.

Default value: false

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeListRow::property_expanded ( ) const

If this row is currently expanded.

Default value: false

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Glib::ObjectBase> > Gtk::TreeListRow::property_item ( ) const

The item held in this row.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
void Gtk::TreeListRow::set_expanded ( bool  expanded = true)

Expands or collapses a row.

If a row is expanded, the model of calling the Gtk::TreeListModelCreateModelFunc for the row's item will be inserted after this row. If a row is collapsed, those items will be removed from the model.

If the row is not expandable, this function does nothing.

Parameters
expandedtrue if the row should be expanded.

Friends And Related Function Documentation

Glib::RefPtr< Gtk::TreeListRow > wrap ( GtkTreeListRow *  object,
bool  take_copy = false 
)
related

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

Parameters
objectThe C instance.
take_copyFalse 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.