Macros | |
#define | ELM_LIST_CLASS elm_list_class_get() |
Elementary list class. | |
#define | ELM_LIST_EVENT_ACTIVATED (&(_ELM_LIST_EVENT_ACTIVATED)) |
Called when activated. More... | |
#define | ELM_LIST_EVENT_EDGE_TOP (&(_ELM_LIST_EVENT_EDGE_TOP)) |
Called when top edge was reached. | |
#define | ELM_LIST_EVENT_EDGE_BOTTOM (&(_ELM_LIST_EVENT_EDGE_BOTTOM)) |
Called when bottom edge was reached. | |
#define | ELM_LIST_EVENT_EDGE_LEFT (&(_ELM_LIST_EVENT_EDGE_LEFT)) |
Called when left edge was reached. | |
#define | ELM_LIST_EVENT_EDGE_RIGHT (&(_ELM_LIST_EVENT_EDGE_RIGHT)) |
Called when right edge was reached. | |
#define | ELM_LIST_EVENT_SWIPE (&(_ELM_LIST_EVENT_SWIPE)) |
Called when swipe is detected. More... | |
#define | ELM_LIST_EVENT_HIGHLIGHTED (&(_ELM_LIST_EVENT_HIGHLIGHTED)) |
Called when highlighted. More... | |
#define | ELM_LIST_EVENT_UNHIGHLIGHTED (&(_ELM_LIST_EVENT_UNHIGHLIGHTED)) |
Called when no longer highlighted. More... | |
#define | ELM_LIST_EVENT_ITEM_FOCUSED (&(_ELM_LIST_EVENT_ITEM_FOCUSED)) |
Called when item got focus. More... | |
#define | ELM_LIST_EVENT_ITEM_UNFOCUSED (&(_ELM_LIST_EVENT_ITEM_UNFOCUSED)) |
Called when item no longer has focus. More... | |
Enumerations | |
enum | Elm_List_Mode { ELM_LIST_COMPRESS = 0, ELM_LIST_SCROLL, ELM_LIST_LIMIT, ELM_LIST_EXPAND, ELM_LIST_LAST } |
Set list's resizing behavior, transverse axis scrolling and items cropping. More... | |
Functions | |
EINA_DEPRECATED void | elm_list_bounce_set (Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) |
Set bouncing behaviour when the scrolled content reaches an edge. More... | |
EINA_DEPRECATED void | elm_list_bounce_get (const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce) |
Get the bouncing behaviour of the internal scroller. More... | |
EINA_DEPRECATED void | elm_list_scroller_policy_set (Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v) |
Set the scrollbar policy. More... | |
EINA_DEPRECATED void | elm_list_scroller_policy_get (const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v) |
Get the scrollbar policy. More... | |
EOAPI void | elm_obj_list_horizontal_set (Eo *obj, Eina_Bool horizontal) |
Control horizontal mode on the list object. More... | |
EOAPI Eina_Bool | elm_obj_list_horizontal_get (const Eo *obj) |
Control horizontal mode on the list object. More... | |
EOAPI void | elm_obj_list_select_mode_set (Eo *obj, Elm_Object_Select_Mode mode) |
Control the list select mode. More... | |
EOAPI Elm_Object_Select_Mode | elm_obj_list_select_mode_get (const Eo *obj) |
Control the list select mode. More... | |
EOAPI void | elm_obj_list_focus_on_selection_set (Eo *obj, Eina_Bool enabled) |
Control focus upon items selection mode. More... | |
EOAPI Eina_Bool | elm_obj_list_focus_on_selection_get (const Eo *obj) |
Control focus upon items selection mode. More... | |
EOAPI void | elm_obj_list_multi_select_set (Eo *obj, Eina_Bool multi) |
Control multiple items selection on the list object. More... | |
EOAPI Eina_Bool | elm_obj_list_multi_select_get (const Eo *obj) |
Control multiple items selection on the list object. More... | |
EOAPI void | elm_obj_list_multi_select_mode_set (Eo *obj, Elm_Object_Multi_Select_Mode mode) |
Control the list multi select mode. More... | |
EOAPI Elm_Object_Multi_Select_Mode | elm_obj_list_multi_select_mode_get (const Eo *obj) |
Control the list multi select mode. More... | |
EOAPI void | elm_obj_list_mode_set (Eo *obj, Elm_List_Mode mode) |
Control which mode to use for the list object. More... | |
EOAPI Elm_List_Mode | elm_obj_list_mode_get (const Eo *obj) |
Control which mode to use for the list object. More... | |
EOAPI Elm_Widget_Item * | elm_obj_list_selected_item_get (const Eo *obj) |
Get the selected item. More... | |
EOAPI const Eina_List * | elm_obj_list_items_get (const Eo *obj) |
Get a list of all the list items. More... | |
EOAPI Elm_Widget_Item * | elm_obj_list_first_item_get (const Eo *obj) |
Get the first item in the list. More... | |
EOAPI const Eina_List * | elm_obj_list_selected_items_get (const Eo *obj) |
Return a list of the currently selected list items. More... | |
EOAPI Elm_Widget_Item * | elm_obj_list_last_item_get (const Eo *obj) |
Get the last item in the list. More... | |
EOAPI Elm_Widget_Item * | elm_obj_list_item_insert_before (Eo *obj, Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data) |
Insert a new item into the list object before item before . More... | |
EOAPI void | elm_obj_list_go (Eo *obj) |
Starts the list. More... | |
EOAPI Elm_Widget_Item * | elm_obj_list_item_insert_after (Eo *obj, Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data) |
Insert a new item into the list object after item after . More... | |
EOAPI Elm_Widget_Item * | elm_obj_list_at_xy_item_get (const Eo *obj, int x, int y, int *posret) |
Get the item that is at the x, y canvas coords. More... | |
EOAPI Elm_Widget_Item * | elm_obj_list_item_append (Eo *obj, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data) |
Append a new item to the list object. More... | |
EOAPI Elm_Widget_Item * | elm_obj_list_item_prepend (Eo *obj, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data) |
Prepend a new item to the list object. More... | |
EOAPI void | elm_obj_list_clear (Eo *obj) |
Remove all list's items. | |
EOAPI Elm_Widget_Item * | elm_obj_list_item_sorted_insert (Eo *obj, const char *label, Efl_Canvas_Object *icon, Efl_Canvas_Object *end, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func) |
Insert a new item into the sorted list object. More... | |
Evas_Object * | elm_list_add (Evas_Object *parent) |
Add a new list widget to the given parent Elementary (container) object. More... | |
A list widget is a container whose children are displayed vertically or horizontally, in order, and can be selected. The list can accept only one or multiple item selections. Also has many modes of items displaying.
A list is a very simple type of list widget. For more robust lists, Genlist should probably be used.
This widget inherits from the Layout one, so that all the functions acting on it also work for list objects.
This widget emits the following signals, besides the ones sent from Layout:
"activated"
- The user has double-clicked or pressed (enter|return|spacebar) on an item. The event_info
parameter is the item that was activated."clicked,double"
- The user has double-clicked an item. The event_info
parameter is the item that was double-clicked."clicked,right"
- The user has right-clicked an item. The event_info
parameter is the item that was right-clicked. (since 1.13)"selected"
- when the user selected an item"unselected"
- when the user unselected an item"longpressed"
- an item in the list is long-pressed"edge,top"
- the list is scrolled until the top edge"edge,bottom"
- the list is scrolled until the bottom edge"edge,left"
- the list is scrolled until the left edge"edge,right"
- the list is scrolled until the right edge"highlighted"
- an item in the list is highlighted. This is called when the user presses an item or keyboard selection is done so the item is physically highlighted. The event_info
parameter is the item that was highlighted."unhighlighted"
- an item in the list is unhighlighted. This is called when the user releases an item or keyboard selection is moved so the item is physically unhighlighted. The event_info
parameter is the item that was unhighlighted."language,changed"
- the program's language changed"focused"
- When the list has received focus. (since 1.8)"unfocused"
- When the list has lost focus. (since 1.8)"item,focused"
- When the list item has received focus. (since 1.10)"item,unfocused"
- When the list item has lost focus. (since 1.10)Available styles for it are:
"default"
Default content parts of the list items that you can use are:
"start"
- A start position object in the list item "end"
- An end position object in the list item Another parts for customized styles are not accepted.Default text parts of the list items that you can use are:
"default"
- A label in the list item Another parts for customized styles are not accepted.Supported elm_object_item
common APIs.
This widget implements the elm-scrollable-interface interface, so that all (non-deprecated) functions for the base Scroller widget also work for lists.
Some calls on the list's API are marked as deprecated, as they just wrap the scrollable widgets counterpart functions. Use the ones we point you to, for each case of deprecation here, instead – eventually the deprecated ones will be discarded (next major release).
List of examples:
#define ELM_LIST_EVENT_ACTIVATED (&(_ELM_LIST_EVENT_ACTIVATED)) |
Called when activated.
#define ELM_LIST_EVENT_SWIPE (&(_ELM_LIST_EVENT_SWIPE)) |
Called when swipe is detected.
#define ELM_LIST_EVENT_HIGHLIGHTED (&(_ELM_LIST_EVENT_HIGHLIGHTED)) |
Called when highlighted.
#define ELM_LIST_EVENT_UNHIGHLIGHTED (&(_ELM_LIST_EVENT_UNHIGHLIGHTED)) |
Called when no longer highlighted.
#define ELM_LIST_EVENT_ITEM_FOCUSED (&(_ELM_LIST_EVENT_ITEM_FOCUSED)) |
Called when item got focus.
#define ELM_LIST_EVENT_ITEM_UNFOCUSED (&(_ELM_LIST_EVENT_ITEM_UNFOCUSED)) |
Called when item no longer has focus.
enum Elm_List_Mode |
Set list's resizing behavior, transverse axis scrolling and items cropping.
See each mode's description for more details.
Values here don't work as bitmasks – only one can be chosen at a time.
Enumerator | |
---|---|
ELM_LIST_COMPRESS | The list won't set any of its size hints to inform how a possible container should resize it. Then, if it's not created as a "resize object", it might end with zeroed dimensions. The list will respect the container's geometry and, if any of its items won't fit into its transverse axis, one won't be able to scroll it in that direction. |
ELM_LIST_SCROLL | Default value. This is the same as ELM_LIST_COMPRESS, with the exception that if any of its items won't fit into its transverse axis, one will be able to scroll it in that direction. |
ELM_LIST_LIMIT | Sets a minimum size hint on the list object, so that containers may respect it (and resize itself to fit the child properly). More specifically, a minimum size hint will be set for its transverse axis, so that the largest item in that direction fits well. This is naturally bound by the list object's maximum size hints, set externally. |
ELM_LIST_EXPAND | Besides setting a minimum size on the transverse axis, just like on ELM_LIST_LIMIT, the list will set a minimum size on the longitudinal axis, trying to reserve space to all its children to be visible at a time. . This is naturally bound by the list object's maximum size hints, set externally. |
ELM_LIST_LAST | Indicates error if returned by elm_list_mode_get(). |
EINA_DEPRECATED void elm_list_bounce_set | ( | Evas_Object * | obj, |
Eina_Bool | h_bounce, | ||
Eina_Bool | v_bounce | ||
) |
Set bouncing behaviour when the scrolled content reaches an edge.
Tell the internal scroller object whether it should bounce or not when it reaches the respective edges for each axis.
obj | The list object |
h_bounce | Whether to bounce or not in the horizontal axis. |
v_bounce | Whether to bounce or not in the vertical axis. |
EINA_DEPRECATED void elm_list_bounce_get | ( | const Evas_Object * | obj, |
Eina_Bool * | h_bounce, | ||
Eina_Bool * | v_bounce | ||
) |
Get the bouncing behaviour of the internal scroller.
Get whether the internal scroller should bounce when the edge of each axis is reached scrolling.
obj | The list object. |
h_bounce | Pointer to store the bounce state of the horizontal axis. |
v_bounce | Pointer to store the bounce state of the vertical axis. |
EINA_DEPRECATED void elm_list_scroller_policy_set | ( | Evas_Object * | obj, |
Elm_Scroller_Policy | policy_h, | ||
Elm_Scroller_Policy | policy_v | ||
) |
Set the scrollbar policy.
obj | The list object |
policy_h | Horizontal scrollbar policy. |
policy_v | Vertical scrollbar policy. |
This sets the scrollbar visibility policy for the given scroller. ELM_SCROLLER_POLICY_AUTO means the scrollbar is made visible if it is needed, and otherwise kept hidden. ELM_SCROLLER_POLICY_ON turns it on all the time, and ELM_SCROLLER_POLICY_OFF always keeps it off. This applies respectively for the horizontal and vertical scrollbars.
The both are disabled by default, i.e., are set to ELM_SCROLLER_POLICY_OFF.
References efl_super(), and ELM_SCROLLER_POLICY_LAST.
EINA_DEPRECATED void elm_list_scroller_policy_get | ( | const Evas_Object * | obj, |
Elm_Scroller_Policy * | policy_h, | ||
Elm_Scroller_Policy * | policy_v | ||
) |
Get the scrollbar policy.
obj | The list object. |
policy_h | Pointer to store horizontal scrollbar policy. |
policy_v | Pointer to store vertical scrollbar policy. |
References _Eina_List::data, efl_del(), efl_ref(), efl_unref(), EINA_FALSE, eina_list_append(), eina_list_append_relative_list(), eina_list_data_find_list(), eina_list_data_get(), EINA_LIST_FOREACH, eina_list_free(), eina_list_last(), eina_list_next(), eina_list_prepend(), eina_list_prepend_relative_list(), eina_list_sorted_insert(), EINA_SAFETY_ON_NULL_RETURN_VAL, EINA_TRUE, elm_layout_sizing_eval(), elm_object_item_focus_set(), evas_object_geometry_get(), evas_smart_objects_calculate(), _Eina_List::next, and _Eina_List::prev.
Control horizontal mode on the list object.
On horizontal mode items are displayed on list from left to right, instead of from top to bottom. Also, the list will scroll horizontally. Each item will presents left icon on top and right icon, or end, at the bottom.
[in] | obj | The object. |
[in] | horizontal | true to enable horizontal or false to disable it, i.e., to enable vertical mode. |
Control horizontal mode on the list object.
On horizontal mode items are displayed on list from left to right, instead of from top to bottom. Also, the list will scroll horizontally. Each item will presents left icon on top and right icon, or end, at the bottom.
[in] | obj | The object. |
true
to enable horizontal or false
to disable it, i.e., to enable vertical mode. EOAPI void elm_obj_list_select_mode_set | ( | Eo * | obj, |
Elm_Object_Select_Mode | mode | ||
) |
Control the list select mode.
elm_list_select_mode_set() changes item select mode in the list widget. - ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their selection func and callback when first becoming selected. Any further clicks will do nothing, unless you set always select mode. - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, every click will make the selected callbacks be called. - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select items entirely and they will neither appear selected nor call selected callback functions.
[in] | obj | The object. |
[in] | mode | The select mode |
EOAPI Elm_Object_Select_Mode elm_obj_list_select_mode_get | ( | const Eo * | obj | ) |
Control the list select mode.
elm_list_select_mode_set() changes item select mode in the list widget. - ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their selection func and callback when first becoming selected. Any further clicks will do nothing, unless you set always select mode. - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected, every click will make the selected callbacks be called. - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select items entirely and they will neither appear selected nor call selected callback functions.
[in] | obj | The object. |
Control focus upon items selection mode.
When enabled, every selection of an item inside the genlist will automatically set focus to its first focusable widget from the left. This is true of course if the selection was made by clicking an unfocusable area in an item or selecting it with a key movement. Clicking on a focusable widget inside an item will cause this particular item to get focus as usual.
[in] | obj | The object. |
[in] | enabled | The tree effect status ($true = enabled, false = disabled) |
Control focus upon items selection mode.
When enabled, every selection of an item inside the genlist will automatically set focus to its first focusable widget from the left. This is true of course if the selection was made by clicking an unfocusable area in an item or selecting it with a key movement. Clicking on a focusable widget inside an item will cause this particular item to get focus as usual.
[in] | obj | The object. |
false
= disabled) Control multiple items selection on the list object.
Disabled by default. If disabled, the user can select a single item of the list each time. Selected items are highlighted on list. If enabled, many items can be selected.
If a selected item is selected again, it will be unselected.
[in] | obj | The object. |
[in] | multi | true to enable multi selection or false to disable it. |
Control multiple items selection on the list object.
Disabled by default. If disabled, the user can select a single item of the list each time. Selected items are highlighted on list. If enabled, many items can be selected.
If a selected item is selected again, it will be unselected.
[in] | obj | The object. |
true
to enable multi selection or false
to disable it. EOAPI void elm_obj_list_multi_select_mode_set | ( | Eo * | obj, |
Elm_Object_Multi_Select_Mode | mode | ||
) |
Control the list multi select mode.
See: elm_obj_list_multi_select_get
[in] | obj | The object. |
[in] | mode | The multi select mode |
EOAPI Elm_Object_Multi_Select_Mode elm_obj_list_multi_select_mode_get | ( | const Eo * | obj | ) |
Control the list multi select mode.
See: elm_obj_list_multi_select_get
[in] | obj | The object. |
EOAPI void elm_obj_list_mode_set | ( | Eo * | obj, |
Elm_List_Mode | mode | ||
) |
Control which mode to use for the list object.
Set list's resize behavior, transverse axis scroll and items cropping. See each mode's description for more details.
Only one mode at a time can be set. If a previous one was set, it will be changed by the new mode after this call. Bitmasks won't work here as well.
[in] | obj | The object. |
[in] | mode | One of Elm_List_Mode: ELM_LIST_COMPRESS, ELM_LIST_SCROLL, ELM_LIST_LIMIT or ELM_LIST_EXPAND. |
EOAPI Elm_List_Mode elm_obj_list_mode_get | ( | const Eo * | obj | ) |
Control which mode to use for the list object.
Set list's resize behavior, transverse axis scroll and items cropping. See each mode's description for more details.
Only one mode at a time can be set. If a previous one was set, it will be changed by the new mode after this call. Bitmasks won't work here as well.
[in] | obj | The object. |
EOAPI Elm_Widget_Item* elm_obj_list_selected_item_get | ( | const Eo * | obj | ) |
Get the selected item.
The selected item can be unselected with function elm_list_item_selected_set().
The selected item always will be highlighted on list.
[in] | obj | The object. |
Get a list of all the list items.
[in] | obj | The object. |
list
of list items, #Elm.Widget.Item, or NULL
on failure. EOAPI Elm_Widget_Item* elm_obj_list_first_item_get | ( | const Eo * | obj | ) |
Get the first item in the list.
This returns the first item in the list.
[in] | obj | The object. |
Return a list of the currently selected list items.
Multiple items can be selected if multi select is enabled. It can be done with elm_list_multi_select_set().
[in] | obj | The object. |
list
of list items, #Elm.Widget.Item, or NULL
on failure. EOAPI Elm_Widget_Item* elm_obj_list_last_item_get | ( | const Eo * | obj | ) |
Get the last item in the list.
This returns the last item in the list.
[in] | obj | The object. |
EOAPI Elm_Widget_Item* elm_obj_list_item_insert_before | ( | Eo * | obj, |
Elm_Widget_Item * | before, | ||
const char * | label, | ||
Efl_Canvas_Object * | icon, | ||
Efl_Canvas_Object * | end, | ||
Evas_Smart_Cb | func, | ||
const void * | data | ||
) |
Insert a new item into the list object before item before
.
A new item will be created and added to the list. Its position in this list will be just before item before
.
Items created with this method can be deleted with elm_object_item_del().
Associated data
can be properly freed when item is deleted if a callback function is set with elm_object_item_del_cb_set().
If a function is passed as argument, it will be called every time this item is selected, i.e., the user clicks over an unselected item. If always select is enabled it will call this function every time user clicks over an item (already selected or not). If such function isn't needed, just passing NULL
as func
is enough. The same should be done for data
.
[in] | obj | The object. |
[in] | before | The list item to insert before. |
[in] | label | The label of the list item. |
[in] | icon | The icon object to use for the left side of the item. An icon can be any Evas object, but usually it is an icon created with elm_icon_add(). |
[in] | end | The icon object to use for the right side of the item. An icon can be any Evas object. |
[in] | func | The function to call when the item is clicked. |
[in] | data | The data to associate with the item for related callbacks. |
NULL
upon failure. EOAPI void elm_obj_list_go | ( | Eo * | obj | ) |
Starts the list.
[in] | obj | The object. |
EOAPI Elm_Widget_Item* elm_obj_list_item_insert_after | ( | Eo * | obj, |
Elm_Widget_Item * | after, | ||
const char * | label, | ||
Efl_Canvas_Object * | icon, | ||
Efl_Canvas_Object * | end, | ||
Evas_Smart_Cb | func, | ||
const void * | data | ||
) |
Insert a new item into the list object after item after
.
A new item will be created and added to the list. Its position in this list will be just after item after
.
Items created with this method can be deleted with elm_object_item_del().
Associated data
can be properly freed when item is deleted if a callback function is set with elm_object_item_del_cb_set().
If a function is passed as argument, it will be called every time this item is selected, i.e., the user clicks over an unselected item. If always select is enabled it will call this function every time user clicks over an item (already selected or not). If such function isn't needed, just passing NULL
as func
is enough. The same should be done for data
.
[in] | obj | The object. |
[in] | after | The list item to insert after. |
[in] | label | The label of the list item. |
[in] | icon | The icon object to use for the left side of the item. An icon can be any Evas object, but usually it is an icon created with elm_icon_add(). |
[in] | end | The icon object to use for the right side of the item. An icon can be any Evas object. |
[in] | func | The function to call when the item is clicked. |
[in] | data | The data to associate with the item for related callbacks. |
NULL
upon failure. EOAPI Elm_Widget_Item* elm_obj_list_at_xy_item_get | ( | const Eo * | obj, |
int | x, | ||
int | y, | ||
int * | posret | ||
) |
Get the item that is at the x, y canvas coords.
This returns the item at the given coordinates (which are canvas relative, not object-relative). If an item is at that coordinate, that item handle is returned, and if posret
is not NULL, the integer pointed to is set to a value of -1, 0 or 1, depending if the coordinate is on the upper portion of that item (-1), on the middle section (0) or on the lower part (1). If NULL is returned as an item (no item found there), then posret may indicate -1 or 1 based if the coordinate is above or below all items respectively in the list.
[in] | obj | The object. |
[in] | x | The input x coordinate |
[in] | y | The input y coordinate |
[out] | posret | The position relative to the item returned here |
EOAPI Elm_Widget_Item* elm_obj_list_item_append | ( | Eo * | obj, |
const char * | label, | ||
Efl_Canvas_Object * | icon, | ||
Efl_Canvas_Object * | end, | ||
Evas_Smart_Cb | func, | ||
const void * | data | ||
) |
Append a new item to the list object.
A new item will be created and appended to the list, i.e., will be set as last item.
Items created with this method can be deleted with elm_object_item_del().
Associated data
can be properly freed when item is deleted if a callback function is set with elm_object_item_del_cb_set().
If a function is passed as argument, it will be called every time this item is selected, i.e., the user clicks over an unselected item. If always select is enabled it will call this function every time user clicks over an item (already selected or not). If such function isn't needed, just passing NULL
as func
is enough. The same should be done for data
.
[in] | obj | The object. |
[in] | label | The label of the list item. |
[in] | icon | The icon object to use for the left side of the item. An icon can be any Evas object, but usually it is an icon created with elm_icon_add(). |
[in] | end | The icon object to use for the right side of the item. An icon can be any Evas object. |
[in] | func | The function to call when the item is clicked. |
[in] | data | The data to associate with the item for related callbacks. |
NULL
upon failure. EOAPI Elm_Widget_Item* elm_obj_list_item_prepend | ( | Eo * | obj, |
const char * | label, | ||
Efl_Canvas_Object * | icon, | ||
Efl_Canvas_Object * | end, | ||
Evas_Smart_Cb | func, | ||
const void * | data | ||
) |
Prepend a new item to the list object.
A new item will be created and prepended to the list, i.e., will be set as first item.
Items created with this method can be deleted with elm_object_item_del().
Associated data
can be properly freed when item is deleted if a callback function is set with elm_object_item_del_cb_set().
If a function is passed as argument, it will be called every time this item is selected, i.e., the user clicks over an unselected item. If always select is enabled it will call this function every time user clicks over an item (already selected or not). If such function isn't needed, just passing NULL
as func
is enough. The same should be done for data
.
[in] | obj | The object. |
[in] | label | The label of the list item. |
[in] | icon | The icon object to use for the left side of the item. An icon can be any Evas object, but usually it is an icon created with elm_icon_add(). |
[in] | end | The icon object to use for the right side of the item. An icon can be any Evas object. |
[in] | func | The function to call when the item is clicked. |
[in] | data | The data to associate with the item for related callbacks. |
NULL
upon failure. EOAPI Elm_Widget_Item* elm_obj_list_item_sorted_insert | ( | Eo * | obj, |
const char * | label, | ||
Efl_Canvas_Object * | icon, | ||
Efl_Canvas_Object * | end, | ||
Evas_Smart_Cb | func, | ||
const void * | data, | ||
Eina_Compare_Cb | cmp_func | ||
) |
Insert a new item into the sorted list object.
A new item will be created and added to the list. Its position in this list will be found comparing the new item with previously inserted items using function cmp_func
.
Items created with this method can be deleted with elm_object_item_del().
Associated data
can be properly freed when item is deleted if a callback function is set with elm_object_item_del_cb_set().
If a function is passed as argument, it will be called every time this item is selected, i.e., the user clicks over an unselected item. If always select is enabled it will call this function every time user clicks over an item (already selected or not). If such function isn't needed, just passing NULL
as func
is enough. The same should be done for data
.
[in] | obj | The object. |
[in] | label | The label of the list item. |
[in] | icon | The icon object to use for the left side of the item. An icon can be any Evas object, but usually it is an icon created with elm_icon_add(). |
[in] | end | The icon object to use for the right side of the item. An icon can be any Evas object. |
[in] | func | The function to call when the item is clicked. |
[in] | data | The data to associate with the item for related callbacks. |
[in] | cmp_func | The comparing function to be used to sort list items by #Elm.Widget.Item item handles. This function will receive two items and compare them, returning a non-negative integer if the second item should be place after the first, or negative value if should be placed before. |
NULL
upon failure. Evas_Object* elm_list_add | ( | Evas_Object * | parent | ) |
Add a new list widget to the given parent Elementary (container) object.
parent | The parent object. |
NULL
, on errors.This function inserts a new list widget on the canvas.
References efl_super(), EINA_FALSE, EINA_LIST_FOREACH, EINA_SAFETY_ON_NULL_RETURN_VAL, ELM_OBJECT_MULTI_SELECT_MODE_MAX, ELM_OBJECT_SELECT_MODE_MAX, EVAS_HINT_EXPAND, EVAS_HINT_FILL, evas_object_smart_callbacks_descriptions_set(), and _Elm_List_Data::multi_select_mode.