List in a popup

List in a popup

BY 12 Apr 2018 Native Application Development

I’m tryin to display a normal list (not a genlist) in a popup window.

But i tried all possible combination, but there is no way of having it displayed.

This is the latest version of the code: 

void create_popup(void *data, Evas_Object *obj, void *event_info){
    Evas_Object *list;
	Evas_Object *parent = obj;

	/* Create the popup */
	Evas_Object *popup = NULL, *content = NULL;
	popup = elm_popup_add(parent);
	//elm_object_style_set(popup, "theme_bg");
	elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
	evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);

	elm_object_part_text_set(popup, "title,text", "Title");
	elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);

	list = elm_list_add(popup);
	elm_list_mode_set(list, ELM_LIST_COMPRESS);
	evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
	char tmpString[16];
	sprintf(tmpString, "Reset Game");
	dlog_print(DLOG_INFO, APP_TAG, tmpString);
	elm_list_item_append(list, tmpString, NULL, NULL, NULL, NULL);
	elm_list_item_append(list, tmpString, NULL, NULL, NULL, NULL);



	/* Register the Back key event callback */
	eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
	/* Show the popup */
	elm_object_content_set(popup, list);
	evas_object_show(popup);
}

 And anyway i tried the following changes:

  • Adding a layout, and adding the list to the layout (it worked with other components in the popup, but not with the list), then the layout was set as content of the popup in elm_object_content_set
  • I tried to add the list to the parent instead of the popup
  • I tried to remove the styles

The only thing that is displayed is the title.

I can’t understand what i’m doing wrong, with other components everything works fine. Except for this case. 

Anyway what i’m trying  to achieve is to create a menu when the menu button is pressed.

I started from the example here: https://developer.tizen.org/development/guides/native-application/user-interface/efl/hardware-input-handling/managing-menu-and-back-key-events 

Please help me. 

 

Written by