This example doesn't present any other feature that is not already present in the other examples, but visually shows the difference between using the default list options (first list of the example), setting the horizontal mode to ELM_LIST_LIMIT (second list), enabling compress mode (third list) and using height_for_width option (fourth list).
The full code for this example is listed below:
#include <Elementary.h>
#define N_ITEMS 30
static char *
{
char buf[256];
int i = (int)(uintptr_t)data;
if (!strcmp(part, "elm.text"))
snprintf(buf, sizeof(buf), "Item # %i", i);
else
{
int n;
snprintf(buf, sizeof(buf), "created at %s", ctime(&t));
n = strlen(buf);
buf[n - 1] = '\0';
}
return strdup(buf);
}
{
if (!strcmp(part, "elm.swallow.icon"))
return ic;
}
static void
_item_sel_cb(
void *data,
Evas_Object *obj,
void *event_info)
{
printf("sel item data [%p] on genlist obj [%p], item pointer [%p]\n",
data, obj, event_info);
}
{
return list;
}
static void
{
unsigned int i;
for (i = 0; i < N_ITEMS; i++)
{
(void *)(uintptr_t)i, NULL,
_item_sel_cb, NULL);
}
}
EAPI_MAIN int
{
if (!_itc)
{
}
list = _genlist_add(box);
_genlist_fill(list);
list = _genlist_add(box);
_genlist_fill(list);
list = _genlist_add(box);
_genlist_fill(list);
return 0;
}
And the screenshot of the running example: