Hi devs !

I'm begining to play with edje and have difficulties to swallow an
evas_object_image into an edje part swallow.
I'm under the impression I have to call evas_object_image_fill_set() before
swalloing the image into the edje but I must do something wrong because
either my image isn't scaled to the swallowing part or I get something gray.

Here is what I do :
    [...]
    my_edje = edje_object_add(evas);
    edje_object_file_set(my_edje, "theme.edj", "main");

    evas_object_move(my_edje, 0, 0);
    edje_object_size_min_get(my_edje, &w ,&h);
    evas_object_resize(my_edje, w, h);
    ecore_evas_resize(ecore_evas, w, h);

    image = evas_object_image_add(evas);
    evas_object_image_file_set(image, "/path/to/my/image.jpg", NULL);
    evas_object_name_set(image, "image_swallow");
    const Evas_Object *swallow = NULL;
    swallow = edje_object_part_object_get(my_edje, "place_for_image");
    edje_object_size_min_get(swallow, &w, &h);
    evas_object_image_fill_set(image, 0, 0, w, h);
    edje_object_part_swallow(my_edje, "place_for_image", image);
    [...]

And the edc :

collections {
    group { name: "main";
        min: 131 111;
        max: 131 111;
        parts {
            part { name: "bg";
                type: RECT;
                description { state: "default" 0;
                    min:131 111;
                    max:131 111;
                    color: 255 255 255 255;
                }
            }

            part { name: "image_swallow";
                type: SWALLOW;
                clip_to: "bg";
                description { state: "default" 0;
                    min: 100 100;
                    rel1.relative: 0.15 0.07;
                    rel2.relative: 0.91 0.95;
                }
            }
        [...]

I should be wrong somewhere (in fact I don't like to set the min size of the
swallowed part..)
So, iIs there anyone to help me please ?

Vincent
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to