ngc891 pushed a commit to branch master.

http://git.enlightenment.org/games/elemines.git/commit/?id=6a09e20fb3f473ee111035ffc8eef325454d14fb

commit 6a09e20fb3f473ee111035ffc8eef325454d14fb
Author: Jerome Pinot <[email protected]>
Date:   Sun Jan 12 19:26:04 2014 +0900

    elemines: add a cancel button to the config popup
---
 src/gui.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/gui.c b/src/gui.c
index 5c7f7a7..005e22b 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -89,7 +89,7 @@ static void
 _show_config(void *data __UNUSED__, Evas_Object *obj __UNUSED__,
              void *event_info __UNUSED__)
 {
-   Evas_Object *vbox, *spin, *label, *button;
+   Evas_Object *vbox, *spin, *label, *bt1, *bt2;
    char buffer[512];
 
    game.ui.popup = elm_popup_add(game.ui.window);
@@ -127,10 +127,17 @@ _show_config(void *data __UNUSED__, Evas_Object *obj 
__UNUSED__,
    elm_object_content_set(game.ui.popup, vbox);
 
    /* button for validating */
-   button = elm_button_add(game.ui.popup);
-   elm_object_text_set(button, _("OK"));
-   elm_object_part_content_set(game.ui.popup, "button1", button);
-   evas_object_smart_callback_add(button, "clicked", _config, spin);
+   bt1 = elm_button_add(game.ui.popup);
+   elm_object_text_set(bt1, _("OK"));
+   elm_object_part_content_set(game.ui.popup, "button1", bt1);
+   evas_object_smart_callback_add(bt1, "clicked", _config, spin);
+
+   /* button for cancelling */
+   bt2 = elm_button_add(game.ui.popup);
+   elm_object_text_set(bt2, _("Cancel"));
+   elm_object_part_content_set(game.ui.popup, "button2", bt2);
+   evas_object_smart_callback_add(bt2, "clicked", _popup_del, NULL);
+
    evas_object_show(game.ui.popup);
 
 }

-- 


Reply via email to