On Tue, Oct 12, 2010 at 4:02 AM, Andreas Volz <li...@brachttal.net> wrote:
> Hello,
>
> I'm just playing with the Edje externals features. I build a GUI with
> some Elm widgets and now try to change the widget text and content:
>
> Here is a part of my code:
>
>  Evas_Object *ext_eo = edje_object_part_external_object_get (eo,
>  "Button01"); elm_button_label_set (ext_eo, "This is a changed
>  button");
>
>  // -> this doesn't change the List! Why?
>  ext_eo = edje_object_part_external_object_get (eo, "List01");
>  assert (elm_list_item_append (ext_eo, "1. Line", NULL, NULL, NULL,
>  NULL)); assert (elm_list_item_append (ext_eo, "2. Line", NULL, NULL,
>  NULL, NULL)); assert (elm_list_item_append (ext_eo, "3. Line", NULL,
>  NULL, NULL, NULL)); assert (elm_list_item_append (ext_eo, "4. Line",
>  NULL, NULL, NULL, NULL));
>

elm_list needs elm_list_go() after changing its items, or it won't
update anything.

>  ext_eo = edje_object_part_external_object_get (eo, "Progressbar01");
>  elm_progressbar_label_set (ext_eo, "This is the status");
>  elm_progressbar_value_set (ext_eo, 0.5);
>
>  Edje_External_Param param;
>  param.type = EDJE_EXTERNAL_PARAM_TYPE_DOUBLE;
>  param.name = "value";
>  param.d = 5;
>  edje_object_part_external_param_set (eo, "Slider01", &param);
>
>  Edje_External_Param param2;
>  param2.type = EDJE_EXTERNAL_PARAM_TYPE_STRING;
>  param2.name = "label";
>  param2.s = "Changed Slider Value";
>  edje_object_part_external_param_set (eo, "Slider01", &param2);
>
> It works to change the simple widgets (buttons, slider, progressbar)
> with both, the API and the params. But adding some elements to a Elm
> List doesn't work. It event doesn't return a problem.
>
> So why doesn''t this work, and how could I get it done?
>
> I noticed a edje_object_part_external_content_get() call, but it has no
> docu. Is this function to get some object to modify the (list) content?
> How does it work? I don't know what content name parameter to give.
>
> Something else:
>
> The docu for edje_object_part_external_object_get() says:
>
> " Almost all swallow rules apply: you should not move, resize, hide,
> show, set the color or clipper of such part. It's a bit more
> restrictive as one must never delete this object!"
>
> The result is a Evas_Object pointer. So what happens if someone calls
> it? Simply nothing and it doesn't hurt? Is it possible to get an error
> if someone calls the functions in a part? I ask this because I like to
> typesafe wrap this in C++. So I could decide between ignoring, throwing
> an Exception or creating derived objects with some less modifier
> functions to let the user not call these funtions.
>

GROUP parts are like SWALLOW that automatically create an Edje object
with the given group and put it in there. EXTERNAL parts are the same, except
they create the widget using the externals framework. After that, Edje handles
its geometry and visibility, so you should not touch that. In
genernal, you never
mess with any property from anything created in Edje, but externals are special
in that they may have a ton of things they can do, of which Edje knows nothing.
So, for that, you must get the object with that function and play with
it as if you
had created, but always taking into consideration the restrictions
mentioned above.
With that said, call that function on a non EXTERNAL part, and you should get
NULL from it. How that works for you on the C++ bindings I don't know.

> Regards
>        Andreas
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to