Languages

Menu
Sites
Language
Can I add text value to the Genlist widget elm.swallow.end part

As below, the Genlist widget double_label style layout detail. I want to use a text value to replace the right icon part(elm.swallow.end), can I ?

double_label elm.text: for the main text.

elm.text.sub: for the sub text.

elm.swallow.icon: for the icon on the left.

elm.swallow.end: for the icon on the right.

 

Responses

1 Replies
colin Rao

F.Y.I

As below code, I just to return a label in the content get callback function. (Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new(); itc->func.content_get = _genlist_content_get;)

static Evas_Object *
_genlist_content_get(void *data, Evas_Object *obj, const char *part)
{
    int i = (int) (uintptr_t) data;

    if (strcmp(part, "elm.swallow.icon") == 0) {
        //...
    }
    else if (strcmp(part, "elm.swallow.end") == 0) {
	Evas_Object *label = NULL;
	label = elm_label_add(obj);
	elm_object_text_set(label, "<font_size=20>Jan 13</font_size>");
	return label;
    }
    else {
        return NULL;
    }
}

Is it a right way?