언어 설정

Menu
Sites
Language
Button/window not showing in GUI: - Gear wearables

Following the samsung online tutorials, I seem to cant get the gui to show up on screen. Please check out the code from my create_base_gui function:

create_base_gui(appdata_s *ad)
{
    /* Window */
	ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
	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);
	/*eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);*/

	/* Conformant */
	ad->conform = elm_conformant_add(ad->win);
	elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
	elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_OPAQUE);
	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);

	/*Naviframe*/
	ad->naviframe = elm_naviframe_add(ad->conform);
	elm_object_content_set(ad->conform, ad->naviframe);

	evas_object_show(ad->conform);

	/*Button*/
	ad->Button = elm_button_add(ad->naviframe);
	evas_object_size_hint_weight_set(ad->Button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	evas_object_size_hint_align_set(ad->Button, EVAS_HINT_FILL, 1);
	elm_object_text_set(ad->Button, "Record");
	evas_object_smart_callback_add(ad->Button, "clicked", RecordMode_Bt_Clicked, ad);

	evas_object_show(ad->Button);


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

 

 

답변 바로가기

Responses

3 댓글
Jakub Wiśniewski

I don't see show called on naviframe. This is how I create naviframe with callbacks.

    /* Naviframe */
    ad->naviframe = elm_naviframe_add(ad->conform);
    elm_object_content_set(ad->conform, ad->naviframe);
    eext_object_event_callback_add(ad->naviframe, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
    eext_object_event_callback_add(ad->naviframe, EEXT_CALLBACK_MORE, eext_naviframe_more_cb, NULL);
    evas_object_show(ad->naviframe);

 

Naviframe is also a stack of views so you should push content to it eg:

    Elm_Object_Item *nf_it = elm_naviframe_item_push(ad->naviframe, "title", NULL, NULL, content, NULL);

Where in your case content would be button. But I would create box, add button to the box and then set box as content - easier to expand later.

Mark as answer
Mango Bar

You have to push your button in naviframe using elm_naviframe_item_push method.

 

        ad->naviframe = elm_naviframe_add(ad->conform);
        elm_object_content_set(ad->conform,ad->naviframe);
	evas_object_show(ad->naviframe);


	ad->button = elm_button_add(ad->naviframe);
	evas_object_size_hint_weight_set(ad->button,EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
	evas_object_size_hint_align_set(ad->button,EVAS_HINT_FILL,1);
	elm_object_text_set(ad->button,"Click Me");
	evas_object_smart_callback_add(ad->button,"clicked",button_cb,ad);
	evas_object_show(ad->button);

	elm_naviframe_item_push(ad->naviframe, "", NULL, NULL, ad->button, NULL);

 

Mark Stoge

I want to add both as answers, but i can't.