Dear all

I have a problem in elm_image. (exactly when elm_image use
edje_object_file_set)
When the image is added from edj file, we cannot get the "clicked" callback.
Internally, when the image use edje_object_file_set, EVAS_CALLBACK_MOUSE_UP
event callback is not called.

You can check the problem by using attached diff file.
If you change the the code test_event.c, you can compare the situation.
Change "# if 1" to "#if 0".
Please check this problem.

Thanks.
--
Jaehwan Kim.
Index: src/bin/test.c
===================================================================
--- src/bin/test.c	(리비전 79129)
+++ src/bin/test.c	(작업 사본)
@@ -189,6 +189,7 @@ void test_external_slider(void *data, Evas_Object
 void test_external_scroller(void *data, Evas_Object *obj, void *event_info);
 void test_external_pbar(void *data, Evas_Object *obj, void *event_info);
 void test_external_video(void *data, Evas_Object *obj, void *event_info);
+void test_event(void *data, Evas_Object *obj, void *event_info);
 #ifdef HAVE_EMOTION
 void test_video(void *data, Evas_Object *obj, void *event_info);
 #endif
@@ -710,6 +711,9 @@ add_tests:
    ADD_TEST(NULL, "Micellaneous", "Icon Desktops", test_icon_desktops);
    ADD_TEST(NULL, "Micellaneous", "Floating Objects", test_floating);
 
+   // for test
+   ADD_TEST(NULL, "Test", "Test event", test_event);
+
 #undef ADD_TEST
 
    if (autorun)
Index: src/bin/test_event.c
===================================================================
--- src/bin/test_event.c	(리비전 0)
+++ src/bin/test_event.c	(리비전 0)
@@ -0,0 +1,66 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include <Elementary.h>
+#ifndef ELM_LIB_QUICKLAUNCH
+
+/*
+void _test(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+	static int i = 0;
+
+        if (i%2)
+          elm_image_file_set(obj, "/usr/local/share/elementary/themes/default.edj", "elm/icon/menu/home/default");
+        else
+          elm_image_file_set(obj, "/usr/local/share/elementary/themes/default.edj", "elm/icon/menu/close/default");
+        i++;
+}
+*/
+
+void _test2(void *data, Evas_Object *obj, void *event_info)
+{
+	printf("\"clicked\" callback called ------------------------------------------\n");
+}
+
+void
+test_event(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+{
+   Evas_Object *win;
+   char buf[256];
+
+   win = elm_win_util_standard_add("toolbar8", "Toolbar 8");
+   elm_win_autodel_set(win, EINA_TRUE);
+
+   Evas_Object *bg = elm_bg_add(win);
+   evas_object_color_set(bg, 0, 0, 0, 255);
+
+   Evas_Object *icon = elm_image_add(win);
+
+
+// When we get the image from edj file, we cannot get the "clicked" callback.
+// You can test it by changing the 1 to 0.
+// When we get the image directly, we can get the "clicked" callback.
+// FIXME
+#if 1
+
+   snprintf(buf, sizeof(buf), "%s/themes/default.edj", elm_app_data_dir_get());
+   elm_image_file_set(icon, buf, "elm/icon/menu/home/default");
+
+#else
+
+   snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get());
+   elm_image_file_set(icon, buf, NULL);
+
+#endif
+
+
+   evas_object_smart_callback_add(icon, "clicked", _test2, NULL);
+//   evas_object_event_callback_add(icon, EVAS_CALLBACK_MOUSE_DOWN, _test, NULL);
+   evas_object_resize(icon, 100, 100);
+   evas_object_move(icon, 100, 100);
+   evas_object_show(icon);
+
+   evas_object_resize(win, 420, 250);
+   evas_object_show(win);
+}
+#endif

속성 변경: src/bin/test_event.c
___________________________________________________________________
추가: svn:executable
   + *

Index: src/bin/Makefile.am
===================================================================
--- src/bin/Makefile.am	(리비전 79129)
+++ src/bin/Makefile.am	(작업 사본)
@@ -123,6 +123,7 @@ test_win_inline.c \
 test_win_socket.c \
 test_win_plug.c \
 test_win_state.c \
+test_event.c \
 test.h
 
 if HAVE_EIO
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to