Mobile native

[UI Sample] Proxy Object Sample Overview

The Proxy Object sample demonstrates how to make a proxy object for an Evas object.

The following figure illustrates the main screen of Proxy Object.

Figure: Proxy Object screen

Proxy Object screen

Implementation

The following code snippet shows the struct for dealing with proxy objects.

struct anim_data 
{
   Evas_Object *btn;
   Evas_Object *img1;
   Evas_Object *img2;
};

The following code snippet demonstrates how to create proxy objects. The evas_object_image_source_set() function creates a proxy object for an Evas_Object. The evas_object_image_source_visible_set() function sets the proxy object to be visible.

void
proxy_exam(Evas_Object *win)
{
   static struct anim_data ad;

   ad.btn = elm_button_add(win);
   elm_object_text_set(ad.btn, "Proxy Object");
   evas_object_move(ad.btn, 100, 100);
   evas_object_resize(ad.btn, 200, 200);
   evas_object_show(ad.btn);

   Evas *evas = evas_object_evas_get(win);
   ad.img1 = evas_object_image_filled_add(evas);
   evas_object_image_source_set(ad.img1, ad.btn);
   evas_object_image_source_visible_set(ad.img1, EINA_FALSE);
   evas_object_move(ad.img1, 100, 100);
   evas_object_resize(ad.img1, 200, 200);
   evas_object_show(ad.img1);

   ad.img2 = evas_object_image_filled_add(evas);
   evas_object_image_source_set(ad.img2, ad.btn);
   evas_object_move(ad.img2, 100, 300);
   evas_object_resize(ad.img2, 200, 200);
   evas_object_show(ad.img2);
}
Go to top