summaryrefslogtreecommitdiff
path: root/reference/c/ui/src/ui_container.c
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-12-13 12:53:11 +0000
committerAndy Williams <andy@andywilliams.me>2017-12-13 12:53:11 +0000
commiteabdff1f2731c680f08e31b3a07d06ecc0d23036 (patch)
tree1f5260c5368835004529e059c55f74c2551573a1 /reference/c/ui/src/ui_container.c
parentaf48dd8fbae879b237360bfe4e77fd12eb15174b (diff)
ui: Fix close callbacks for the UI reference examples
Diffstat (limited to 'reference/c/ui/src/ui_container.c')
-rw-r--r--reference/c/ui/src/ui_container.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/reference/c/ui/src/ui_container.c b/reference/c/ui/src/ui_container.c
index 8ded077b..2dd3b0c5 100644
--- a/reference/c/ui/src/ui_container.c
+++ b/reference/c/ui/src/ui_container.c
@@ -21,6 +21,13 @@
21 * TODO - still ELM Table 21 * TODO - still ELM Table
22 */ 22 */
23 23
24// quit the app, called if the user clicks the Quit button or the window is deleted
25static void
26_gui_quit_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
27{
28 efl_exit(0);
29}
30
24// Load a simple grid layout into the window 31// Load a simple grid layout into the window
25static Efl_Ui_Grid * 32static Efl_Ui_Grid *
26_ui_grid_setup(Efl_Ui_Win *win) 33_ui_grid_setup(Efl_Ui_Win *win)
@@ -99,7 +106,9 @@ _ui_panes_setup(Efl_Ui_Win *win)
99 106
100 efl_add(EFL_UI_BUTTON_CLASS, win, 107 efl_add(EFL_UI_BUTTON_CLASS, win,
101 efl_text_set(efl_added, "Quit"), 108 efl_text_set(efl_added, "Quit"),
102 efl_content_set(efl_part(horiz_split, "second"), efl_added)); 109 efl_content_set(efl_part(horiz_split, "second"), efl_added),
110 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
111 _gui_quit_cb, efl_added));
103} 112}
104 113
105EAPI_MAIN void 114EAPI_MAIN void
@@ -114,6 +123,9 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
114 123
115// _ui_panes_setup(win); 124// _ui_panes_setup(win);
116 _ui_boxes_setup(win); 125 _ui_boxes_setup(win);
126 // when the user clicks "close" on a window there is a request to delete
127 efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _gui_quit_cb, NULL);
128
117 129
118 efl_gfx_size_set(win, EINA_SIZE2D(350, 250)); 130 efl_gfx_size_set(win, EINA_SIZE2D(350, 250));
119} 131}