From: Gustavo S. B. <bar...@pr...> - 2012-07-31 15:00:59
|
On Tue, Jul 31, 2012 at 11:34 AM, Gustavo Lima Chaves <gl...@pr...> wrote: > * Gustavo Sverzut Barbieri <bar...@pr...> [2012-07-31 11:28:49 -0300]: > >> On Tue, Jul 31, 2012 at 9:44 AM, Eunmi Lee <my...@gm...> wrote: >> > Vincent and Gustavo, thank you for reply. >> > >> > But I could not find the answer from emotion and elementary, >> > because I want to make the Evas_Object which is inheritable and gets >> > value from the constructor's parameter. >> > >> > Elementary gets the parent as a parameter in the constructor, but >> > elementary widget is not inheritable, so they can do everything in the >> > constructor. >> > Let's imagine to make the elm_popup inheritable. where can we make the >> > Widget_Data and how can we pass the parent to make the wd->notify? >> > >> > If I don't have to make my Evas_Object inheritable, I can do >> > everything in the constructor like an Elementary and Emotion widget. >> > If I don't have to pass the value which is used to initialize >> > Evas_Object, it is easy to make it. >> > However, I want to do both of them. >> > >> > I really want to find the way to get the both of inheritance and value >> > of constructor. >> >> Gustavo Lima replied with pointers on how to do it. >> >> But I insist you're looking it from the wrong point of view. There is >> no constructor parameter concepts for Evas_Object. period, accept >> that. The proper way to do it is to have another method call AFTER the >> constructor: >> >> Evas_Object *o = evas_object_smart_add(e, my_smart); >> my_property_set(o, my_parameter); >> >> You can expose this in two forms: >> 1. Wrapped inside your own constructor (not-EFL like): >> Evas_Object *my_obj_add(Evas *e, my_type my_parameter) { >> Evas_Object *o = evas_object_smart_add(e, my_smart); >> my_property_set(o, my_parameter); >> return o; >> } >> >> 2. Explicitly expose a constructor without parameter and a public >> (EAPI) method. >> >> For other details look at glima's email. > > Barbieri, I bet what he wants is setting the object's smart data > *inside its smart_add() function*. That's the place to do it. this part is already covered by your email :-) -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -------------------------------------- MSN: bar...@gm... Skype: gsbarbieri Mobile: +55 (19) 9225-2202 |