From c8bbf512916d14a2c9e9b4e8571ee3c5e281dbfb Mon Sep 17 00:00:00 2001 From: Jonathan Atton Date: Sun, 1 Nov 2009 19:05:00 +0000 Subject: [PATCH] Elm notify : move evas_callback_add to the end, it can prevent some bugs SVN revision: 43397 --- src/lib/elm_notify.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/lib/elm_notify.c b/src/lib/elm_notify.c index fa1cc8c..04296d3 100644 --- a/src/lib/elm_notify.c +++ b/src/lib/elm_notify.c @@ -259,14 +259,14 @@ elm_notify_add(Evas_Object *parent) wd->notify = edje_object_add(e); elm_notify_orient_set(obj, ELM_NOTIFY_ORIENT_TOP); + elm_notify_parent_set(obj, parent); + evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, obj); evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _resize, obj); evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, obj); evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, obj); - elm_notify_parent_set(obj, parent); - _sizing_eval(obj); return obj; } @@ -298,15 +298,16 @@ elm_notify_content_set(Evas_Object *obj, Evas_Object *content) if (content) { + wd->content = content; + elm_widget_sub_object_add(obj, content); + edje_object_part_swallow(wd->notify, "elm.swallow.content", content); evas_object_event_callback_add(content, - EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); + EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); evas_object_event_callback_add(content, - EVAS_CALLBACK_RESIZE, - _content_resize, obj); - wd->content = content; - elm_widget_sub_object_add(obj, content); + EVAS_CALLBACK_RESIZE, + _content_resize, obj); _sizing_eval(obj); } _calc(obj); @@ -347,6 +348,7 @@ elm_notify_parent_set(Evas_Object *obj, Evas_Object *parent) if (parent) { + wd->parent = parent; edje_object_part_swallow(wd->notify, "elm.swallow.parent", parent); evas_object_event_callback_add(parent, EVAS_CALLBACK_CHANGED_SIZE_HINTS, @@ -363,7 +365,6 @@ elm_notify_parent_set(Evas_Object *obj, Evas_Object *parent) evas_object_event_callback_add(parent, EVAS_CALLBACK_HIDE, _parent_hide, obj); - wd->parent = parent; _sizing_eval(obj); } _calc(obj); -- 2.7.4