From: Diego J. <jac...@gm...> - 2009-08-09 22:52:48
|
Thanks both. I can now resize. Wasnt so hard, so sry for the noob question. I tryed now the "modern" way, and i noted something: The next code, doesnt finish the application if i close it. The windows disappears but the process still alive. edje = edje_object_add(evas); ecore_evas_object_associate( ee, edje, ECORE_EVAS_OBJECT_ASSOCIATE_DEL | ECORE_EVAS_OBJECT_ASSOCIATE_LAYER | ECORE_EVAS_OBJECT_ASSOCIATE_STACK | ECORE_EVAS_OBJECT_ASSOCIATE_BASE ); The next code, will resize too, but it will terminate the application when closing it. edje = edje_object_add(evas); ecore_evas_object_associate( ee, edje, ECORE_EVAS_OBJECT_ASSOCIATE_LAYER | ECORE_EVAS_OBJECT_ASSOCIATE_STACK | ECORE_EVAS_OBJECT_ASSOCIATE_BASE ); So what is " ECORE_EVAS_OBJECT_ASSOCIATE_DEL " for? I was expecting something like "delete the asociated object with the ee". Cheers. Diego 2009/8/10 Gustavo Sverzut Barbieri <bar...@pr...>: > On Sat, Aug 8, 2009 at 3:59 PM, Christopher > Michael<cpm...@co...> wrote: >> Seems like you need to use ecore_evas_callback_resize_set. EG: >> >> > ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, WIDTH, HEIGHT); >> > ecore_evas_title_set(ee, "EDJE example"); >> > ecore_evas_borderless_set(ee, 0); >> > ecore_evas_shaped_set(ee, 0); >> ecore_evas_callback_resize_set(ee, _my_resize_func); >> > //ecore_evas_show(ee); >> >> >> > edje = edje_object_add(evas); >> evas_object_name_set(edje, "bg"); >> > edje_object_file_set(edje, "edje/XXX.edj", "test"); >> > evas_object_move(edje, 0, 0); >> > edje_object_size_min_get(edje, &edje_w, &edje_h); >> > if ( edje_w <= 10 ) >> > edje_w = WIDTH; >> > if ( edje_h <= 10 ) >> > edje_h = HEIGHT; >> > evas_object_resize(edje, edje_w, edje_h); >> > evas_object_show(edje); >> >> >> static void _my_resize_func(Ecore_Evas *ee) >> { >> Evas_Object *o = NULL; >> int w = 0, h = 0; >> >> if (!(o = evas_object_name_find(ecore_evas_get(ee), "bg"))) return; >> ecore_evas_geometry_get(ee, NULL, NULL, &w, &h); >> evas_object_move(o, 0, 0); >> evas_object_resize(o, w, h); >> } > > There are more "modern" ways to do it, namely: > > - ecore_evas_object_associate(): maps window operations to objects, > so resize object resizes the window, resizes the window resizes the > associated object. Hide, show and others apply as well, depending on > given flags, it can even delete the window and object depending on > other deletion. > > - elm_win_add(): uses ecore_evas_object_associate() and provides > elm_win_resize_object_add(), that does exactly that: resizes objects > when window is resized. > > If you have a single top-level edje (other things can be swallowed > inside this edje, and resized by it), then ecore_evas is the way to > go. You can associate an evas_object_box instead and have children to > be laid out accordingly to size_hint flags. As an example, you might > have an evas_object_box with STACK layout function and all children > set size_hint_weight = (1.0, 1.0), that would layout all objects one > on top of the other and resize children in both dimensions to fit the > box size... if box size is associated with window, then you get what > you want. > > -- > Gustavo Sverzut Barbieri > http://profusion.mobi embedded systems > -------------------------------------- > MSN: bar...@gm... > Skype: gsbarbieri > Mobile: +55 (19) 9225-2202 > |