Mobile native

Icon

This feature is supported in mobile applications only.

The icon component inherits from the image component. It is used to display images in an icon context.

Figure: Icon component

Icon component

Figure: Icon hierarchy

Icon hierarchy

Adding an Icon Component

You can create an icon and set it as a freedesktop.org Home standard icon.

Evas_Object *icon, *parent;
icon = elm_icon_add(parent);
elm_icon_standard_set(icon, "Home");

Changing Image File

You can change the image by using an image in the filesystem (for example, /tmp/Home.png).

elm_image_file_set(icon, "/tmp/Home.png", NULL);

You can also use a group in an Edje file (for example, /tmp/Home.edj).

elm_image_file_set(icon, "/tmp/Home.edj", "elm/icon/Home/default");

A thumbnail can be generated and cached for future use. For this, you need the Ethumb library support.

elm_icon_thumb_set(icon, "/tmp/Home.png", NULL);

This function sets the file in the icon and enables the use of a cached thumbnail if it already exists. Otherwise, it creates a new thumbnail and caches it for future use.

Using Icon Callbacks

The icon component emits the following signals:

  • thumb,done: elm_icon_thumb_set() is completed with success.
  • thumb,error: elm_icon_thumb_set() fails.

In both cases, event_info is NULL.

Go to top