Functions
Menu

Functions

EOAPI Elm_Object_Itemelm_obj_menu_selected_item_get (void)
 Get the selected item in the menu. More...
 
EOAPI const Eina_List * elm_obj_menu_items_get (void)
 Returns a list of item's items. More...
 
EOAPI Elm_Object_Itemelm_obj_menu_first_item_get (void)
 Get the first item in the menu. More...
 
EOAPI Elm_Object_Itemelm_obj_menu_last_item_get (void)
 Get the last item in the menu. More...
 
EOAPI void elm_obj_menu_move (Evas_Coord x, Evas_Coord y)
 Move the menu to a new position. More...
 
EOAPI Elm_Object_Itemelm_obj_menu_item_add (Elm_Object_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 (void)
 Close a opened menu. More...
 
EOAPI Elm_Object_Itemelm_obj_menu_item_separator_add (Elm_Object_Item *parent)
 Add a separator item to menu obj under parent. More...
 
Elm_Object_Itemelm_menu_selected_item_get (const Elm_Menu *obj)
 Get the selected item in the menu. More...
 
const Eina_List * elm_menu_items_get (const Elm_Menu *obj)
 Returns a list of item's items. More...
 
Elm_Object_Itemelm_menu_first_item_get (const Elm_Menu *obj)
 Get the first item in the menu. More...
 
Elm_Object_Itemelm_menu_last_item_get (const Elm_Menu *obj)
 Get the last item in the menu. More...
 
void elm_menu_move (Elm_Menu *obj, Evas_Coord x, Evas_Coord y)
 Move the menu to a new position. More...
 
Elm_Object_Itemelm_menu_item_add (Elm_Menu *obj, Elm_Object_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_Object_Itemelm_menu_item_separator_add (Elm_Menu *obj, Elm_Object_Item *parent)
 Add a separator item to menu obj under parent. More...
 
EOAPI void elm_obj_menu_item_icon_name_set (const char *icon)
 Set the icon of a menu item to the standard icon with name icon. More...
 
EOAPI const char * elm_obj_menu_item_icon_name_get (void)
 Get the string representation from the icon of a menu item. More...
 
EOAPI void elm_obj_menu_item_selected_set (Eina_Bool selected)
 Set the selected state of item. More...
 
EOAPI Eina_Bool elm_obj_menu_item_selected_get (void)
 Get the selected state of item. More...
 
EOAPI Elm_Object_Itemelm_obj_menu_item_prev_get (void)
 Get the previous item in the menu.
 
EOAPI Elm_Object_Itemelm_obj_menu_item_next_get (void)
 Get the next item in the menu.
 
EOAPI unsigned int elm_obj_menu_item_index_get (void)
 Get the next item in the menu.
 
EOAPI void elm_obj_menu_item_subitems_clear (void)
 Remove all sub-items (children) of the given item. More...
 
EOAPI const Eina_List * elm_obj_menu_item_subitems_get (void)
 Returns a list of item's subitems. More...
 
EOAPI Eina_Bool elm_obj_menu_item_is_separator (void)
 Returns whether item is a separator. More...
 
EOAPI Evas_Object * elm_obj_menu_item_object_get (void)
 Get the real Evas(Edje) object created to implement the view of a given menu item. More...
 
void elm_menu_item_icon_name_set (Elm_Menu_Item *obj, const char *icon)
 Set the icon of a menu item to the standard icon with name icon. More...
 
const char * elm_menu_item_icon_name_get (const Elm_Menu_Item *obj)
 Get the string representation from the icon of a menu item. More...
 
void elm_menu_item_selected_set (Elm_Menu_Item *obj, Eina_Bool selected)
 Set the selected state of item. More...
 
Eina_Bool elm_menu_item_selected_get (const Elm_Menu_Item *obj)
 Get the selected state of item. More...
 
Elm_Object_Itemelm_menu_item_prev_get (const Elm_Menu_Item *obj)
 Get the previous item in the menu.
 
Elm_Object_Itemelm_menu_item_next_get (const Elm_Menu_Item *obj)
 Get the next item in the menu.
 
unsigned int elm_menu_item_index_get (const Elm_Menu_Item *obj)
 Get the next item in the menu.
 
void elm_menu_item_subitems_clear (Elm_Menu_Item *obj)
 Remove all sub-items (children) of the given item. More...
 
const Eina_List * elm_menu_item_subitems_get (const Elm_Menu_Item *obj)
 Returns a list of item's subitems. More...
 
Eina_Bool elm_menu_item_is_separator (const Elm_Menu_Item *obj)
 Returns whether item is a separator. More...
 
Evas_Object * elm_menu_item_object_get (const Elm_Menu_Item *obj)
 Get the real Evas(Edje) object created to implement the view of a given menu item. More...
 
Evas_Object * elm_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_Object * elm_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
Menu Example

Function Documentation

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.
void elm_menu_close ( Elm_Menu *  obj)

Close a opened menu.

Returns
void

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

References elm_obj_menu_close().

Elm_Object_Item* elm_menu_first_item_get ( const Elm_Menu *  obj)

Get the first item in the menu.

Returns
The first item, or NULL if none

References elm_obj_menu_first_item_get().

Elm_Object_Item* elm_menu_item_add ( Elm_Menu *  obj,
Elm_Object_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.

Returns
Returns the new item.
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.

References elm_obj_menu_item_add().

const char* elm_menu_item_icon_name_get ( const Elm_Menu_Item *  obj)

Get the string representation from the icon of a menu item.

Once this icon is set, any previously set icon will be deleted. To hide icon set it to "".

See also
elm_menu_item_icon_name_set()

References elm_obj_menu_item_icon_name_get().

void elm_menu_item_icon_name_set ( Elm_Menu_Item *  obj,
const char *  icon 
)

Set the icon of a menu item to the standard icon with name icon.

Once this icon is set, any previously set icon will be deleted. To hide icon set it to "".

Parameters
[in]iconThe name of icon object

References elm_obj_menu_item_icon_name_set().

Eina_Bool elm_menu_item_is_separator ( const Elm_Menu_Item *  obj)

Returns whether item is a separator.

See also
elm_menu_item_separator_add()

References elm_obj_menu_item_is_separator().

Evas_Object* elm_menu_item_object_get ( const Elm_Menu_Item *  obj)

Get the real Evas(Edje) object created to implement the view of a given menu item.

Warning
Don't manipulate this object!

References elm_obj_menu_item_object_get().

Eina_Bool elm_menu_item_selected_get ( const Elm_Menu_Item *  obj)

Get the selected state of item.

See also
elm_menu_item_selected_set()

References elm_obj_menu_item_selected_get().

void elm_menu_item_selected_set ( Elm_Menu_Item *  obj,
Eina_Bool  selected 
)

Set the selected state of item.

Parameters
[in]selectedEINA_TRUE if selected EINA_FALSE otherwise

References elm_obj_menu_item_selected_set().

Elm_Object_Item* elm_menu_item_separator_add ( Elm_Menu *  obj,
Elm_Object_Item parent 
)

Add a separator item to menu obj under parent.

Returns
The created item or NULL on failure

This is item is a Separator.

Parameters
[in]parentThe item to add the separator under

References elm_obj_menu_item_separator_add().

void elm_menu_item_subitems_clear ( Elm_Menu_Item *  obj)

Remove all sub-items (children) of the given item.

Since
1.8

This removes all items that are children (and their descendants) of the given item it.

See also
elm_object_item_del()

References elm_obj_menu_item_subitems_clear().

const Eina_List* elm_menu_item_subitems_get ( const Elm_Menu_Item *  obj)

Returns a list of item's subitems.

See also
elm_menu_add()

References elm_obj_menu_item_subitems_get().

const Eina_List* elm_menu_items_get ( const Elm_Menu *  obj)

Returns a list of item's items.

Returns
An list* of item's items

References elm_obj_menu_items_get().

Elm_Object_Item* elm_menu_last_item_get ( const Elm_Menu *  obj)

Get the last item in the menu.

Returns
The last item, or NULL if none

References elm_obj_menu_last_item_get().

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().

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()
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.
Elm_Object_Item* elm_menu_selected_item_get ( const Elm_Menu *  obj)

Get the selected item in the menu.

Returns
The selected item, or NULL if none
See also
elm_menu_item_selected_get()
elm_menu_item_selected_set()

References elm_obj_menu_selected_item_get().

EOAPI void elm_obj_menu_close ( void  )

Close a opened menu.

Returns
void

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

Referenced by elm_menu_close().

EOAPI Elm_Object_Item* elm_obj_menu_first_item_get ( void  )

Get the first item in the menu.

Returns
The first item, or NULL if none

Referenced by elm_menu_first_item_get().

EOAPI Elm_Object_Item* elm_obj_menu_item_add ( Elm_Object_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.

Returns
Returns the new item.
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.

Referenced by elm_menu_item_add().

EOAPI const char* elm_obj_menu_item_icon_name_get ( void  )

Get the string representation from the icon of a menu item.

Once this icon is set, any previously set icon will be deleted. To hide icon set it to "".

See also
elm_menu_item_icon_name_set()

Referenced by elm_menu_item_icon_name_get().

EOAPI void elm_obj_menu_item_icon_name_set ( const char *  icon)

Set the icon of a menu item to the standard icon with name icon.

Once this icon is set, any previously set icon will be deleted. To hide icon set it to "".

Parameters
[in]iconThe name of icon object

Referenced by elm_menu_item_icon_name_set().

EOAPI Eina_Bool elm_obj_menu_item_is_separator ( void  )

Returns whether item is a separator.

See also
elm_menu_item_separator_add()

Referenced by elm_menu_item_is_separator().

EOAPI Evas_Object* elm_obj_menu_item_object_get ( void  )

Get the real Evas(Edje) object created to implement the view of a given menu item.

Warning
Don't manipulate this object!

Referenced by elm_menu_item_object_get().

EOAPI Eina_Bool elm_obj_menu_item_selected_get ( void  )

Get the selected state of item.

See also
elm_menu_item_selected_set()

Referenced by elm_menu_item_selected_get().

EOAPI void elm_obj_menu_item_selected_set ( Eina_Bool  selected)

Set the selected state of item.

Parameters
[in]selectedEINA_TRUE if selected EINA_FALSE otherwise

Referenced by elm_menu_item_selected_set().

EOAPI Elm_Object_Item* elm_obj_menu_item_separator_add ( Elm_Object_Item parent)

Add a separator item to menu obj under parent.

Returns
The created item or NULL on failure

This is item is a Separator.

Parameters
[in]parentThe item to add the separator under

Referenced by elm_menu_item_separator_add().

EOAPI void elm_obj_menu_item_subitems_clear ( void  )

Remove all sub-items (children) of the given item.

Since
1.8

This removes all items that are children (and their descendants) of the given item it.

See also
elm_object_item_del()

Referenced by elm_menu_item_subitems_clear().

EOAPI const Eina_List* elm_obj_menu_item_subitems_get ( void  )

Returns a list of item's subitems.

See also
elm_menu_add()

Referenced by elm_menu_item_subitems_get().

EOAPI const Eina_List* elm_obj_menu_items_get ( void  )

Returns a list of item's items.

Returns
An list* of item's items

Referenced by elm_menu_items_get().

EOAPI Elm_Object_Item* elm_obj_menu_last_item_get ( void  )

Get the last item in the menu.

Returns
The last item, or NULL if none

Referenced by elm_menu_last_item_get().

EOAPI void elm_obj_menu_move ( 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().

EOAPI Elm_Object_Item* elm_obj_menu_selected_item_get ( void  )

Get the selected item in the menu.

Returns
The selected item, or NULL if none
See also
elm_menu_item_selected_get()
elm_menu_item_selected_set()

Referenced by elm_menu_selected_item_get().