Languages

Menu
Sites
Language
issue in emulator back to corresponding content page

i have implemented main menu listview  under content  with listview.the  problem is when i click emulator back button it will came main menu. i need to implement back to(navifram) content list view. 

where can i implement that code

code:-

samples_cb(void *data, Evas_Object *obj, void *event_info)
{
    Evas_Object *vbox, *label;
        Evas_Object *nf = data;
            vbox = elm_box_add(nf);
            elm_object_content_set(nf, vbox);

            /* Icon*/
            Evas_Object *ic = elm_icon_add(vbox);
            elm_image_file_set(ic, "/opt/usr/apps/org.tizen.sample/res/images", NULL);
            elm_box_pack_end(vbox, ic);
            evas_object_show(ic);

            /* Label*/
            label = elm_label_add(vbox);
            elm_object_text_set(label, "<align=left> <b> content</b>");
            evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
            elm_box_pack_end(vbox,label);
            evas_object_show(label);
           evas_object_show(vbox);

}

void
sample_cb(void *data, Evas_Object *obj, void *event_info)
{
    Evas_Object *list;
    Evas_Object *nf = data;

    /* List */
    list = elm_list_add(nf);
    elm_list_mode_set(list, ELM_LIST_COMPRESS);   

elm_list_item_append(list, "Image ", NULL, NULL,samples_cb, nf);   

elm_naviframe_item_push(nf, "Temple", NULL, NULL, list, NULL);

          elm_list_go(list);
}

Responses

4 Replies
colin Rao

Hi,

Suggest to register a callback handler for your naviframe, 

    eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
    eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_MORE, eext_naviframe_more_cb, NULL);

and in your samples_cb, use elm_naviframe_item_push(ad->nf, "vbox", NULL, NULL, vbox, NULL) to replace elm_object_content_set(nf, vbox);

 

colin Rao

F.Y.I.

1. Naviframe create 
    ad->naviframe = elm_naviframe_add(ad->conform);
    evas_object_size_hint_weight_set(ad->naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    eext_object_event_callback_add(ad->naviframe, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
    evas_object_show(ad->naviframe);

 

2. Set pop up callback for the first item:

static Eina_Bool
naviframe_pop_cb(void *data, Elm_Object_Item *it)
{
    /* By returning FALSE, you can reject the popping the item */
    // ui_app_exit();
    return EINA_TRUE;
}

    Elm_Object_Item *nf_it = elm_naviframe_item_push(nf, "Temple", NULL, NULL, list, NULL);
    elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, nf);

3. Samples_cb

static void
samples_cb(void *data, Evas_Object *obj, void *event_info)
{
    Evas_Object *vbox, *label;
    Evas_Object *nf = data;
    vbox = elm_box_add(nf);
    evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_naviframe_item_push(nf, "vbox", NULL, NULL, vbox, NULL);

    /* Icon*/
    Evas_Object *ic = elm_icon_add(vbox);
    evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(ic, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_image_file_set(ic, "/opt/usr/apps/org.tizen.test/res/images/mango.jpg", NULL);
    evas_object_show(ic);
    elm_box_pack_end(vbox, ic);

    /* Label*/
    label = elm_label_add(vbox);
    elm_object_text_set(label, "<align=left> <b> content</b>");
    evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_box_pack_end(vbox,label);
    evas_object_show(label);
    evas_object_show(vbox);
}

ezhilarasan b
hello, it will working on emulator fine.when i try to run it on real device content is not shown
ezhilarasan b
seems it working.. thank you