언어 설정

Menu
Sites
Language
How to go Prev window using Back Key

In my app I have pushed two Evas object in the naviframe.

Currently 2nd one is visible as it is on the top of the naviframe.
I want to go from the 2nd Evas object to the 1st Evas object using Back key.

I am using below, when pressing Back Key it is not working. Naviframe_pop_cb is not calling when I  press Back key.

static Eina_Bool naviframe_pop_cb(void *data, Elm_Object_Item *it)
{
     appdata_s *ad = (appdata_s*) data;

  elm_naviframe_item_pop(ad->Content_view);
  dlog_print(DLOG_DEBUG, "POP", "************POP CB CALLED", NULL);
   return EINA_FALSE;
}


void nocontents_cb(void *data, Evas_Object *obj, void *event_info)
{
    appdata_s *ad = (appdata_s*) data;
    Elm_Object_Item *nfIt;
    ad->Content_view = create_content_view(ad);

    nfIt = elm_naviframe_item_push(ad->label, "Draw Your Pattern", NULL, NULL, ad->Content_view, NULL);
    elm_naviframe_item_pop_cb_set(nfIt, naviframe_pop_cb, ad);


}

 

Responses

12 댓글
Vikram

Hi,

Seems you are in a wrong way to use the Naviframe. Suggest you to check the sample code of the IDE, the UI Controls application.

Mosharraf Hossain

hello,
what is wrong in my above code.
here ad->label is my naviframe.
each time I am pushing here.
 

Mosharraf Hossain

In side the create_base_gui
I have made ad->label as naviframe

ad->label = elm_naviframe_add(ad->conform);
create_base_gui
Vikram

but in your code "elm_naviframe_item_pop_cb_set(nfIt, naviframe_pop_cb, ad);", the naviframe_pop_cb will be called while this item (nfit) been pop up.

also, seems you only have one page for the naviframe. Right?

Vikram

and the param of elm_naviframe_item_pop() should be the naviframe, as your sample code it's ad->label

/**
 * @brief Pop an item that is on top of the stack
 *
 * @since_tizen 2.3
 *
 * @param[in] obj The naviframe object
 * @return @c NULL or the content object(if the
 *         elm_naviframe_content_preserve_on_pop_get is true).
 *
 * This pops an item that is on the top(visible) of the naviframe, makes it
 * disappear, then deletes the item. The item that was underneath it on the
 * stack will become visible.
 *
 * @see also elm_naviframe_content_preserve_on_pop_get()
 * @see also elm_naviframe_item_pop_cb_set()
 */
EAPI Evas_Object     *elm_naviframe_item_pop(Evas_Object *obj);

 

Mosharraf Hossain

Ok i got it .
I have two pages in my app
here I have given some part of my 2nd page.
I want to go to the first page from the second page using hardware Back key.
what should do i now for this?

Vikram

you should register the back key event on the naviframe, example:

eext_object_event_callback_add(ad->naviframe, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);

 

Jean Yang

Yes, as Vikram mentioned, the back key event can regisiter as such way.....


eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb,ad);


static void win_back_cb(void *data, Evas_Object *obj, void *event_info) {
    //do something here
}

Palitsyna

Hello,

you can read more information about  eext_object_event_callback_add() function in documentation:

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.native.mobile.apireference/group__EFL__EXTENSION__EVENTS__GROUP.html#ga6f2bcafeeceec2ae39ae1868961b5c99

or in tutorial:

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.tutorials/html/native/ui/efl_extension_tutorial_n.htm

Mosharraf Hossain

Now it is working well.

Thanks to all.

Now I have 3 pages in my app.
After clicking a button i want to go to the first page from the third page.
I am adding the below call back against the button.
but it POPs only one object not two.

evas_object_smart_callback_add(button2, "clicked", navi_pop_cb, ad);

void navi_pop_cb(void *data, Evas_Object *obj, void *event_info)
{
     appdata_s *ad = (appdata_s*) data;
  elm_naviframe_item_pop(ad->label);
  elm_naviframe_item_pop(ad->label);
  
  dlog_print(DLOG_DEBUG, "MMMMMMMMMMMMMMMM" ,"After ************ elm_naviframe_item_pop");
}

 

colin Rao

Hi, 

try this api elm_naviframe_item_pop_to()

pre-condition: you need to store the naviframe item handler which you want to show.

/**
 * @brief Pop the items between the top and the above one on the given item.
 *
 * @since_tizen 2.3
 *
 * @param[in] it The naviframe item
 */
EAPI void             elm_naviframe_item_pop_to(Elm_Object_Item *it);

Palitsyna

Hello,

you can find information about Naviframe API (including info about elm_naviframe_item_pop_to() ) here:

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.native.mobile.apireference/group__Naviframe.html#ga2967b740a1e1ec32290c1494bd0fe875

 

Regards,

Svetlana Palitsyna