gtkmm 4.16.0
|
Object used to represent items of a list model. More...
#include <gtkmm/listitem.h>
Public Member Functions | |
ListItem (ListItem &&src) noexcept | |
ListItem & | operator= (ListItem &&src) noexcept |
~ListItem () noexcept override | |
GtkListItem * | gobj () |
Provides access to the underlying C GObject. | |
const GtkListItem * | gobj () const |
Provides access to the underlying C GObject. | |
GtkListItem * | 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 model item that associated with self. | |
Glib::RefPtr< const Glib::ObjectBase > | get_item () const |
Gets the model item that associated with self. | |
guint | get_position () const |
Gets the position in the model that self currently displays. | |
bool | get_selected () const |
Checks if the item is displayed as selected. | |
bool | get_selectable () const |
Checks if a list item has been set to be selectable via set_selectable(). | |
void | set_selectable (bool selectable=true) |
Sets self to be selectable. | |
bool | get_activatable () const |
Checks if a list item has been set to be activatable via set_activatable(). | |
void | set_activatable (bool activatable=true) |
Sets self to be activatable. | |
bool | get_focusable () const |
Checks if a list item has been set to be focusable via set_focusable(). | |
void | set_focusable (bool focusable=true) |
Sets self to be focusable. | |
void | set_child (Widget &child) |
Sets the child to be used for this listitem. | |
void | unset_child () |
Widget * | get_child () |
Gets the child previously set via set_child() or nullptr if none was set. | |
const Widget * | get_child () const |
Gets the child previously set via set_child() or nullptr if none was set. | |
void | gtk_set_accessible_description (const Glib::ustring & description) |
Sets the accessible description for the list item, which may be used by e.g. screen readers. | |
Glib::ustring | get_accessible_description () const |
Gets the accessible description of self. | |
void | gtk_set_accessible_label (const Glib::ustring &label) |
Sets the accessible label for the list item, which may be used by e.g. screen readers. | |
Glib::ustring | get_accessible_label () const |
Gets the accessible label of self. | |
Glib::PropertyProxy< Glib::ustring > | property_accessible_description () |
The accessible description to set on the list item. | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_accessible_description () const |
The accessible description to set on the list item. | |
Glib::PropertyProxy< Glib::ustring > | property_accessible_label () |
The accessible label to set on the list item. | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_accessible_label () const |
The accessible label to set on the list item. | |
Glib::PropertyProxy< bool > | property_activatable () |
If the item can be activated by the user. | |
Glib::PropertyProxy_ReadOnly< bool > | property_activatable () const |
If the item can be activated by the user. | |
Glib::PropertyProxy< Widget * > | property_child () |
Widget used for display. | |
Glib::PropertyProxy_ReadOnly< Widget * > | property_child () const |
Widget used for display. | |
Glib::PropertyProxy< bool > | property_focusable () |
If the item can be focused with the keyboard. | |
Glib::PropertyProxy_ReadOnly< bool > | property_focusable () const |
If the item can be focused with the keyboard. | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Glib::ObjectBase > > | property_item () const |
Displayed item. | |
Glib::PropertyProxy_ReadOnly< guint > | property_position () const |
Position of the item. | |
Glib::PropertyProxy< bool > | property_selectable () |
If the item can be selected by the user. | |
Glib::PropertyProxy_ReadOnly< bool > | property_selectable () const |
If the item can be selected by the user. | |
Glib::PropertyProxy_ReadOnly< bool > | property_selected () const |
If the item is currently selected. | |
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::ListItem > | wrap (GtkListItem *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
Object used to represent items of a list model.
Gtk::ListItem is the object that list-handling containers such as Gtk::ListView use to represent items in a Gio::ListModel. They are managed by the container and cannot be created by application code.
Gtk::ListItems need to be populated by application code. This is done by calling set_child().
Gtk::ListItems exist in 2 stages:
|
noexcept |
|
overridenoexcept |
Glib::ustring Gtk::ListItem::get_accessible_description | ( | ) | const |
Glib::ustring Gtk::ListItem::get_accessible_label | ( | ) | const |
bool Gtk::ListItem::get_activatable | ( | ) | const |
Checks if a list item has been set to be activatable via set_activatable().
true
if the item is activatable. Widget * Gtk::ListItem::get_child | ( | ) |
Gets the child previously set via set_child() or nullptr
if none was set.
Gets the child previously set via set_child() or nullptr
if none was set.
bool Gtk::ListItem::get_focusable | ( | ) | const |
Checks if a list item has been set to be focusable via set_focusable().
true
if the item is focusable. Glib::RefPtr< Glib::ObjectBase > Gtk::ListItem::get_item | ( | ) |
Gets the model item that associated with self.
If self is unbound, this function returns nullptr
.
Glib::RefPtr< const Glib::ObjectBase > Gtk::ListItem::get_item | ( | ) | const |
Gets the model item that associated with self.
If self is unbound, this function returns nullptr
.
guint Gtk::ListItem::get_position | ( | ) | const |
Gets the position in the model that self currently displays.
If self is unbound, GTK_INVALID_LIST_POSITION is returned.
bool Gtk::ListItem::get_selectable | ( | ) | const |
Checks if a list item has been set to be selectable via set_selectable().
Do not confuse this function with get_selected().
true
if the item is selectable. bool Gtk::ListItem::get_selected | ( | ) | const |
Checks if the item is displayed as selected.
The selected state is maintained by the liste widget and its model and cannot be set otherwise.
true
if the item is selected.
|
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.
GtkListItem * Gtk::ListItem::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Sets the accessible description for the list item, which may be used by e.g. screen readers.
description | The description. |
Sets the accessible label for the list item, which may be used by e.g. screen readers.
label | The label. |
Glib::PropertyProxy< Glib::ustring > Gtk::ListItem::property_accessible_description | ( | ) |
The accessible description to set on the list item.
Default value: ""
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::ListItem::property_accessible_description | ( | ) | const |
The accessible description to set on the list item.
Default value: ""
Glib::PropertyProxy< Glib::ustring > Gtk::ListItem::property_accessible_label | ( | ) |
The accessible label to set on the list item.
Default value: ""
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::ListItem::property_accessible_label | ( | ) | const |
The accessible label to set on the list item.
Default value: ""
Glib::PropertyProxy< bool > Gtk::ListItem::property_activatable | ( | ) |
If the item can be activated by the user.
Default value: true
Glib::PropertyProxy_ReadOnly< bool > Gtk::ListItem::property_activatable | ( | ) | const |
If the item can be activated by the user.
Default value: true
Glib::PropertyProxy< Widget * > Gtk::ListItem::property_child | ( | ) |
Widget used for display.
Glib::PropertyProxy_ReadOnly< Widget * > Gtk::ListItem::property_child | ( | ) | const |
Widget used for display.
Glib::PropertyProxy< bool > Gtk::ListItem::property_focusable | ( | ) |
If the item can be focused with the keyboard.
Default value: true
Glib::PropertyProxy_ReadOnly< bool > Gtk::ListItem::property_focusable | ( | ) | const |
If the item can be focused with the keyboard.
Default value: true
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Glib::ObjectBase > > Gtk::ListItem::property_item | ( | ) | const |
Displayed item.
Glib::PropertyProxy_ReadOnly< guint > Gtk::ListItem::property_position | ( | ) | const |
Position of the item.
Default value: 4294967295
Glib::PropertyProxy< bool > Gtk::ListItem::property_selectable | ( | ) |
If the item can be selected by the user.
Default value: true
Glib::PropertyProxy_ReadOnly< bool > Gtk::ListItem::property_selectable | ( | ) | const |
If the item can be selected by the user.
Default value: true
Glib::PropertyProxy_ReadOnly< bool > Gtk::ListItem::property_selected | ( | ) | const |
If the item is currently selected.
Default value: false
Sets self to be activatable.
If an item is activatable, double-clicking on the item, using the Return key or calling Gtk::Widget::activate() will activate the item. Activating instructs the containing view to handle activation. Gtk::ListView
for example will be emitting the Gtk::ListView::signal_activate() signal.
By default, list items are activatable.
activatable | If the item should be activatable. |
Sets the child to be used for this listitem.
This function is typically called by applications when setting up a listitem so that the widget can be reused when binding it multiple times.
child | The list item's child or nullptr to unset. |
Sets self to be focusable.
If an item is focusable, it can be focused using the keyboard. This works similar to Gtk::Widget::set_focusable().
Note that if items are not focusable, the keyboard cannot be used to activate them and selecting only works if one of the listitem's children is focusable.
By default, list items are focusable.
focusable | If the item should be focusable. |
Sets self to be selectable.
If an item is selectable, clicking on the item or using the keyboard will try to select or unselect the item. If this succeeds is up to the model to determine, as it is managing the selected state.
Note that this means that making an item non-selectable has no influence on the selected state at all. A non-selectable item may still be selected.
By default, list items are selectable. When rebinding them to a new item, they will also be reset to be selectable by GTK.
selectable | If the item should be selectable. |
void Gtk::ListItem::unset_child | ( | ) |
|
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. |