[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [E-devel] Resizing Edje Parts - on the road to entrance preview



Hisham Mardam Bey wrote:
On 8/21/06, Hisham Mardam Bey <hisham.mardambey@gmail.com> wrote:
On 8/21/06, Hisham Mardam Bey <hisham.mardambey@gmail.com> wrote:
Long ass irc session took place, I hope things are clearer now (=

I was bored, here's the code you need (minimum, no smart):

#include <Evas.h>
#include <Ecore_Evas.h>
#include <Edje.h>

int main(int argc, char **argv)
{
   Ecore_Evas *ee;
   Evas *evas;
   Evas *evas_i;
   Evas_Object *bg;
   Evas_Object *theme;
   Evas_Object *i;

   ecore_init();
   ecore_evas_init();
   edje_init();

   ee = ecore_evas_software_x11_new(0, 0, 0, 0, 320, 240);
   evas = ecore_evas_get(ee);

   i = ecore_evas_object_image_new(ee);
   evas_i = ecore_evas_get(evas_object_data_get(i, "Ecore_Evas"));
   evas_object_image_size_set(i, 1024, 768);
   evas_object_move(i, 0, 0);
   evas_object_image_fill_set(i, 0, 0, 1024, 768);
   evas_object_resize(i, 1024, 768);
   evas_object_show(i);

   bg = edje_object_add(evas_i);
   edje_object_file_set(bg, "default.edj", "Background");
   evas_object_move(bg, 0, 0);
   evas_object_resize(bg, 1024, 768);
   evas_object_show(bg);

   theme = edje_object_add(evas_i);
   edje_object_file_set(theme, "default.edj", "Main");
   evas_object_move(theme, 0, 0);
   evas_object_resize(theme, 1024, 768);
   evas_object_show(theme);

   evas_object_stack_above(theme, bg);

   /* now lets actually make it fill as much as we want */
   evas_object_image_fill_set(i, 0, 0, 320, 240);

add this here (better this way)
evas_object_resize(i, 320, 240);

   ecore_evas_show(ee);


   ecore_main_loop_begin();
   edje_shutdown();
   ecore_evas_shutdown();
   ecore_shutdown();

   return 0;
}


small correction, read code upwards a bit.

code speaks best :)

I'm right now nearing completion of a generic Thumbnail_Smart object for easier use in future. Thx again Hisham :)