1 #include <Elementary.h>
6 * @defgroup Popup Popup
9 * This is a popup widget. it can be used to display information/ get information from user.
12 typedef struct _Widget_Data Widget_Data;
18 const char *title_area;
19 Evas_Object *title_icon;
20 Evas_Object *content_area;
21 Evas_Object *desc_label;
22 Evas_Object *action_area;
23 Eina_List *button_list;
27 Elm_Notify_Orient notify_orient;
28 Eina_Bool delete_me : 1;
31 typedef struct _Action_Area_Data Action_Area_Data;
33 struct _Action_Area_Data
40 static const char *widtype = NULL;
41 static void _del_hook(Evas_Object *obj);
42 static void _theme_hook(Evas_Object *obj);
43 static void _sizing_eval(Evas_Object *obj);
44 static void _elm_popup_buttons_add_valist(Evas_Object *obj, const char *first_button_text, va_list args);
45 static Evas_Object* _elm_popup_add_button(Evas_Object *obj, const char *text, int response_id);
46 static void _action_area_clicked(void *data, Evas_Object *obj, void *event_info);
47 static void _block_clicked_cb(void *data, Evas_Object *obj, void *event_info);
48 static void _show(void *data, Evas *e, Evas_Object *obj, void *event_info);
49 static void _hide(void *data, Evas *e, Evas_Object *obj, void *event_info);
50 static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
51 static void _state_set_cb(void *data, Evas_Object *obj __UNUSED__,
52 const char *emission __UNUSED__,
53 const char *source __UNUSED__);
56 _del_hook(Evas_Object *obj)
58 Widget_Data *wd = elm_widget_data_get(obj);
64 _del_pre_hook(Evas_Object *obj)
66 Widget_Data *wd = elm_widget_data_get(obj);
67 Action_Area_Data *action_data = NULL;
68 Eina_List *list = NULL;
71 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_SHOW, _show, NULL);
72 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_HIDE, _hide, NULL);
73 evas_object_smart_callback_del(wd->notify, "block,clicked", _block_clicked_cb);
74 EINA_LIST_FOREACH(wd->button_list, list, action_data)
79 eina_list_free(wd->button_list);
83 _theme_hook(Evas_Object *obj)
85 Widget_Data *wd = elm_widget_data_get(obj);
87 Eina_List *list = NULL;
88 Action_Area_Data *action_data = NULL;
92 elm_layout_theme_set(wd->layout, "popup", "base", elm_widget_style_get(obj));
93 elm_notify_orient_set(wd->notify, wd->notify_orient);
94 _mirrored_set(obj, elm_widget_mirrored_get(obj));
95 edje_object_message_signal_process(elm_layout_edje_get(wd->layout));
98 snprintf(buf, sizeof(buf), "buttons%d", wd->no_of_buttons);
99 elm_layout_theme_set(wd->action_area, "popup", buf, elm_widget_style_get(obj));
100 EINA_LIST_FOREACH(wd->button_list, list, action_data)
102 snprintf(buf, sizeof(buf), "popup_button/%s", elm_widget_style_get(obj));
103 elm_object_style_set(action_data->btn, buf);
105 snprintf(buf, sizeof(buf), "actionbtn%d", index);
106 elm_layout_content_set(wd->action_area, buf, action_data->btn);
108 elm_layout_content_set(wd->layout, "elm.swallow.buttonArea", wd->action_area);
110 if (wd->content_area)
112 elm_layout_theme_set(wd->content_area, "popup", "content", elm_widget_style_get(obj));
115 snprintf(buf, sizeof(buf), "popup_description/%s", elm_widget_style_get(obj));
116 elm_object_style_set(wd->desc_label, buf);
117 elm_layout_content_set(wd->content_area, "elm.swallow.content", wd->desc_label);
119 else if (wd->content)
121 elm_layout_content_set(wd->content_area, "elm.swallow.content", wd->content);
123 elm_layout_content_set(wd->layout, "elm.swallow.content", wd->content_area);
127 edje_object_part_text_set(elm_layout_edje_get(wd->layout), "elm.swallow.title", wd->title_area);
133 _sizing_eval(Evas_Object *obj)
135 Widget_Data *wd = elm_widget_data_get(obj);
136 Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
139 edje_object_size_min_calc(elm_layout_edje_get(wd->layout), &minw, &minh);
140 evas_object_size_hint_min_set(obj, minw, minh);
141 evas_object_size_hint_max_set(obj, maxw, maxh);
145 _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
151 _block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
153 Widget_Data *wd = elm_widget_data_get((Evas_Object*)data);
155 if (wd->mode == ELM_POPUP_TYPE_ALERT)
157 evas_object_hide((Evas_Object*)data);
158 evas_object_smart_callback_call((Evas_Object *)data, "response", (void *)ELM_POPUP_RESPONSE_NONE);
163 _show(void *data, Evas *e, Evas_Object *obj, void *event_info)
165 Widget_Data *wd = elm_widget_data_get(obj);
168 elm_layout_theme_set(wd->layout, "popup", "base", elm_widget_style_get(obj));
170 evas_object_show(obj);
174 _hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
176 Widget_Data *wd = elm_widget_data_get(obj);
179 evas_object_hide(obj);
183 _action_area_clicked(void *data, Evas_Object *obj, void *event_info)
185 Action_Area_Data *adata = data;
188 evas_object_hide(adata->obj);
189 evas_object_smart_callback_call(adata->obj, "response", (void *)adata->response_id);
193 _elm_popup_add_button(Evas_Object *obj, const char *text, int response_id)
196 Widget_Data *wd = elm_widget_data_get(obj);
198 Action_Area_Data *adata;
200 if (!wd) return NULL;
201 adata = ELM_NEW(Action_Area_Data);
202 btn = elm_button_add(obj);
203 snprintf(buf, sizeof(buf), "popup_button/%s", elm_widget_style_get(obj));
204 elm_object_style_set(btn, buf);
205 elm_button_label_set(btn, text);
206 adata->response_id = response_id;
209 wd->button_list = eina_list_append(wd->button_list, adata);
210 evas_object_smart_callback_add(btn, "clicked", _action_area_clicked, adata);
215 _elm_popup_buttons_add_valist(Evas_Object *obj, const char *first_button_text, va_list args)
217 const char *text = NULL;
222 Widget_Data *wd = elm_widget_data_get(obj);
225 if (first_button_text == NULL) return;
226 text = first_button_text;
227 response = va_arg(args, int);
230 btn = _elm_popup_add_button(obj, text, response);
232 snprintf(buf, sizeof(buf), "actionbtn%d", index);
233 elm_layout_content_set(wd->action_area, buf, btn);
234 evas_object_event_callback_add(wd->action_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
235 _changed_size_hints, obj);
236 text = va_arg(args, char*);
237 if (text == NULL) break;
238 response = va_arg(args, int);
243 _elm_popup_timeout(void *data, Evas_Object *obj, void *event_info)
245 evas_object_hide((Evas_Object*)data);
246 evas_object_smart_callback_call((Evas_Object *)data, "response", (void *)ELM_POPUP_RESPONSE_TIMEOUT);
250 _elm_signal_exit(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__)
252 int res_id = ELM_POPUP_RESPONSE_NONE;
255 ecore_main_loop_quit();
260 response_cb(void *data, Evas_Object *obj, void *event_info)
262 int res_id = event_info;
266 ecore_main_loop_quit();
270 _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
272 Widget_Data *wd = elm_widget_data_get(obj);
275 elm_object_mirrored_set(wd->notify, rtl);
279 _state_set_cb(void *data, Evas_Object *obj __UNUSED__,
280 const char *emission __UNUSED__, const char *source __UNUSED__)
282 Widget_Data *wd = elm_widget_data_get((Evas_Object*)data);
284 if (wd->layout) elm_layout_sizing_eval(wd->layout);
288 * Add a new Popup object.
290 * @param[in] parent_app The parent object
291 * @return The new object or NULL if it cannot be created
296 elm_popup_add(Evas_Object *parent)
301 #ifdef HAVE_ELEMENTARY_X
302 Ecore_X_Window_Type type;
305 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
306 ELM_SET_WIDTYPE(widtype, "popup");
307 elm_widget_type_set(obj, widtype);
308 elm_widget_sub_object_add(parent, obj);
309 elm_widget_data_set(obj, wd);
310 elm_widget_del_pre_hook_set(obj, _del_pre_hook);
311 elm_widget_del_hook_set(obj, _del_hook);
312 elm_widget_theme_hook_set(obj, _theme_hook);
314 wd->notify = elm_notify_add(parent);
315 elm_widget_sub_object_add(obj, wd->notify);
316 elm_widget_resize_object_set(obj, wd->notify);
317 elm_notify_orient_set(wd->notify, ELM_NOTIFY_ORIENT_CENTER);
318 wd->notify_orient = ELM_NOTIFY_ORIENT_CENTER;
319 elm_notify_repeat_events_set(wd->notify, EINA_FALSE);
320 evas_object_size_hint_weight_set(wd->notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
321 evas_object_size_hint_align_set(wd->notify, EVAS_HINT_FILL, EVAS_HINT_FILL);
322 elm_object_style_set(wd->notify, "popup");
324 wd->layout = elm_layout_add(parent);
325 evas_object_size_hint_weight_set(wd->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
326 evas_object_size_hint_align_set(wd->layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
328 elm_layout_theme_set(wd->layout, "popup", "base", elm_widget_style_get(obj));
329 elm_notify_content_set(wd->notify, wd->layout);
331 edje_object_signal_callback_add(elm_layout_edje_get(wd->layout), "elm,state,title,visible", "elm", _state_set_cb, obj);
332 edje_object_signal_callback_add(elm_layout_edje_get(wd->layout), "elm,state,button,visible", "elm", _state_set_cb, obj);
333 edje_object_signal_callback_add(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm", _state_set_cb, obj);
335 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, NULL);
336 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, NULL);
337 wd->mode = ELM_POPUP_TYPE_NONE;
338 evas_object_smart_callback_add(wd->notify, "block,clicked", _block_clicked_cb, obj);
339 #ifdef HAVE_ELEMENTARY_X
340 ecore_x_netwm_window_type_get(elm_win_xwindow_get(parent), &type);
341 if (type == ECORE_X_WINDOW_TYPE_DIALOG)
343 elm_object_style_set(wd->notify, "transparent");
351 * Add a new Popup object.
353 * @param[in] parent The parent object
354 * @param[in] title text to be displayed in title area.
355 * @param[in] desc_text text to be displayed in description area.
356 * @param[in] no_of_buttons Number of buttons to be packed in action area.
357 * @param[in] first_button_text button text
358 * @param[in] Varargs response ID for first button, then additional buttons followed by response id's ending with NULL
359 * @return The new object or NULL if it cannot be created
364 elm_popup_with_buttons_add(Evas_Object *parent, const char *title, const char *desc_text,int no_of_buttons, const char *first_button_text, ...)
370 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
371 popup = elm_popup_add(parent);
372 wd = elm_widget_data_get(popup);
375 elm_popup_desc_set(popup, desc_text);
379 elm_popup_title_label_set(popup, title);
381 if (first_button_text)
384 va_start(args, first_button_text);
385 wd->action_area = elm_layout_add(popup);
386 elm_layout_content_set(wd->layout, "elm.swallow.buttonArea", wd->action_area);
387 snprintf(buf,sizeof(buf), "buttons%d", no_of_buttons);
388 wd->no_of_buttons = no_of_buttons;
389 elm_layout_theme_set(wd->action_area, "popup", buf, elm_widget_style_get(popup));
390 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,visible", "elm");
393 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm");
395 _elm_popup_buttons_add_valist (popup, first_button_text, args);
398 edje_object_message_signal_process(wd->layout);
405 * This Set's the description text in content area of Popup widget.
407 * @param[in] obj The Popup object
408 * @param[in] text description text.
413 elm_popup_desc_set(Evas_Object *obj, const char *text)
415 ELM_CHECK_WIDTYPE(obj, widtype);
416 Widget_Data *wd = elm_widget_data_get(obj);
420 if (wd->content_area)
422 evas_object_del(wd->content_area);
423 wd->content_area = NULL;
425 wd->content_area = elm_layout_add(obj);
426 elm_layout_theme_set(wd->content_area, "popup", "content", elm_widget_style_get(obj));
427 wd->desc_label = elm_label_add(obj);
428 snprintf(buf, sizeof(buf), "popup_description/%s", elm_widget_style_get(obj));
429 elm_object_style_set(wd->desc_label, buf);
430 elm_label_line_wrap_set(wd->desc_label, ELM_WRAP_MIXED);
431 elm_object_text_set(wd->desc_label, text);
432 evas_object_size_hint_weight_set(wd->desc_label, EVAS_HINT_EXPAND, 0.0);
433 evas_object_size_hint_align_set(wd->desc_label, EVAS_HINT_FILL, EVAS_HINT_FILL);
434 evas_object_show(wd->desc_label);
435 elm_layout_content_set(wd->content_area, "elm.swallow.content", wd->desc_label);
436 elm_layout_content_set(wd->layout, "elm.swallow.content", wd->content_area);
437 evas_object_event_callback_add(wd->content_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
438 _changed_size_hints, obj);
443 * This Get's the description text packed in content area of popup object.
445 * @param[in] obj The Popup object
446 * @return description text.
451 elm_popup_desc_get(Evas_Object *obj)
453 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
454 Widget_Data *wd = elm_widget_data_get(obj);
456 if (!wd) return NULL;
457 return elm_label_label_get(wd->desc_label);
461 * This Set's the title text in title area of popup object.
463 * @param[in] obj The popup object
464 * @param[in] text The title text
469 elm_popup_title_label_set(Evas_Object *obj, const char *text)
471 ELM_CHECK_WIDTYPE(obj, widtype);
472 Widget_Data *wd = elm_widget_data_get(obj);
475 eina_stringshare_replace(&wd->title_area, text);
476 edje_object_part_text_set(elm_layout_edje_get(wd->layout), "elm.swallow.title", text);
477 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,title,visible", "elm");
479 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm");
481 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,title,icon,visible", "elm");
482 edje_object_message_signal_process(wd->layout);
487 * This Get's the title text packed in title area of popup object.
489 * @param[in] obj The Popup object
495 elm_popup_title_label_get(Evas_Object *obj)
497 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
498 Widget_Data *wd = elm_widget_data_get(obj);
500 if (!wd) return NULL;
501 return wd->title_area;
505 * This Set's the icon in the title area of Popup object.
507 * @param[in] obj The popup object
508 * @param[in] icon The title icon
513 elm_popup_title_icon_set(Evas_Object *obj, Evas_Object *icon)
515 ELM_CHECK_WIDTYPE(obj, widtype);
516 Widget_Data *wd = elm_widget_data_get(obj);
521 evas_object_del(wd->title_icon);
522 wd->title_icon = NULL;
524 wd->title_icon = icon;
525 elm_layout_content_set(wd->layout, "elm.swallow.title.icon", wd->title_icon);
526 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,title,icon,visible", "elm");
527 edje_object_message_signal_process(wd->layout);
532 * This Get's the icon packed in title area of Popup object.
534 * @param[in] obj The Popup object
540 elm_popup_title_icon_get(Evas_Object *obj)
542 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
543 Widget_Data *wd = elm_widget_data_get(obj);
545 if (!wd) return NULL;
546 return wd->title_icon;
550 * This Set's the content widget in content area of Popup object.
552 * @param[in] obj The popup object
553 * @param[in] content The content widget
558 elm_popup_content_set(Evas_Object *obj, Evas_Object *content)
560 ELM_CHECK_WIDTYPE(obj, widtype);
561 Widget_Data *wd = elm_widget_data_get(obj);
564 if (wd->content == content) return;
565 if (wd->content_area)
567 evas_object_del(wd->content_area);
568 wd->content_area = NULL;
570 wd->content = content;
573 wd->content_area = elm_layout_add(obj);
574 elm_layout_theme_set(wd->content_area, "popup","content", elm_widget_style_get(obj));
575 elm_layout_content_set(wd->content_area, "elm.swallow.content", content);
576 elm_layout_content_set(wd->layout, "elm.swallow.content", wd->content_area);
577 evas_object_event_callback_add(wd->content_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
578 _changed_size_hints, obj);
584 * This Get's the content widget packed in content area of Popup object.
586 * @param[in] obj The Popup object
587 * @return content packed in popup widget
592 elm_popup_content_get(Evas_Object *obj)
594 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
595 Widget_Data *wd = elm_widget_data_get(obj);
597 if (!wd) return NULL;
602 * Adds the buttons in to the action area of popup object.
604 * @param[in] obj The popup object
605 * @param[in] no_of_buttons Number of buttons that has to be packed in action area.
606 * @param[in] first_button_text Label of first button
607 * @param[in] Varargs Response ID(Elm_Popup_Response/ any integer value) for first button, then additional buttons along with their response id ending with NULL.
611 elm_popup_buttons_add(Evas_Object *obj,int no_of_buttons, const char *first_button_text, ...)
613 ELM_CHECK_WIDTYPE(obj, widtype);
614 Widget_Data *wd = elm_widget_data_get(obj);
619 va_start(args, first_button_text);
622 evas_object_del(wd->action_area);
623 wd->action_area = NULL;
625 wd->action_area = elm_layout_add(obj);
626 elm_layout_content_set(wd->layout, "elm.swallow.buttonArea", wd->action_area);
627 evas_object_size_hint_weight_set(wd->action_area, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
628 evas_object_size_hint_align_set(wd->action_area, EVAS_HINT_FILL, EVAS_HINT_FILL);
629 snprintf(buf, sizeof(buf), "buttons%d", no_of_buttons);
630 elm_layout_theme_set(wd->action_area, "popup", buf, elm_widget_style_get(obj));
631 wd->no_of_buttons = no_of_buttons;
632 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,visible", "elm");
634 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm");
635 _elm_popup_buttons_add_valist (obj, first_button_text, args);
637 edje_object_message_signal_process(wd->layout);
642 * This Set's the time before the popup window is hidden,
643 * and ELM_POPUP_RESPONSE_TIMEOUT is sent along with response signal.
645 * @param[in] obj The popup object
646 * @param[in] timeout The timeout value in seconds.
651 elm_popup_timeout_set(Evas_Object *obj, double timeout)
653 ELM_CHECK_WIDTYPE(obj, widtype);
654 Widget_Data *wd = elm_widget_data_get(obj);
657 elm_notify_timeout_set(wd->notify, timeout);
658 evas_object_smart_callback_add(wd->notify, "timeout", _elm_popup_timeout, obj);
662 * This Set's the mode of popup, by default ELM_POPUP_TYPE_NONE is set i.e, popup
663 * will not close when clicked outside. if ELM_POPUP_TYPE_ALERT is set, popup will close
664 * when clicked outside, and ELM_POPUP_RESPONSE_NONE is sent along with response signal.
666 * @param[in] obj The popup object
667 * @param[in] mode Elm_Popup_Mode
672 elm_popup_mode_set(Evas_Object *obj, Elm_Popup_Mode mode)
674 ELM_CHECK_WIDTYPE(obj, widtype);
675 Widget_Data *wd = elm_widget_data_get(obj);
678 if (mode == wd->mode) return;
683 * This Hides the popup by emitting response signal.
685 * @param[in] obj The popup object
686 * @param[in] response_id response ID of the signal to be emitted along with response signal
691 elm_popup_response(Evas_Object *obj, int response_id)
693 ELM_CHECK_WIDTYPE(obj, widtype);
694 Widget_Data *wd = elm_widget_data_get(obj);
697 evas_object_hide(obj);
698 evas_object_smart_callback_call((Evas_Object *)obj, "response", (void *)response_id);
702 * This API controls the direction from which popup will appear and location of popup.
703 * @param[in] obj The popup object
704 * @param[in] orient the orientation of the popup
709 elm_popup_orient_set(Evas_Object *obj, Elm_Popup_Orient orient)
711 ELM_CHECK_WIDTYPE(obj, widtype);
712 Widget_Data *wd = elm_widget_data_get(obj);
713 Elm_Notify_Orient notify_orient = -1;
718 case ELM_POPUP_ORIENT_TOP:
719 notify_orient = ELM_NOTIFY_ORIENT_TOP;
721 case ELM_POPUP_ORIENT_CENTER:
722 notify_orient = ELM_NOTIFY_ORIENT_CENTER;
724 case ELM_POPUP_ORIENT_BOTTOM:
725 notify_orient = ELM_NOTIFY_ORIENT_BOTTOM;
727 case ELM_POPUP_ORIENT_LEFT:
728 notify_orient = ELM_NOTIFY_ORIENT_LEFT;
730 case ELM_POPUP_ORIENT_RIGHT:
731 notify_orient = ELM_NOTIFY_ORIENT_RIGHT;
733 case ELM_POPUP_ORIENT_TOP_LEFT:
734 notify_orient = ELM_NOTIFY_ORIENT_TOP_LEFT;
736 case ELM_POPUP_ORIENT_TOP_RIGHT:
737 notify_orient = ELM_NOTIFY_ORIENT_TOP_RIGHT;
739 case ELM_POPUP_ORIENT_BOTTOM_LEFT:
740 notify_orient = ELM_NOTIFY_ORIENT_BOTTOM_LEFT;
742 case ELM_POPUP_ORIENT_BOTTOM_RIGHT:
743 notify_orient = ELM_NOTIFY_ORIENT_BOTTOM_RIGHT;
746 wd->notify_orient = notify_orient;
747 elm_notify_orient_set(wd->notify, notify_orient);
751 * Blocks in a main loop until popup either emits response signal or is exited due
752 * to exit signal, when exit signal is received dialog responds with ELM_POPUP_RESPONSE_NONE
753 * response ID else returns the response ID from response signal emission.
754 * before entering the main loop popup calls evas_object_show on the popup for you.
755 * you can force popup to return at any time by calling elm_popup_responsec to emit the
756 * response signal. destroying the popup during elm_popup_run is a very bad idea.
757 * typical usage of this function may be
758 * int result = elm_popup_run(popup);
761 * case ELM_POPUP_RESPONSE_OK:
762 * do_something_specific_to_app();
763 * evas_object_del(popup);
765 * case ELM_POPUP_RESPONSE_CANCEL:
766 * do_nothing_popup_was_cancelled();
767 * evas_object_del(popup);
769 * case ELM_POPUP_RESPONSE_NONE:
771 * evas_object_del(popup);
774 * do not run elm_popup_run in a timer/idler callback.
775 * when popup returns with signal ELM_POPUP_RESPONSE_NONE, then exit the application using elm_exit
776 * by calling any post exit application code.
778 * @param[in] obj The popup object
782 elm_popup_run(Evas_Object *obj)
785 Ecore_Event_Handler *_elm_exit_handler = NULL;
787 /*Finger waggle warning*/
788 _elm_dangerous_call_check(__FUNCTION__);
789 evas_object_show(obj);
790 evas_object_smart_callback_add(obj, "response", response_cb, &response_id);
791 _elm_exit_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _elm_signal_exit, &response_id);
792 ecore_main_loop_begin();
793 if (_elm_exit_handler)
795 ecore_event_handler_del(_elm_exit_handler);
796 _elm_exit_handler = NULL;