Subject: [E-devel] [E-Devel] [Patch] Edje Message - add the callback
recursively
When you send a message from an edje subgroup (part { type: GROUP
...}), the
message callback isn't called because it tries to reach
ed->message.func,
which is only defined for the top edje part.
This patches adds the callback and data to all the subgroups
recursively.
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@50538
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
void
_edje_message_cb_set(Edje *ed, void (*func) (void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg), void *data)
{
+ int i;
+
ed->message.func = func;
ed->message.data = data;
+ for (i = 0 ; i < ed->table_parts_size ; i++) {
+ Edje_Real_Part *rp;
+ rp = ed->table_parts[i];
+ if (rp->part->type == EDJE_PART_TYPE_GROUP && rp->swallowed_object) {
+ Edje *edj2 = _edje_fetch(rp->swallowed_object);
+ if (!edj2) continue;
+ _edje_message_cb_set(edj2, func, data);
+ }
+ }
}
Edje_Message *