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_object_content_part_set(wd->action_area, buf, action_data->btn);
108 elm_object_content_part_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_object_content_part_set(wd->content_area, "elm.swallow.content", wd->desc_label);
119 else if (wd->content)
121 elm_object_content_part_set(wd->content_area, "elm.swallow.content", wd->content);
123 elm_object_content_part_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_object_focus_allow_set(btn, EINA_FALSE);
206 elm_object_text_set(btn, text);
207 adata->response_id = response_id;
210 wd->button_list = eina_list_append(wd->button_list, adata);
211 evas_object_smart_callback_add(btn, "clicked", _action_area_clicked, adata);
216 _elm_popup_buttons_add_valist(Evas_Object *obj, const char *first_button_text, va_list args)
218 const char *text = NULL;
223 Widget_Data *wd = elm_widget_data_get(obj);
226 if (first_button_text == NULL) return;
227 text = first_button_text;
228 response = va_arg(args, int);
231 btn = _elm_popup_add_button(obj, text, response);
233 snprintf(buf, sizeof(buf), "actionbtn%d", index);
234 elm_object_content_part_set(wd->action_area, buf, btn);
235 evas_object_event_callback_add(wd->action_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
236 _changed_size_hints, obj);
237 text = va_arg(args, char*);
238 if (text == NULL) break;
239 response = va_arg(args, int);
244 _elm_popup_timeout(void *data, Evas_Object *obj, void *event_info)
246 evas_object_hide((Evas_Object*)data);
247 evas_object_smart_callback_call((Evas_Object *)data, "response", (void *)ELM_POPUP_RESPONSE_TIMEOUT);
251 _elm_signal_exit(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__)
253 int res_id = ELM_POPUP_RESPONSE_NONE;
256 ecore_main_loop_quit();
261 response_cb(void *data, Evas_Object *obj, void *event_info)
263 int res_id = (int) event_info;
267 ecore_main_loop_quit();
271 _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
273 Widget_Data *wd = elm_widget_data_get(obj);
276 elm_object_mirrored_set(wd->notify, rtl);
280 _state_set_cb(void *data, Evas_Object *obj __UNUSED__,
281 const char *emission __UNUSED__, const char *source __UNUSED__)
283 Widget_Data *wd = elm_widget_data_get((Evas_Object*)data);
285 if (wd->layout) elm_layout_sizing_eval(wd->layout);
289 * Add a new Popup object.
291 * @param[in] parent_app The parent object
292 * @return The new object or NULL if it cannot be created
297 elm_popup_add(Evas_Object *parent)
302 #ifdef HAVE_ELEMENTARY_X
303 Ecore_X_Window_Type type;
306 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
307 ELM_SET_WIDTYPE(widtype, "popup");
308 elm_widget_type_set(obj, widtype);
309 elm_widget_sub_object_add(parent, obj);
310 elm_widget_data_set(obj, wd);
311 elm_widget_del_pre_hook_set(obj, _del_pre_hook);
312 elm_widget_del_hook_set(obj, _del_hook);
313 elm_widget_theme_hook_set(obj, _theme_hook);
315 wd->notify = elm_notify_add(parent);
316 elm_widget_sub_object_add(obj, wd->notify);
317 elm_widget_resize_object_set(obj, wd->notify);
318 elm_notify_orient_set(wd->notify, ELM_NOTIFY_ORIENT_CENTER);
319 wd->notify_orient = ELM_NOTIFY_ORIENT_CENTER;
320 elm_notify_repeat_events_set(wd->notify, EINA_FALSE);
321 evas_object_size_hint_weight_set(wd->notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
322 evas_object_size_hint_align_set(wd->notify, EVAS_HINT_FILL, EVAS_HINT_FILL);
323 elm_object_style_set(wd->notify, "popup");
325 wd->layout = elm_layout_add(parent);
326 evas_object_size_hint_weight_set(wd->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
327 evas_object_size_hint_align_set(wd->layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
329 elm_layout_theme_set(wd->layout, "popup", "base", elm_widget_style_get(obj));
330 elm_object_content_set(wd->notify, wd->layout);
332 edje_object_signal_callback_add(elm_layout_edje_get(wd->layout), "elm,state,title,visible", "elm", _state_set_cb, obj);
333 edje_object_signal_callback_add(elm_layout_edje_get(wd->layout), "elm,state,button,visible", "elm", _state_set_cb, obj);
334 edje_object_signal_callback_add(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm", _state_set_cb, obj);
336 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, NULL);
337 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, NULL);
338 wd->mode = ELM_POPUP_TYPE_NONE;
339 evas_object_smart_callback_add(wd->notify, "block,clicked", _block_clicked_cb, obj);
340 #ifdef HAVE_ELEMENTARY_X
341 ecore_x_netwm_window_type_get(elm_win_xwindow_get(parent), &type);
342 if (type == ECORE_X_WINDOW_TYPE_DIALOG)
344 elm_object_style_set(wd->notify, "transparent");
352 * Add a new Popup object.
354 * @param[in] parent The parent object
355 * @param[in] title text to be displayed in title area.
356 * @param[in] desc_text text to be displayed in description area.
357 * @param[in] no_of_buttons Number of buttons to be packed in action area.
358 * @param[in] first_button_text button text
359 * @param[in] Varargs response ID for first button, then additional buttons followed by response id's ending with NULL
360 * @return The new object or NULL if it cannot be created
365 elm_popup_with_buttons_add(Evas_Object *parent, const char *title, const char *desc_text,int no_of_buttons, const char *first_button_text, ...)
371 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
372 popup = elm_popup_add(parent);
373 wd = elm_widget_data_get(popup);
376 elm_popup_desc_set(popup, desc_text);
380 elm_popup_title_label_set(popup, title);
382 if (first_button_text)
385 va_start(args, first_button_text);
386 wd->action_area = elm_layout_add(popup);
387 elm_object_content_part_set(wd->layout, "elm.swallow.buttonArea", wd->action_area);
388 snprintf(buf,sizeof(buf), "buttons%d", no_of_buttons);
389 wd->no_of_buttons = no_of_buttons;
390 elm_layout_theme_set(wd->action_area, "popup", buf, elm_widget_style_get(popup));
391 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,visible", "elm");
394 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm");
396 _elm_popup_buttons_add_valist (popup, first_button_text, args);
399 edje_object_message_signal_process(wd->layout);
406 * This Set's the description text in content area of Popup widget.
408 * @param[in] obj The Popup object
409 * @param[in] text description text.
414 elm_popup_desc_set(Evas_Object *obj, const char *text)
416 ELM_CHECK_WIDTYPE(obj, widtype);
417 Widget_Data *wd = elm_widget_data_get(obj);
421 if (wd->content_area)
423 evas_object_del(wd->content_area);
424 wd->content_area = NULL;
426 wd->content_area = elm_layout_add(obj);
427 elm_layout_theme_set(wd->content_area, "popup", "content", elm_widget_style_get(obj));
428 wd->desc_label = elm_label_add(obj);
429 snprintf(buf, sizeof(buf), "popup_description/%s", elm_widget_style_get(obj));
430 elm_object_style_set(wd->desc_label, buf);
431 elm_label_line_wrap_set(wd->desc_label, ELM_WRAP_MIXED);
432 elm_object_text_set(wd->desc_label, text);
433 evas_object_size_hint_weight_set(wd->desc_label, EVAS_HINT_EXPAND, 0.0);
434 evas_object_size_hint_align_set(wd->desc_label, EVAS_HINT_FILL, EVAS_HINT_FILL);
435 evas_object_show(wd->desc_label);
436 elm_object_content_part_set(wd->content_area, "elm.swallow.content", wd->desc_label);
437 elm_object_content_part_set(wd->layout, "elm.swallow.content", wd->content_area);
438 evas_object_event_callback_add(wd->content_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
439 _changed_size_hints, obj);
444 * This Get's the description text packed in content area of popup object.
446 * @param[in] obj The Popup object
447 * @return description text.
452 elm_popup_desc_get(Evas_Object *obj)
454 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
455 Widget_Data *wd = elm_widget_data_get(obj);
457 if (!wd) return NULL;
458 return elm_object_text_get(wd->desc_label);
462 * This Set's the title text in title area of popup object.
464 * @param[in] obj The popup object
465 * @param[in] text The title text
470 elm_popup_title_label_set(Evas_Object *obj, const char *text)
472 ELM_CHECK_WIDTYPE(obj, widtype);
473 Widget_Data *wd = elm_widget_data_get(obj);
476 eina_stringshare_replace(&wd->title_area, text);
477 edje_object_part_text_set(elm_layout_edje_get(wd->layout), "elm.swallow.title", text);
478 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,title,visible", "elm");
480 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm");
482 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,title,icon,visible", "elm");
483 edje_object_message_signal_process(wd->layout);
488 * This Get's the title text packed in title area of popup object.
490 * @param[in] obj The Popup object
496 elm_popup_title_label_get(Evas_Object *obj)
498 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
499 Widget_Data *wd = elm_widget_data_get(obj);
501 if (!wd) return NULL;
502 return wd->title_area;
506 * This Set's the icon in the title area of Popup object.
508 * @param[in] obj The popup object
509 * @param[in] icon The title icon
514 elm_popup_title_icon_set(Evas_Object *obj, Evas_Object *icon)
516 ELM_CHECK_WIDTYPE(obj, widtype);
517 Widget_Data *wd = elm_widget_data_get(obj);
522 evas_object_del(wd->title_icon);
523 wd->title_icon = NULL;
525 wd->title_icon = icon;
526 elm_object_content_part_set(wd->layout, "elm.swallow.title.icon", wd->title_icon);
527 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,title,icon,visible", "elm");
528 edje_object_message_signal_process(wd->layout);
533 * This Get's the icon packed in title area of Popup object.
535 * @param[in] obj The Popup object
541 elm_popup_title_icon_get(Evas_Object *obj)
543 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
544 Widget_Data *wd = elm_widget_data_get(obj);
546 if (!wd) return NULL;
547 return wd->title_icon;
551 * This Set's the content widget in content area of Popup object.
553 * @param[in] obj The popup object
554 * @param[in] content The content widget
559 elm_popup_content_set(Evas_Object *obj, Evas_Object *content)
561 ELM_CHECK_WIDTYPE(obj, widtype);
562 Widget_Data *wd = elm_widget_data_get(obj);
565 if (wd->content == content) return;
566 if (wd->content_area)
568 evas_object_del(wd->content_area);
569 wd->content_area = NULL;
571 wd->content = content;
574 wd->content_area = elm_layout_add(obj);
575 elm_layout_theme_set(wd->content_area, "popup","content", elm_widget_style_get(obj));
576 elm_object_content_part_set(wd->content_area, "elm.swallow.content", content);
577 elm_object_content_part_set(wd->layout, "elm.swallow.content", wd->content_area);
578 evas_object_event_callback_add(wd->content_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
579 _changed_size_hints, obj);
585 * This Get's the content widget packed in content area of Popup object.
587 * @param[in] obj The Popup object
588 * @return content packed in popup widget
593 elm_popup_content_get(Evas_Object *obj)
595 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
596 Widget_Data *wd = elm_widget_data_get(obj);
598 if (!wd) return NULL;
603 * Adds the buttons in to the action area of popup object.
605 * @param[in] obj The popup object
606 * @param[in] no_of_buttons Number of buttons that has to be packed in action area.
607 * @param[in] first_button_text Label of first button
608 * @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.
612 elm_popup_buttons_add(Evas_Object *obj,int no_of_buttons, const char *first_button_text, ...)
614 ELM_CHECK_WIDTYPE(obj, widtype);
615 Widget_Data *wd = elm_widget_data_get(obj);
620 va_start(args, first_button_text);
623 evas_object_del(wd->action_area);
624 wd->action_area = NULL;
626 wd->action_area = elm_layout_add(obj);
627 elm_object_content_part_set(wd->layout, "elm.swallow.buttonArea", wd->action_area);
628 evas_object_size_hint_weight_set(wd->action_area, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
629 evas_object_size_hint_align_set(wd->action_area, EVAS_HINT_FILL, EVAS_HINT_FILL);
630 snprintf(buf, sizeof(buf), "buttons%d", no_of_buttons);
631 elm_layout_theme_set(wd->action_area, "popup", buf, elm_widget_style_get(obj));
632 wd->no_of_buttons = no_of_buttons;
633 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,visible", "elm");
635 edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm");
636 _elm_popup_buttons_add_valist (obj, first_button_text, args);
638 edje_object_message_signal_process(wd->layout);
643 * This Set's the time before the popup window is hidden,
644 * and ELM_POPUP_RESPONSE_TIMEOUT is sent along with response signal.
646 * @param[in] obj The popup object
647 * @param[in] timeout The timeout value in seconds.
652 elm_popup_timeout_set(Evas_Object *obj, double timeout)
654 ELM_CHECK_WIDTYPE(obj, widtype);
655 Widget_Data *wd = elm_widget_data_get(obj);
658 elm_notify_timeout_set(wd->notify, timeout);
659 evas_object_smart_callback_add(wd->notify, "timeout", _elm_popup_timeout, obj);
663 * This Set's the mode of popup, by default ELM_POPUP_TYPE_NONE is set i.e, popup
664 * will not close when clicked outside. if ELM_POPUP_TYPE_ALERT is set, popup will close
665 * when clicked outside, and ELM_POPUP_RESPONSE_NONE is sent along with response signal.
667 * @param[in] obj The popup object
668 * @param[in] mode Elm_Popup_Mode
673 elm_popup_mode_set(Evas_Object *obj, Elm_Popup_Mode mode)
675 ELM_CHECK_WIDTYPE(obj, widtype);
676 Widget_Data *wd = elm_widget_data_get(obj);
679 if (mode == wd->mode) return;
684 * This Hides the popup by emitting response signal.
686 * @param[in] obj The popup object
687 * @param[in] response_id response ID of the signal to be emitted along with response signal
692 elm_popup_response(Evas_Object *obj, int response_id)
694 ELM_CHECK_WIDTYPE(obj, widtype);
695 Widget_Data *wd = elm_widget_data_get(obj);
698 evas_object_hide(obj);
699 evas_object_smart_callback_call((Evas_Object *)obj, "response", (void *)response_id);
703 * This API controls the direction from which popup will appear and location of popup.
704 * @param[in] obj The popup object
705 * @param[in] orient the orientation of the popup
710 elm_popup_orient_set(Evas_Object *obj, Elm_Popup_Orient orient)
712 ELM_CHECK_WIDTYPE(obj, widtype);
713 Widget_Data *wd = elm_widget_data_get(obj);
714 Elm_Notify_Orient notify_orient = -1;
719 case ELM_POPUP_ORIENT_TOP:
720 notify_orient = ELM_NOTIFY_ORIENT_TOP;
722 case ELM_POPUP_ORIENT_CENTER:
723 notify_orient = ELM_NOTIFY_ORIENT_CENTER;
725 case ELM_POPUP_ORIENT_BOTTOM:
726 notify_orient = ELM_NOTIFY_ORIENT_BOTTOM;
728 case ELM_POPUP_ORIENT_LEFT:
729 notify_orient = ELM_NOTIFY_ORIENT_LEFT;
731 case ELM_POPUP_ORIENT_RIGHT:
732 notify_orient = ELM_NOTIFY_ORIENT_RIGHT;
734 case ELM_POPUP_ORIENT_TOP_LEFT:
735 notify_orient = ELM_NOTIFY_ORIENT_TOP_LEFT;
737 case ELM_POPUP_ORIENT_TOP_RIGHT:
738 notify_orient = ELM_NOTIFY_ORIENT_TOP_RIGHT;
740 case ELM_POPUP_ORIENT_BOTTOM_LEFT:
741 notify_orient = ELM_NOTIFY_ORIENT_BOTTOM_LEFT;
743 case ELM_POPUP_ORIENT_BOTTOM_RIGHT:
744 notify_orient = ELM_NOTIFY_ORIENT_BOTTOM_RIGHT;
747 wd->notify_orient = notify_orient;
748 elm_notify_orient_set(wd->notify, notify_orient);
752 * Blocks in a main loop until popup either emits response signal or is exited due
753 * to exit signal, when exit signal is received dialog responds with ELM_POPUP_RESPONSE_NONE
754 * response ID else returns the response ID from response signal emission.
755 * before entering the main loop popup calls evas_object_show on the popup for you.
756 * you can force popup to return at any time by calling elm_popup_responsec to emit the
757 * response signal. destroying the popup during elm_popup_run is a very bad idea.
758 * typical usage of this function may be
759 * int result = elm_popup_run(popup);
762 * case ELM_POPUP_RESPONSE_OK:
763 * do_something_specific_to_app();
764 * evas_object_del(popup);
766 * case ELM_POPUP_RESPONSE_CANCEL:
767 * do_nothing_popup_was_cancelled();
768 * evas_object_del(popup);
770 * case ELM_POPUP_RESPONSE_NONE:
772 * evas_object_del(popup);
775 * do not run elm_popup_run in a timer/idler callback.
776 * when popup returns with signal ELM_POPUP_RESPONSE_NONE, then exit the application using elm_exit
777 * by calling any post exit application code.
779 * @param[in] obj The popup object
783 elm_popup_run(Evas_Object *obj)
786 Ecore_Event_Handler *_elm_exit_handler = NULL;
788 /*Finger waggle warning*/
789 _elm_dangerous_call_check(__FUNCTION__);
790 evas_object_show(obj);
791 evas_object_smart_callback_add(obj, "response", response_cb, &response_id);
792 _elm_exit_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _elm_signal_exit, &response_id);
793 ecore_main_loop_begin();
794 if (_elm_exit_handler)
796 ecore_event_handler_del(_elm_exit_handler);
797 _elm_exit_handler = NULL;