Notify Widgets

This widget displays a container in a particular region of the parent object. It can receive some content, and can be automatically hidden after a certain amount of time.

Table of Contents

Adding a Notify

This is how to create a notify object.

Evas_Object *notify;
notify = elm_notify_add(parent);

Configuring Notify Widget

We create a label and add it to the notify object.

Evas_Object *content;
// Create the label and set some text to it
content = elm_label_add(parent);
elm_object_text_set(content, "A label text");
// Add the label object to the notify widget
elm_object_content_set(notify, content);

In this example, we show the notify object on the bottom left corner of the parent object.

elm_notify_align_set(notify, 1.0, 1.0);

We can set a timeout interval, after which the notify widget is hidden. In this example, the timeout interval is five seconds.

elm_notify_timeout_set(notify, 5.0);

Using Notify Callbacks

The notify widget emits the following signals:

  • “timeout” - The timeout count ends and the notify is hidden
  • “block,clicked” - The user clicks outside of the notify

For both these signals event_info is NULL.

Here we register a callback on the “timeout” signal.

evas_object_smart_callback_add(notify, "timeout", _timeout_cb, data);
// Callback function for the "timeout" signal
// The timeout expires and the notify object is hidden
static void
_timeout_cb(void *data, Evas_Object *obj, void *event_info)
   printf("Notify is hidden\n");

A Notify Example