Top | ![]() |
![]() |
![]() |
![]() |
TeplWidgetListItem * | tepl_widget_list_item_new () |
void | tepl_widget_list_item_free () |
void | tepl_widget_list_item_set_widget () |
GtkWidget * | tepl_widget_list_item_get_widget () |
void | tepl_widget_list_item_set_displayed () |
gboolean | tepl_widget_list_item_get_displayed () |
void | tepl_widget_list_item_set_infos () |
void | tepl_widget_list_item_get_infos () |
TeplWidgetListItem contains a GtkWidget plus additional pieces of information.
All the values are controlled by the owner of the TeplWidgetListItem object.
The only exception is when receiving the “destroy” signal of the
currently associated widget, the "widget" property becomes NULL
.
"widget": The main content, as a GtkWidget.
"displayed": Whether the "widget" is currently displayed in the UI.
"name": An ID as a string. Not displayed in the UI. Uniquely identifies an item within a list.
"title": A human-readable title that can be shown in the UI to choose this item.
"icon-name": An icon-name representing this item, can be shown in the UI to choose this item. Can be used for “icon-name”.
TeplWidgetListItem is similar to the GtkStack child properties. Some differences:
This class is more abstract. It can be used in combination with GtkStack but also other types of GtkContainer's.
This class contains the "displayed" property, which permits to have several items displayed at the same time. Use-cases: split-views, or showing several documents side-by-side, or showing several components in a side panel, etc.
This class has maximum flexibility with regards to the GtkWidget: the
usual case is to set it just after calling tepl_widget_list_item_new()
, and
to show/hide it when displayed/undisplayed. But lazy initialization is
possible too, or destroying/re-creating the widget when needed, while still
having the other infos available and the item present in a list.
GtkStack emits signals when child properties change, while this class defer the responsibility of updating the state of other objects to the owner of the TeplWidgetListItem.
TeplWidgetListItem *
tepl_widget_list_item_new (void
);
[skip]
Since: 6.4
void
tepl_widget_list_item_free (TeplWidgetListItem *item
);
Since: 6.4
void tepl_widget_list_item_set_widget (TeplWidgetListItem *item
,GtkWidget *widget
);
Sets the "widget" property.
Since: 6.4
GtkWidget *
tepl_widget_list_item_get_widget (const TeplWidgetListItem *item
);
the "widget" property. Is NULL
when the
property isn't set, or if the widget has been destroyed (see the
“destroy” signal).
[transfer none][nullable]
Since: 6.4
void tepl_widget_list_item_set_displayed (TeplWidgetListItem *item
,gboolean displayed
);
Sets the "displayed" property.
Since: 6.4
gboolean
tepl_widget_list_item_get_displayed (const TeplWidgetListItem *item
);
Since: 6.4
void tepl_widget_list_item_set_infos (TeplWidgetListItem *item
,const gchar *name
,const gchar *title
,const gchar *icon_name
);
Sets some pieces of information to item
.
item |
||
name |
for the "name" property. |
[nullable] |
title |
for the "title" property. |
[nullable] |
icon_name |
for the "icon-name" property. |
[nullable] |
Since: 6.4
void tepl_widget_list_item_get_infos (const TeplWidgetListItem *item
,const gchar **name
,const gchar **title
,const gchar **icon_name
);
Gets some pieces of information from item
.
item |
||
name |
the "name" property. |
[out][transfer none][optional] |
title |
the "title" property. |
[out][transfer none][optional] |
icon_name |
the "icon-name" property. |
[out][transfer none][optional] |
Since: 6.4