Languages

Menu
Sites
Language
Tizen wearable widget's back button is not working as intended.

I am trying to build a tizen wearable widget app.

I initiated the view as below.

int view_init(widget_context_h, int w, int h) {
  Evas_Object *win, *conform, *nf;
  widget_app_get_elm_win(context, &win)
  confom = elm_conformant_add(win)
  nf = elm_naviframe_add(conform)
  
  elm_object_part_content_set(conform, "elm.swallow.content", nf);  
  //_naviframe_pop_cb is never fired (I am logging inside _naviframe_pop_cb)
  eext_event_callback_add(nf, EEXT_CALLBACK_BACK, _naviframe_pop_cb, NULL);

  eext_circle_surface_naviframe_add(nf);
}

After that, I stacked another layout by calling `elm_naviframe_item_push(nf, NULL, NULL, NULL, layout, "empty")`.

Now the stack in naviframe should be: `add item layout` --- `item selection layout`.

 

But once I press physical back button when I am in `item selection layout`, it is expected to go back to `add item layout`  but it is going back to watch face.

 

since `_naviframe_pop_cb` is never fired even though I added eext_event_callback_add, I am suspecting there is any ancestor object receiving EEXT_CALLBACK_BACK.

 

Am I doing something wrong?

 

Responses

1 Replies
woochan lee

Hello.

 

Um... i can get the back button callback in my sample case.

Please refer below code. if you can't find any wrong thing in your application. share your full code  i can may find something.

_naviframe_test_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
{
      dlog_print(DLOG_ERROR, LOG_TAG, "WCC test cb called");
      elm_naviframe_item_pop(obj);
}

static void
create_base_gui(appdata_s *ad)
{
    /*
     * Widget Tree
     * Window
     *  - conform
     *   - layout main
     *    - naviframe */

    /* Window */
    ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
    elm_win_conformant_set(ad->win, EINA_TRUE);
    elm_win_autodel_set(ad->win, EINA_TRUE);

    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);

    /* Conformant */
    ad->conform = elm_conformant_add(ad->win);
    evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_win_resize_object_add(ad->win, ad->conform);
    evas_object_show(ad->conform);

    /* Indicator */
    /* elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW); */

    /* Base Layout */
    ad->layout = elm_layout_add(ad->conform);
    evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_layout_theme_set(ad->layout, "layout", "application", "default");
    evas_object_show(ad->layout);

    elm_object_content_set(ad->conform, ad->layout);

    /* Naviframe */
    ad->nf = elm_naviframe_add(ad->layout);

    /* Eext Circle Surface Creation */
    ad->circle_surface = eext_circle_surface_naviframe_add(ad->nf);

    create_list_view(ad);
    elm_object_part_content_set(ad->layout, "elm.swallow.content", ad->nf);
    evas_object_smart_callback_add(ad->nf, "item,activated", naviframe_item_activated_cb, ad);
         eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_BACK, _naviframe_test_cb, NULL);

    /* Show window after base gui is set up */
    evas_object_show(ad->win);
}