Tizen Native API
5.0
|
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:
"clicked"
- the user clicked the empty space in the menu to dismiss."dismissed"
- the user clicked the empty space in the menu to dismiss (since 1.8)"language,changed"
- the program's language changed (since 1.9)
Default content parts of the menu items that you can use for are:
"default"
- A main content of the menu item
Default text parts of the menu items that you can use for are:
"default"
- A label in the menu item
Supported elm_object_item common APIs.
- elm_object_item_del
- elm_object_item_part_text_set
- elm_object_item_part_text_get
- elm_object_item_part_content_set
- elm_object_item_part_content_get
- elm_object_item_disabled_set
- elm_object_item_disabled_get
- elm_object_item_signal_emit (since 1.12)
- See also:
- Menu Example
Functions | |
Elm_Widget_Item * | elm_menu_selected_item_get (const Elm_Menu *obj) |
Get the selected item in the widget. | |
Elm_Widget_Item * | elm_menu_first_item_get (const Elm_Menu *obj) |
Get the first item in the widget. | |
Elm_Widget_Item * | elm_menu_last_item_get (const Elm_Menu *obj) |
Get the last item in the widget. | |
const Eina_List * | elm_menu_items_get (const Elm_Menu *obj) |
Returns a list of the widget item. | |
void | elm_menu_move (Elm_Menu *obj, int x, int y) |
Move the menu to a new position. | |
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. | |
void | elm_menu_open (Elm_Menu *obj) |
Open a closed menu. | |
void | elm_menu_close (Elm_Menu *obj) |
Close a opened menu. | |
Elm_Widget_Item * | elm_menu_item_separator_add (Elm_Menu *obj, Elm_Widget_Item *parent) |
Add a separator item to menu obj under parent . | |
Evas_Object * | elm_menu_add (Evas_Object *parent) |
Add a new menu to the parent. | |
void | elm_menu_parent_set (Evas_Object *obj, Evas_Object *parent) |
Set the parent for the given menu widget. | |
Evas_Object * | elm_menu_parent_get (const Evas_Object *obj) |
Get the parent for the given menu widget. |
Function Documentation
Evas_Object* elm_menu_add | ( | Evas_Object * | parent | ) |
Add a new menu to the parent.
- Parameters:
-
parent The parent object.
- Returns:
- The new object or NULL if it cannot be created.
- Examples:
- menu_example_01.c, and photocam_example_01.c.
void elm_menu_close | ( | Elm_Menu * | obj | ) |
Close a opened menu.
Hides the menu and all it's sub-menus.
- Parameters:
-
[in] obj The object.
Elm_Widget_Item* elm_menu_first_item_get | ( | const Elm_Menu * | obj | ) |
Get the first item in the widget.
- Parameters:
-
[in] obj The object.
- Returns:
- The first item or
null
.
- Examples:
- menu_example_01.c.
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] obj The object. [in] parent The parent menu item (optional). [in] icon An icon display on the item. The icon will be destroyed by the menu. [in] label The label of the item. [in] func Function called when the user select the item. [in] data Data sent by the callback.
- Returns:
- The new menu item.
- Examples:
- menu_example_01.c, photocam_example_01.c, and toolbar_example_03.c.
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] obj The object. [in] parent The item to add the separator under.
- Returns:
- The created item or
null
.
- Examples:
- menu_example_01.c.
const Eina_List* elm_menu_items_get | ( | const Elm_Menu * | obj | ) |
Returns a list of the widget item.
- Parameters:
-
[in] obj The object.
- Returns:
- const list to widget items
Elm_Widget_Item* elm_menu_last_item_get | ( | const Elm_Menu * | obj | ) |
Get the last item in the widget.
- Parameters:
-
[in] obj The object.
- Returns:
- The last item or
null
.
void elm_menu_move | ( | Elm_Menu * | obj, |
int | x, | ||
int | y | ||
) |
Move the menu to a new position.
Sets the top-left position of the menu to ($x, y
).
- Note:
x
andy
coordinates are relative to parent.
- Parameters:
-
[in] obj The object. [in] x The new X coordinate [in] y The new Y coordinate
- Examples:
- menu_example_01.c.
void elm_menu_open | ( | Elm_Menu * | obj | ) |
Open a closed menu.
Show the menu with no child sub-menus expanded..
- Parameters:
-
[in] obj The object.
Evas_Object* elm_menu_parent_get | ( | const Evas_Object * | obj | ) |
Get the parent for the given menu widget.
- Parameters:
-
obj The 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:
-
obj The menu object. parent The new parent.
Elm_Widget_Item* elm_menu_selected_item_get | ( | const Elm_Menu * | obj | ) |
Get the selected item in the widget.
- Parameters:
-
[in] obj The object.
- Returns:
- The selected item or
null
.