summaryrefslogtreecommitdiff
path: root/src/examples/ecore/ecore_evas_object_example.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/ecore/ecore_evas_object_example.c')
-rw-r--r--src/examples/ecore/ecore_evas_object_example.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/examples/ecore/ecore_evas_object_example.c b/src/examples/ecore/ecore_evas_object_example.c
index c76f186bb5..0886123c58 100644
--- a/src/examples/ecore/ecore_evas_object_example.c
+++ b/src/examples/ecore/ecore_evas_object_example.c
@@ -12,6 +12,24 @@
12#include <Ecore.h> 12#include <Ecore.h>
13#include <Ecore_Evas.h> 13#include <Ecore_Evas.h>
14 14
15static void
16_mouse_down_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
17{
18 static Eina_Bool flag = EINA_FALSE;
19
20 if (!flag)
21 ecore_evas_object_cursor_set(data, NULL, 0, 1, 1);
22 else
23 {
24 Evas_Object *cursor = evas_object_rectangle_add(ecore_evas_get(data));
25 evas_object_color_set(cursor, 0, 255, 0, 255);
26 evas_object_resize(cursor, 5, 10);
27 ecore_evas_object_cursor_set(data, cursor, 0, 1, 1);
28 }
29
30 flag = !flag;
31}
32
15int 33int
16main(void) 34main(void)
17{ 35{
@@ -30,6 +48,7 @@ main(void)
30 evas_object_resize(bg, 200, 200); 48 evas_object_resize(bg, 200, 200);
31 evas_object_show(bg); 49 evas_object_show(bg);
32 ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE); 50 ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);
51 evas_object_event_callback_add(bg, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, ee);
33 52
34 if (bg == ecore_evas_object_associate_get(ee)) 53 if (bg == ecore_evas_object_associate_get(ee))
35 printf("Association worked!\n"); 54 printf("Association worked!\n");