Functions
Menu

Functions

EOAPI Elm_Widget_Item * elm_obj_menu_selected_item_get (const Eo *obj)
 Get the selected item in the menu. More...
 
EOAPI const Eina_Listelm_obj_menu_items_get (const Eo *obj)
 Returns a list of the item's items.
 
EOAPI Elm_Widget_Item * elm_obj_menu_first_item_get (const Eo *obj)
 Get the first item in the menu.
 
EOAPI Elm_Widget_Item * elm_obj_menu_last_item_get (const Eo *obj)
 Get the last item in the menu.
 
EOAPI void elm_obj_menu_move (Eo *obj, Evas_Coord x, Evas_Coord y)
 Move the menu to a new position. More...
 
EOAPI Elm_Widget_Item * elm_obj_menu_item_add (Eo *obj, Elm_Widget_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
 Add an item at the end of the given menu widget. More...
 
EOAPI void elm_obj_menu_close (Eo *obj)
 Close a opened menu. More...
 
EOAPI Elm_Widget_Item * elm_obj_menu_item_separator_add (Eo *obj, Elm_Widget_Item *parent)
 Add a separator item to menu obj under parent. More...
 
Elm_Widget_Item * elm_menu_selected_item_get (const Elm_Menu *obj)
 Get the selected item in the menu. More...
 
const Eina_Listelm_menu_items_get (const Elm_Menu *obj)
 Returns a list of the item's items.
 
Elm_Widget_Item * elm_menu_first_item_get (const Elm_Menu *obj)
 Get the first item in the menu.
 
Elm_Widget_Item * elm_menu_last_item_get (const Elm_Menu *obj)
 Get the last item in the menu.
 
void elm_menu_move (Elm_Menu *obj, Evas_Coord x, Evas_Coord y)
 Move the menu to a new position. More...
 
Elm_Widget_Item * elm_menu_item_add (Elm_Menu *obj, Elm_Widget_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
 Add an item at the end of the given menu widget. More...
 
void elm_menu_close (Elm_Menu *obj)
 Close a opened menu. More...
 
Elm_Widget_Item * elm_menu_item_separator_add (Elm_Menu *obj, Elm_Widget_Item *parent)
 Add a separator item to menu obj under parent. More...
 
Evas_Objectelm_menu_add (Evas_Object *parent)
 Add a new menu to the parent. More...
 
void elm_menu_parent_set (Evas_Object *obj, Evas_Object *parent)
 Set the parent for the given menu widget. More...
 
Evas_Objectelm_menu_parent_get (const Evas_Object *obj)
 Get the parent for the given menu widget. More...
 

Detailed Description

menu_inheritance_tree.png
preview-00.png

A menu is a list of items displayed above its parent. When the menu is showing its parent is darkened. Each item can have a sub-menu. The menu object can be used to display a menu on a right click event, in a toolbar, anywhere.

Signals that you can add callbacks for are:

Default content parts of the menu items that you can use for are:

Default text parts of the menu items that you can use for are:

Supported elm_object_item common APIs.

See also
tutorial_menu

Function Documentation

§ elm_obj_menu_selected_item_get()

EOAPI Elm_Widget_Item* elm_obj_menu_selected_item_get ( const Eo obj)

Get the selected item in the menu.

Returns
The selected item or null.

Referenced by elm_menu_selected_item_get().

§ elm_obj_menu_move()

EOAPI void elm_obj_menu_move ( Eo obj,
Evas_Coord  x,
Evas_Coord  y 
)

Move the menu to a new position.

Sets the top-left position of the menu to ($x, y).

Note
x and y coordinates are relative to parent.
Parameters
[in]xThe new position.
[in]yThe new position.

Referenced by elm_menu_move().

§ elm_obj_menu_item_add()

EOAPI Elm_Widget_Item* elm_obj_menu_item_add ( Eo obj,
Elm_Widget_Item *  parent,
const char *  icon,
const char *  label,
Evas_Smart_Cb  func,
const void *  data 
)

Add an item at the end of the given menu widget.

Note
This function does not accept relative icon path.
Parameters
[in]parentThe parent menu item (optional).
[in]iconAn icon display on the item. The icon will be destroyed by the menu.
[in]labelThe label of the item.
[in]funcFunction called when the user select the item.
[in]dataData sent by the callback.
Returns
The new menu item.

Referenced by elm_menu_item_add().

§ elm_obj_menu_close()

EOAPI void elm_obj_menu_close ( Eo obj)

Close a opened menu.

Hides the menu and all it's sub-menus.

Referenced by elm_menu_close().

§ elm_obj_menu_item_separator_add()

EOAPI Elm_Widget_Item* elm_obj_menu_item_separator_add ( Eo obj,
Elm_Widget_Item *  parent 
)

Add a separator item to menu obj under parent.

Parameters
[in]parentThe item to add the separator under.
Returns
The created item or null.

Referenced by elm_menu_item_separator_add().

§ elm_menu_selected_item_get()

Elm_Widget_Item* elm_menu_selected_item_get ( const Elm_Menu *  obj)

Get the selected item in the menu.

Returns
The selected item or null.

References elm_obj_menu_selected_item_get().

§ elm_menu_move()

void elm_menu_move ( Elm_Menu *  obj,
Evas_Coord  x,
Evas_Coord  y 
)

Move the menu to a new position.

Sets the top-left position of the menu to ($x, y).

Note
x and y coordinates are relative to parent.
Parameters
[in]xThe new position.
[in]yThe new position.

References elm_obj_menu_move().

§ elm_menu_item_add()

Elm_Widget_Item* elm_menu_item_add ( Elm_Menu *  obj,
Elm_Widget_Item *  parent,
const char *  icon,
const char *  label,
Evas_Smart_Cb  func,
const void *  data 
)

Add an item at the end of the given menu widget.

Note
This function does not accept relative icon path.
Parameters
[in]parentThe parent menu item (optional).
[in]iconAn icon display on the item. The icon will be destroyed by the menu.
[in]labelThe label of the item.
[in]funcFunction called when the user select the item.
[in]dataData sent by the callback.
Returns
The new menu item.

References elm_obj_menu_item_add().

Referenced by elm_menu_parent_get().

§ elm_menu_close()

void elm_menu_close ( Elm_Menu *  obj)

Close a opened menu.

Hides the menu and all it's sub-menus.

References elm_obj_menu_close().

§ elm_menu_item_separator_add()

Elm_Widget_Item* elm_menu_item_separator_add ( Elm_Menu *  obj,
Elm_Widget_Item *  parent 
)

Add a separator item to menu obj under parent.

Parameters
[in]parentThe item to add the separator under.
Returns
The created item or null.

References elm_obj_menu_item_separator_add().

Referenced by elm_menu_parent_get().

§ elm_menu_add()

Evas_Object* elm_menu_add ( Evas_Object parent)

Add a new menu to the parent.

Parameters
parentThe parent object.
Returns
The new object or NULL if it cannot be created.

Referenced by elm_win_main_menu_get().

§ elm_menu_parent_set()

void elm_menu_parent_set ( Evas_Object obj,
Evas_Object parent 
)

Set the parent for the given menu widget.

Parameters
objThe menu object.
parentThe new parent.

References eina_list_append(), EINA_LIST_FOREACH, eina_list_free(), elm_hover_parent_set(), EVAS_CALLBACK_DEL, EVAS_CALLBACK_RESIZE, evas_object_event_callback_add(), and evas_object_event_callback_del_full().

§ elm_menu_parent_get()

Evas_Object* elm_menu_parent_get ( const Evas_Object obj)

Get the parent for the given menu widget.

Parameters
objThe menu object.
Returns
The parent.
See also
elm_menu_parent_set()

References eina_list_append(), eina_list_count(), EINA_LIST_FOREACH, eina_list_remove(), eina_stringshare_del(), elm_box_pack_end(), elm_menu_item_add(), elm_menu_item_separator_add(), and evas_object_del().