class Gtk::TreeListRow

Overview

The type of item used by Gtk::TreeListModel.

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#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.

Defined in:

lib/gi-crystal/src/auto/gtk-4.0/tree_list_row.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class GObject::Object

==(other : self) ==, bind_property(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags) : GObject::Binding bind_property, bind_property_full(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags, transform_to : GObject::Closure, transform_from : GObject::Closure) : GObject::Binding bind_property_full, data(key : String) : Pointer(Void) | Nil data, finalize finalize, freeze_notify : Nil freeze_notify, getv(names : Enumerable(String), values : Enumerable(_)) : Nil getv, hash(hasher) hash, notify(property_name : String) : Nil notify, notify_by_pspec(pspec : GObject::ParamSpec) : Nil notify_by_pspec, notify_signal notify_signal, property(property_name : String, value : _) : Nil property, qdata(quark : UInt32) : Pointer(Void) | Nil qdata, ref_count : UInt32 ref_count, run_dispose : Nil run_dispose, set_data(key : String, data : Pointer(Void) | Nil) : Nil set_data, set_property(property_name : String, value : _) : Nil set_property, steal_data(key : String) : Pointer(Void) | Nil steal_data, steal_qdata(quark : UInt32) : Pointer(Void) | Nil steal_qdata, thaw_notify : Nil thaw_notify, to_unsafe : Pointer(Void) to_unsafe, watch_closure(closure : GObject::Closure) : Nil watch_closure

Constructor methods inherited from class GObject::Object

cast(obj : GObject::Object) : self cast, new(pointer : Pointer(Void), transfer : GICrystal::Transfer)
new
new
, newv(object_type : UInt64, parameters : Enumerable(GObject::Parameter)) : self newv

Class methods inherited from class GObject::Object

cast?(obj : GObject::Object) : self | Nil cast?, compat_control(what : UInt64, data : Pointer(Void) | Nil) : UInt64 compat_control, g_type : UInt64 g_type, interface_find_property(g_iface : GObject::TypeInterface, property_name : String) : GObject::ParamSpec interface_find_property, interface_list_properties(g_iface : GObject::TypeInterface) : Enumerable(GObject::ParamSpec) interface_list_properties

Macros inherited from class GObject::Object

previous_vfunc(*args) previous_vfunc, previous_vfunc!(*args) previous_vfunc!, signal(signature) signal

Constructor Detail

def self.new #

Initialize a new TreeListRow.


def self.new(*, children : Gio::ListModel | Nil = nil, depth : UInt32 | Nil = nil, expandable : Bool | Nil = nil, expanded : Bool | Nil = nil, item : GObject::Object | Nil = nil) #

Class Method Detail

def self.g_type : UInt64 #

Returns the type id (GType) registered in GLib type system.


Instance Method Detail

def ==(other : self) #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


def child_row(position : UInt32) : Gtk::TreeListRow | Nil #

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


def children : Gio::ListModel | Nil #

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#passthrough is set to.


def depth : UInt32 #

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.


def expandable? : Bool #

def expanded : Bool #

Gets if a row is currently expanded.


def expanded=(expanded : Bool) : Nil #

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.


def expanded? : Bool #

def hash(hasher) #
Description copied from class Reference

See Object#hash(hasher)


def is_expandable? : Bool #

Checks if a row can be expanded.

This does not mean that the row is actually expanded, this can be checked with Gtk::TreeListRow#expanded.

If a row is expandable never changes until the row is removed from its model at which point it will forever return false.


def item : GObject::Object | Nil #

Gets the item corresponding to this row,


def parent : Gtk::TreeListRow | Nil #

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, nil 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 nil.


def position : UInt32 #

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