gtkmm 4.16.0
|
A row in a Gtk::TreeListModel. More...
#include <gtkmm/treelistrow.h>
Public Member Functions | |
TreeListRow (TreeListRow &&src) noexcept | |
TreeListRow & | operator= (TreeListRow &&src) noexcept |
~TreeListRow () noexcept override | |
GtkTreeListRow * | gobj () |
Provides access to the underlying C GObject. | |
const GtkTreeListRow * | gobj () const |
Provides access to the underlying C GObject. | |
GtkTreeListRow * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
Glib::RefPtr< Glib::ObjectBase > | get_item () |
Gets the item corresponding to this row,. | |
Glib::RefPtr< const Glib::ObjectBase > | get_item () const |
Gets the item corresponding to this row,. | |
void | set_expanded (bool expanded=true) |
Expands or collapses a row. | |
bool | get_expanded () const |
Gets if a row is currently expanded. | |
bool | is_expandable () const |
Checks if a row can be expanded. | |
guint | get_position () const |
Returns the position in the Gtk::TreeListModel that self occupies at the moment. | |
guint | get_depth () const |
Gets the depth of this row. | |
Glib::RefPtr< Gio::ListModel > | get_children () |
If the row is expanded, gets the model holding the children of self. | |
Glib::RefPtr< const Gio::ListModel > | get_children () const |
If the row is expanded, gets the model holding the children of self. | |
Glib::RefPtr< TreeListRow > | get_parent () |
Gets the row representing the parent for self. | |
Glib::RefPtr< const TreeListRow > | get_parent () const |
Gets the row representing the parent for self. | |
Glib::RefPtr< TreeListRow > | get_child_row (guint position) |
If self is not expanded or position is greater than the number of children, nullptr is returned. | |
Glib::RefPtr< const TreeListRow > | get_child_row (guint position) const |
If self is not expanded or position is greater than the number of children, nullptr is returned. | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gio::ListModel > > | property_children () const |
The model holding the row's children. | |
Glib::PropertyProxy_ReadOnly< guint > | property_depth () const |
The depth in the tree of this row. | |
Glib::PropertyProxy_ReadOnly< bool > | property_expandable () const |
If this row can ever be expanded. | |
Glib::PropertyProxy< bool > | property_expanded () |
If this row is currently expanded. | |
Glib::PropertyProxy_ReadOnly< bool > | property_expanded () const |
If this row is currently expanded. | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Glib::ObjectBase > > | property_item () const |
The item held in this row. | |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gtk::TreeListRow > | wrap (GtkTreeListRow *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
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.
|
noexcept |
|
overridenoexcept |
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.
position | Position of the child to get. |
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.
position | Position of the child to get. |
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 [callb.nosp@m.ack@.nosp@m.Gtk.T.nosp@m.reeL.nosp@m.istMo.nosp@m.delC.nosp@m.reate.nosp@m.Mode.nosp@m.lFunc] and contains the original items, no matter what value Gtk::TreeListModel::property_passthrough() is set to.
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 [callb.nosp@m.ack@.nosp@m.Gtk.T.nosp@m.reeL.nosp@m.istMo.nosp@m.delC.nosp@m.reate.nosp@m.Mode.nosp@m.lFunc] and contains the original items, no matter what value Gtk::TreeListModel::property_passthrough() is set to.
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 removed from its model at which point it will forever return 0.
bool Gtk::TreeListRow::get_expanded | ( | ) | const |
Gets if a row is currently expanded.
true
if the row is expanded. Glib::RefPtr< Glib::ObjectBase > Gtk::TreeListRow::get_item | ( | ) |
Gets the item corresponding to this row,.
Glib::RefPtr< const Glib::ObjectBase > Gtk::TreeListRow::get_item | ( | ) | const |
Gets the item corresponding to this row,.
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 removed from its model at which point it will forever return nullptr
.
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 removed from its model at which point it will forever return nullptr
.
guint Gtk::TreeListRow::get_position | ( | ) | const |
Returns the position in the Gtk::TreeListModel
that self occupies at the moment.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
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 removed from its model at which point it will forever return false
.
true
if the row is expandable.
|
noexcept |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gio::ListModel > > Gtk::TreeListRow::property_children | ( | ) | const |
The model holding the row's children.
Glib::PropertyProxy_ReadOnly< guint > Gtk::TreeListRow::property_depth | ( | ) | const |
The depth in the tree of this row.
Default value: 0
Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeListRow::property_expandable | ( | ) | const |
If this row can ever be expanded.
Default value: false
Glib::PropertyProxy< bool > Gtk::TreeListRow::property_expanded | ( | ) |
If this row is currently expanded.
Default value: false
Glib::PropertyProxy_ReadOnly< bool > Gtk::TreeListRow::property_expanded | ( | ) | const |
If this row is currently expanded.
Default value: false
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Glib::ObjectBase > > Gtk::TreeListRow::property_item | ( | ) | const |
The item held in this row.
Expands or collapses a row.
If a row is expanded, the model of calling the [callb.nosp@m.ack@.nosp@m.Gtk.T.nosp@m.reeL.nosp@m.istMo.nosp@m.delC.nosp@m.reate.nosp@m.Mode.nosp@m.lFunc] 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.
expanded | true if the row should be expanded. |
|
related |
A Glib::wrap() method for this object.
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. |