Mobile native

Tooltip

This feature is supported in mobile applications only.

The tooltip component is a smart object that shows a content in a frame when mouse hovers a parent object. The UI component provides tips or information about the parent object.

Adding a Tooltip

The tooltip component cannot be created with the elm_tooltip_add() function. This component is already contained in a parent component when it is created. You can only activate or disable it.

Activating the Tooltip

To activate the tooltip on a parent object, you can set a tooltip text to the parent object.

Evas_Object *parent;

elm_object_tooltip_text_set(parent, "The tooltip text";

You can also set a content to the parent object.

{
   elm_object_tooltip_content_cb_set(parent, tooltip_content_cb, NULL, tooltip_content_del_cb);
}

Evas_Object*
tooltip_content_cb(void*data, Evas_Object *obj, Evas_Object *tooltip)
{
   // Create the tooltip content 
}

void tooltip_content_del_cb(void *data, Evas_Object *obj, void *event_info)
{
   // Destroy the tooltip content 
}

When passing content to the tooltip, the tooltip_content_cb function is called each time the tooltip is showed. The role of this function is to create the content to set in the tooltip. It returns a pointer to an Evas_Object.

When the tooltip disappears, the tooltip_content_del_cb function is called. This function is in charge of deleting the previously allocated Evas_Object.

Once set, the tooltip can be manually hidden or shown.

elm_object_tooltip_hide(parent);
elm_object_tooltip_show(parent);

The tooltip can be removed from the parent object when it is not needed.

elm_object_tooltip_unset(parent);
Note
When content is set into the tooltip object, unsetting it calls the callback provided as del_cb to notify that the tooltip cannot be used any longer.

A tooltip object is not a UI component, so it does not emit signals. There are no registered callbacks for it.

Go to top