summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-11-24 15:29:39 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-11-24 15:29:41 +0900
commit4f6277c71c046a131dfb4fb523272a20503681e8 (patch)
tree335330df31536a2cfae97b02db2aafee12ce9b14
parent4179b50dc304506156a14787c3ea3cbd530022da (diff)
test_notify,popup: Add key event reacting examples.
There is a bug in notify. This test reveals the bugs :)
-rw-r--r--src/bin/test_notify.c11
-rw-r--r--src/bin/test_popup.c11
2 files changed, 22 insertions, 0 deletions
diff --git a/src/bin/test_notify.c b/src/bin/test_notify.c
index f5ae7cb08..3d0000688 100644
--- a/src/bin/test_notify.c
+++ b/src/bin/test_notify.c
@@ -37,6 +37,15 @@ _notify_block(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
37 printf("Notify block area clicked!!\n"); 37 printf("Notify block area clicked!!\n");
38} 38}
39 39
40static void
41_notify_key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
42 Evas_Object *obj EINA_UNUSED, void *event_info)
43{
44 Evas_Event_Key_Down *ev = event_info;
45
46 printf("Key down: %s\n", ev->keyname);
47}
48
40void 49void
41test_notify(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 50test_notify(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
42{ 51{
@@ -89,6 +98,8 @@ test_notify(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
89 elm_notify_timeout_set(notify, 5.0); 98 elm_notify_timeout_set(notify, 5.0);
90 evas_object_smart_callback_add(notify, "timeout", _notify_timeout, NULL); 99 evas_object_smart_callback_add(notify, "timeout", _notify_timeout, NULL);
91 evas_object_smart_callback_add(notify, "block,clicked", _notify_block, NULL); 100 evas_object_smart_callback_add(notify, "block,clicked", _notify_block, NULL);
101 evas_object_event_callback_add(notify, EVAS_CALLBACK_KEY_DOWN,
102 _notify_key_down_cb, NULL);
92 103
93 bx = elm_box_add(win); 104 bx = elm_box_add(win);
94 elm_object_content_set(notify, bx); 105 elm_object_content_set(notify, bx);
diff --git a/src/bin/test_popup.c b/src/bin/test_popup.c
index 0685a7c1d..61f0688cc 100644
--- a/src/bin/test_popup.c
+++ b/src/bin/test_popup.c
@@ -107,6 +107,15 @@ _list_click(void *data EINA_UNUSED, Evas_Object *obj,
107} 107}
108 108
109static void 109static void
110_popup_key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
111 Evas_Object *obj EINA_UNUSED, void *event_info)
112{
113 Evas_Event_Key_Down *ev = event_info;
114
115 printf("Key: %s\n", ev->keyname);
116}
117
118static void
110_popup_center_text_cb(void *data, Evas_Object *obj EINA_UNUSED, 119_popup_center_text_cb(void *data, Evas_Object *obj EINA_UNUSED,
111 void *event_info EINA_UNUSED) 120 void *event_info EINA_UNUSED)
112{ 121{
@@ -117,6 +126,8 @@ _popup_center_text_cb(void *data, Evas_Object *obj EINA_UNUSED,
117 "timeout value is 3 seconds"); 126 "timeout value is 3 seconds");
118 elm_popup_timeout_set(popup, 3.0); 127 elm_popup_timeout_set(popup, 3.0);
119 evas_object_smart_callback_add(popup, "timeout", _response_cb, popup); 128 evas_object_smart_callback_add(popup, "timeout", _response_cb, popup);
129 evas_object_event_callback_add(popup, EVAS_CALLBACK_KEY_DOWN,
130 _popup_key_down_cb, NULL);
120 131
121 // popup show should be called after adding all the contents and the buttons 132 // popup show should be called after adding all the contents and the buttons
122 // of popup to set the focus into popup's contents correctly. 133 // of popup to set the focus into popup's contents correctly.