static void
_populate_1(Evas_Object *win, Elm_Object_Item *menu_it)
{
- Elm_Object_Item *menu_it2;
+ Elm_Object_Item *menu_it2, *menu_it3;
Evas_Object *radio;
radio = elm_radio_add(win);
elm_object_text_set(radio, "radio in menu");
menu_it2 = elm_menu_item_add(menu, menu_it, "object-rotate-left", "menu 1",
NULL, NULL);
- elm_menu_item_add_object(menu, menu_it, radio, NULL, NULL);
+ menu_it3 = elm_menu_item_add(menu, menu_it, NULL, NULL, NULL, NULL);
+ elm_object_item_content_set(menu_it3, radio);
_populate_2(menu_it2);
}
elm_main(int argc, char **argv)
{
Evas_Object *win, *bg, *menu, *button, *rect;
- Elm_Object_Item *menu_it;
+ Elm_Object_Item *menu_it, *menu_it1;
win = elm_win_add(NULL, "menu", ELM_WIN_BASIC);
elm_win_title_set(win, "Menu");
elm_menu_item_add(menu, menu_it, "object-rotate-left", "menu 1", NULL, NULL);
button = elm_button_add(win);
elm_object_text_set(button, "button - delete items");
- elm_menu_item_add_object(menu, menu_it, button, NULL, NULL);
+ menu_it1 = elm_menu_item_add(menu, menu_it, NULL, NULL, NULL, NULL);
+ elm_object_item_content_set(menu_it1, button);
evas_object_smart_callback_add(button, "clicked", _del_it, menu);
elm_menu_item_separator_add(menu, menu_it);
elm_menu_item_add(menu, menu_it, NULL, "third item", NULL, NULL);
EINA_DEPRECATED EAPI void elm_web_history_enable_set(Evas_Object *obj, Eina_Bool enable);
/**
+ * @brief Add an object swallowed in an item at the end of the given menu
+ * widget
+ *
+ * @param obj The menu object.
+ * @param parent The parent menu item (optional)
+ * @param subobj The object to swallow
+ * @param func Function called when the user select the item.
+ * @param data Data sent by the callback.
+ * @return Returns the new item.
+ *
+ * Add an evas object as an item to the menu.
+ * @deprecated please use "elm_menu_item_add" + "elm_object_item_content_set" instead.
+ */
+EINA_DEPRECATED EAPI Elm_Object_Item *elm_menu_item_add_object(Evas_Object *obj, Elm_Object_Item *parent, Evas_Object *subobj, Evas_Smart_Cb func, const void *data);
+
+/**
* @}
*/
return (Elm_Object_Item *) subitem;
}
-EAPI Elm_Object_Item *
+EINA_DEPRECATED EAPI Elm_Object_Item *
elm_menu_item_add_object(Evas_Object *obj, Elm_Object_Item *parent, Evas_Object *subobj, Evas_Smart_Cb func, const void *data)
{
Elm_Menu_Item *subitem;
EAPI Elm_Object_Item *elm_menu_item_add(Evas_Object *obj, Elm_Object_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
/**
- * @brief Add an object swallowed in an item at the end of the given menu
- * widget
- *
- * @param obj The menu object.
- * @param parent The parent menu item (optional)
- * @param subobj The object to swallow
- * @param func Function called when the user select the item.
- * @param data Data sent by the callback.
- * @return Returns the new item.
- *
- * Add an evas object as an item to the menu.
- */
-//XXX: Any better API name? "_item_add_object" looks not good enough.
-EAPI Elm_Object_Item *elm_menu_item_add_object(Evas_Object *obj, Elm_Object_Item *parent, Evas_Object *subobj, Evas_Smart_Cb func, const void *data);
-
-/**
* @brief Set the icon of a menu item to the standard icon with name @p icon
*
* @param it The menu item object.
- * @param icon The icon object to set for the content of @p item
+ * @param icon The name of icon object to set for the content of @p item
*
* Once this icon is set, any previously set icon will be deleted.
*/