Problem with Grid

Problem with Grid

BY 11 Feb 2016 Native Application Development

Hello! I have this create_gui function:

static void
create_gui(appdata_s *ad)
{

   ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);

   if (elm_win_wm_rotation_supported_get(ad->win)) {
      int rots[4] = { 0, 90, 180, 270 };
      elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
   }

   evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);

   elm_win_autodel_set(ad->win, EINA_TRUE);

   ad->conformant = elm_conformant_add(ad->win);

   evas_object_size_hint_max_set(ad->conformant, 360, 360);

   elm_win_resize_object_add(ad->win, ad->conformant);

   evas_object_show(ad->conformant);

   ad->naviframe = elm_naviframe_add(ad->conformant);
   elm_object_content_set(ad->conformant, ad->naviframe);


   Evas_Object *grid = elm_grid_add(ad->naviframe);
   evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_show(grid);

   elm_naviframe_item_push(ad->naviframe, "Catch It!", NULL, NULL, grid, NULL);

   Evas_Object *l = elm_label_add(grid);
   elm_object_text_set(l, "Test");

   elm_grid_pack(grid, l, 100, 100, 50, 50);


   // Show window after the GUI is set up
   evas_object_show(ad->win);
}

And the problem is that I see only “Catch It” label and that means that second label “Test” isn’t on the grid. What is my mistake here?

Please, help 🙂

Written by