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.
This is how to create a notify object.
Evas_Object *notify; notify = elm_notify_add(parent);
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"); evas_object_show(content); // 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); evas_object_show(notify);
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);
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 notifyFor 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"); }