Languages

Menu
Sites
Language
Box layout ignores items array

Hello Folks,

I have a weird situation in that I want to use the items property of the box element in an edc file. Sadly, the code as shown below does not work:

collections {
  group { name: "swSomeField";
    parts{
      part{
          name: "rawSwallow";
          type: SWALLOW;
          scale: 1;
          mouse_events: 1;
          description { state: "default" 0.0;
         }
      }
    }
  }
  group { name: "main";
      parts {
             part {
             name: "nmg_box";
             type: BOX;
             box{
               items{
                   item { 
                        source: "swSomeField";
                        name: "topField";
                        align: 1.0 0.5;
                     }
                     item {
                        source: "swSomeField";
                        name: "bottomField";
                        align: 1.0 0.5;
                     }
               }
            }
             description {
                 state: "default" 0.0;
                 box {
                 layout: "horizontal_flow";
                 padding: 2 2;
                 align: 0.5 0.5;
                 min: 1 1;
                }
             }
         } // example/box
      }
   }
}

I tried to replace the content of swSomeField with a rectangle, but the contents of the box still did not show up.

collections {
  group { name: "swSomeField";
    parts{
      part{
type: RECT;
                mouse_events: 0;
                description {
                   state: "default" 0.0;
                   color: 255 0 0 255;
                   rel1 {
                      relative: 0.0 0.0;
                      offset: 0 0;
                   }
                   rel2 {
                      relative: 0.5 0.5;
                      offset: 0 0;
                   }
                }
      }
    }
  }
   group { name: "main";
      parts {
             part {
             name: "nmg_box";
             type: BOX;
            box{
                               items{
                   item { 
                        source: "swSomeField";
                        name: "topField";
                  }
               }}
description {
                   state: "default" 0.0;
                   color: 255 0 0 255;
                }
         } // example/box
      }
   }
}

Strangely, all works well if I load the swSomeField directly as a layout (as in the red rectangle is shown).

Responses

3 Replies
Alex Ashirov

Hi,

Could you please share your C language code snippet where your load an edje object's contents?

Daniel Juyung Seo
colin Rao

I also tried this sample code, can't see the swSomeField when it's a box sub item, but can see it when load it directly as a layout.

As the section Group.Parts.Part.Box/Table.Items of Edje Data Collection reference, seems the box items format is right. Strange!!!