From 35529c84c065bfcd3d8817c29706db8a1de6928c Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 11 Oct 2012 01:39:52 +0000 Subject: [PATCH] ecore: fix ecore_magic_fail error in ecore_imf_example.c SVN revision: 77841 --- legacy/ecore/src/examples/ecore_imf_example.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/legacy/ecore/src/examples/ecore_imf_example.c b/legacy/ecore/src/examples/ecore_imf_example.c index c2d02a0bec..f1db75723a 100644 --- a/legacy/ecore/src/examples/ecore_imf_example.c +++ b/legacy/ecore/src/examples/ecore_imf_example.c @@ -62,17 +62,25 @@ _entry_focus_out_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _canvas_focus_in_cb(void *data, Evas *e, void *event_info) { + Entry *en; Evas_Object *obj = evas_focus_get(e); - if (obj) - _entry_focus_in_cb(obj, NULL, NULL, NULL); + if (!obj) return; + + en = evas_object_data_get(obj, "Entry"); + if (en) + _entry_focus_in_cb(en, NULL, NULL, NULL); } static void _canvas_focus_out_cb(void *data, Evas *e, void *event_info) { + Entry *en; Evas_Object *obj = evas_focus_get(e); - if (obj) - _entry_focus_out_cb(obj, NULL, NULL, NULL); + if (!obj) return; + + en = evas_object_data_get(obj, "Entry"); + if (en) + _entry_focus_out_cb(en, NULL, NULL, NULL); } static void @@ -399,6 +407,7 @@ create_input_field(Evas *evas, Entry *en, Evas_Coord x, Evas_Coord y, Evas_Coord evas_object_move(en->rect, x, y); evas_object_resize(en->rect, w, h); evas_object_show(en->rect); + evas_object_data_set(en->rect, "Entry", en); /* create text object for displaying text */ en->txt_obj = evas_object_textblock_add(evas);