I tried both BOX and SWALLOW in EDC file but i think i am missing
something. Because I don't see the image at the swallow or box part. I
tried first defining swallow at the edc file. I had used the same
definition i mentioned at previous mail. In the code i used this one:


        Evas_Object *image;
        Evas_Object *box;
        image = evas_object_image_filled_add(evas);
        evas_object_image_file_set(image, "/someimage.png", NULL);
        
       //box related part
        box=evas_object_box_add(evas);
        evas_object_box_layout_set(box,
evas_object_box_layout_homogeneous_max_size_horizontal, NULL, NULL);
        evas_object_size_hint_align_set(image, -1.0, -1.0);
        evas_object_box_append(box, image);
        // box related part     

        edje_object_part_swallow(edje, "picthumblist", box);

If i remove the box related part and change the
edje_object_part_swallow(edje, "picthumblist", box);  to
edje_object_part_swallow(edje, "picthumblist", image); i can see the
image.  But with this usage i don't see my image. Seems something is
missing.

Another thing i tried is defining BOX at EDC as

part {
                        name: "picthumblist";
                        clip_to: "left";
                        repeat_events: 1;
                        type: "BOX";
                        
                        
                        description
                        {
                                state: "default" 0.0;
                                color: 255 255 255 128;
                        visible: 1;
                        
                        box
                        {
                        layout: "horizontal_homogeneous";
                        padding: 0 2;
                        align: 0.5 0.5;
                        
                        }
                        
                        
                        rel1
                        {
                                relative: 0 0;
                                offset: 40 40;
                                to: left;
                        }
                        rel2
                        {
                                relative: 0 1;
                                offset: 800 -70;
                                to: left;
                        }
                        }
                }

and use evas_object_box api at code

   Evas_Object *img;
        img=evas_object_image_filled_add(evas);
        evas_object_image_file_set(img, "/someimage.png", NULL);
        //evas_object_resize(img, 256, 192);

        Evas_Coord x, y;
        int w, h;
        //edje_object_part_geometry_get(edje, "picthumblist", &x, &y, &w, &h);
        //printf("x:%d, y:%d, w:%d, h:%d\n", x, y, w, h);
                
        evas_object_size_hint_align_set(img, -1.0, -1.0);       
        printf("%d\n",edje_object_part_box_append(edje, "picthumblist", img));


This didn't worked either. So what am i doing wrong?


On Mon, Jan 26, 2009 at 8:06 PM, Gustavo Sverzut Barbieri
<barbi...@profusion.mobi> wrote:
> 2009/1/26 Oguz Yarimtepe <comp....@gmail.com>:
>> Hi,
>>
>> I was trying to set a box that will include some thumbs at my
>> application but i couldn't find how to use swallowing with a box that
>> will include some pics. Here is the EDC part:
>>
>> part {
>>                        name: "picthumblist";
>>                        clip_to: "left";
>>                        repeat_events: 1;
>>                        type: "SWALLOW";
>
> You rather use "type: BOX" ;-)
>
>
>> Ned here is the code:
>>
>>       Evas_Object *box;
>>        Evas_Object *img;
>>        box=evas_object_box_add(evas);
>>        evas_object_box_layout_set(box,
>> evas_object_box_layout_homogeneous_max_size_horizontal, NULL, NULL);
>>
>>        img=evas_object_image_filled_add(evas);
>>        evas_object_image_file_set(img, "/animage.png", NULL);
>>        evas_object_box_prepend(box, img);
>
> almost fine, but if you want your object to be resized you must use
> size_hints, see documentation at evas_object_box.c or
> http://docs.enlightenment.org/api/evas/html/group__Evas__Object__Box.html#g9c9046e3d12eefca2d53992521e9bdd9
> more specifically under "Child element's properties". In code:
>
> evas_object_size_hints_align_set(img, -1.0, -1.0);
> evas_object_box_prepend(box, img);
>
>
> should be that.
>
> Yes, we really lack some examples about box and table, which are quite
> new. If you have some minutes, please add some examples at
> http://trac.enlightenment.org/wiki/ we'd appreciate.
>
> --
> Gustavo Sverzut Barbieri
> http://profusion.mobi embedded systems
> --------------------------------------
> MSN: barbi...@gmail.com
> Skype: gsbarbieri
> Mobile: +55 (19) 9225-2202
>



-- 
Oğuz Yarımtepe
www.loopbacking.info

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to