No, custom constructor is not the old one.

You need to use:

#define elm_obj_win_constructor(name, type)
ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR), EO_TYPECHECK(const
char *, name), EO_TYPECHECK(Elm_Win_Type, type)

>From elm_win.h.

And well, you should switch to Eo for all the objects. Please also talk to
Yakov in CC, as I believe he has already got Python bindings for Eo.


On Tue, Jan 29, 2013 at 9:18 PM, Davide Andreoli <d...@gurumeditation.it>wrote:

> 2013/1/29 Tom Hacohen <t...@stosb.com>
>
> > Don't use eo_del/unref as counterparts to the old API. Create the objects
> > with the new API if you would like to use them...
> >
>
> Hi, thanks for the fast reply.
>
> I have tried that approach but I have problems with some objects than,
> for example elm_win:
> if I do:
> win = eo_add(ELM_OBJ_WIN_CLASS, NULL);
>
> I get the error:
> ERR<3716>:elementary elm_win.c:2979 _constructor() only custom constructor
> can be used with 'elm_win' class
>
> "custom constructor" is the old one right?
> In that case I have to manage different delete cases for objs that support
> eo and the ones that don't,
> and I lost all the benefits of a single-delete-code for every objects :/
>
> thanks
> davemds
>
>
>
> > On 29 Jan 2013 19:37, "Davide Andreoli" <d...@gurumeditation.it> wrote:
> >
> > > Hi all,
> > > I'm working/studying Eo while trying to optimize the python bindings
> > > and I have some problems deleting eo objects.
> > >
> > > see this super simple example:
> > > (pastebin.com/1C0dqdYA for a "colored" version)
> > >
> > >
> > > #include <Eo.h>
> > > #include <Elementary.h>
> > >
> > > void
> > > my_win_del(void *data, Evas_Object *obj, void *event_info)
> > > {
> > >    elm_exit();
> > > }
> > >
> > > EAPI_MAIN int
> > > elm_main(int argc, char **argv)
> > > {
> > >     Evas_Object *win, *r;
> > >
> > >     win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
> > >     elm_win_title_set(win, "Elementary Tests");
> > >     evas_object_smart_callback_add(win, "delete,request", my_win_del,
> > > NULL);
> > >     evas_object_resize(win, 320, 320);
> > >     evas_object_show(win);
> > >
> > >     r = evas_object_rectangle_add(evas_object_evas_get(win));
> > >     evas_object_resize(r, 100, 100);
> > >     evas_object_show(r);
> > >
> > >     evas_object_del(r); // this one work as expected
> > >     // eo_del(r);               // this give a bad warnig
> > >     // eo_unref(r);            // this cause an endless loop on
> > > elm_shutdown
> > >
> > >     elm_run();
> > >     elm_shutdown();
> > >
> > >     return 0;
> > > }
> > >
> > > ELM_MAIN()
> > >
> > >
> > >
> > > The example simply create a rectangle and then delete it, the only
> > working
> > > way to delete the rect
> > > seems to be the evas_object_del call (that work as expected)
> > >
> > > Using eo_del() to delete the rect cause this warning:
> > > ERR<3219>:eo lib/eo/eo.c:1306 _eo_unref() Object 0x21d9920 already
> > deleted.
> > > ERR<3219>:eo lib/eo/eo.c:1306 _eo_unref() Object 0x21d9920 already
> > deleted.
> > > as soon as you call eo_del()
> > >
> > > While eo_unref() cause an endless loop on elm_shutdown with this
> warning
> > > repeated forever:
> > > CRI<3242>: lib/eo/eo.c:1081 eo_parent_set() *** Eina Magic Check Failed
> > at
> > > 0x1a88f80 !!!
> > >     Input handle is wrong type
> > >     Expected: a186bc32 - Eo
> > >     Supplied: afda6798 - (unknown)
> > > *** NAUGHTY PROGRAMMER!!!
> > > *** SPANK SPANK SPANK!!!
> > > *** Now go fix your code. Tut tut tut!
> > >
> > >
> > > I'm doing something wrong? I'm misunderstanding something?
> > >
> > > any help is appreciated
> > >
> > > thanks
> > > davemds
> > >
> > >
> >
> ------------------------------------------------------------------------------
> > > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> > > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> > > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> > > MVPs and experts. ON SALE this month only -- learn more at:
> > > http://p.sf.net/sfu/learnnow-d2d
> > > _______________________________________________
> > > enlightenment-devel mailing list
> > > enlightenment-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> > >
> >
> >
> ------------------------------------------------------------------------------
> > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> > MVPs and experts. ON SALE this month only -- learn more at:
> > http://p.sf.net/sfu/learnnow-d2d
> > _______________________________________________
> > enlightenment-devel mailing list
> > enlightenment-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> >
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnnow-d2d
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>



-- 
Tom.
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to