On Wed, 12 Mar 2014 12:20:43 -0400 Robert Heller <hel...@deepsoft.com> said:
> With code like this: > > Evas_Object *o; > > o = edje_object_add(e_comp_get(m->zone)->evas); > evas_object_name_set(o, "menu->sw_bg_object"); > evas_object_data_set(o, "e_menu", m); > e_theme_edje_object_set(o, "base/theme/menus", > "e/widgets/menu/default/background"); > m->sw_bg_object = o; > sm_object = e_start_menu_realize_inwindow(m,m->sw_bg_object); > edje_object_part_swallow(m->sw_bg_object,"e.swallow.content",sm_object); > m->cur.w = 350; > m->cur.h = 420; > m->cur.x = 0; > m->cur.y = 0; > > And later (in the idle handler): > > evas_object_move(m->sw_bg_object,m->cur.x,m->cur.y); > evas_object_resize(m->sw_bg_object,m->cur.w,m->cur.h); > E_LAYER_SET(m->sw_bg_object,E_COMP_CANVAS_LAYER_MENU); > E_LAYER_SET(m->container_object,E_COMP_CANVAS_LAYER_MENU); > evas_object_show(m->sw_bg_object); > > e_start_menu_realize_inwindow() contains: > > Evas_Object *o; > > /* Create the menu container, an Elm Table widget. */ > o = elm_table_add(canvas); > m->container_object = o; > elm_table_homogeneous_set(o, EINA_FALSE); > elm_table_padding_set(m->container_object, 5, 5); > evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); > evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); > evas_object_name_set(o, "menu->container_object"); > evas_object_intercept_move_callback_add(o,_e_intercept_container_move,m); > evas_object_intercept_resize_callback_add > (o,_e_intercept_container_resize,m); elm_object_focus_allow_set > (m->container_object, EINA_TRUE); elm_object_focus_set ( m->container_object, > EINA_TRUE); > > /* e_start_menu_realize_inwindow() then populates m->container_object > * -- eg create more elm widgets and pack them with > * elm_table_pack(m->container_object, ...) calls -- standard stuff > * straight out of the elementary docs. > */ > > /* Finally: */ > /* Return the container. */ > return m->container_object; > > This code works, but the widgets in m->container_object have a *transparent* > background, that is, for some reason 'm->sw_bg_object' is ending up as > transparent, even though "e/widgets/menu/default/background" isn't defined as > transparent (as far as my understanding of the menu.edc file in the theme > goes). I don't want that. What do I need to do to NOT have a transparent > background? Should I be using a *different* theme group? Am I missing a > edje_object<mumble> function call somewhere? you're missing some information here. or confused. yes - normally menu items we have in e are transparent (widgets IN m->container_object... ie inside of it, not the container itself or the bg object which is a parent). this is what is designed and wanted so the menu background (bg object) shows through, UNTIL a menu item is selected, then it becomes "solid" (dark black with some gradients, shadowing etc.). that's the way it's designed, but then later you're talking about the menu background being transparent... which it is not by default. for sure. so is it that your menu background is transparent .. and that's your problem, or that the items themselves are transparent and you see through to the menu background? i do have some q's - why do you set move/resize intercepts on the table? you want the emnu bg to swallow your table and control it... why not just let it do that? also be aware using elm objects in e's canvas like this will mean certain things are going to be iffy - like focus handling, so i'd suggest skipping that for not (elm_object_focus_* calls - just going to clutter up your code at the moment). also setting padding manually - i don't suggest that. it won't scale based on dpi or scaling factors, or finger size etc. i'd suggest not having any padding,a dn any spacing around items, do that in the theme, not in code (ie in edc). also you set the name of the container object.. you know if you have submenus or other menus, with the same name, there can be a clash. i generally avoid setting object names because they do share a flat namespace. beware. also tables are not homogeneous by default. no need to set that to false as that's how they come. -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) ras...@rasterman.com ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel