• Python EFL - 1.25
  • python docs
  • other docs
  • EFL

Navigation

  • index
  • modules |
  • next |
  • previous |
  • Home |
  • What is elementary? »

Logo

Table of Contents

  • Menu
    • Widget description
    • Emitted signals
    • Layout content parts
    • Layout text parts
    • Inheritance diagram

Previous topic

Mapbuf

Next topic

MultiButtonEntry

Quick search

Menu¶

../_images/menu-preview.png

Widget description¶

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.

Emitted signals¶

  • 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)

Layout content parts¶

  • default - A main content of the menu item

Layout text parts¶

  • default - label in the menu item

Inheritance diagram¶

class efl.elementary.Menu(Object parent, *args, **kwargs)¶

Bases: efl.elementary.__init__.Object

Parameters
  • parent (efl.evas.Object) – The parent object

  • **kwargs – All the remaining keyword arguments are interpreted as properties of the instance

callback_clicked_add¶

The user clicked the empty space in the menu to dismiss.

callback_clicked_del¶
callback_dismissed_add¶

the user clicked the empty space in the menu to dismiss

New in version 1.8.

callback_dismissed_del¶
close¶

Close a opened menu

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

first_item¶

The first item in the menu

Type

MenuItem

first_item_get¶
item_add¶

Add an item at the end of the given menu widget

Parameters
  • parent (Object) – The parent menu item (optional)

  • label (string) – The label of the item.

  • icon (string) – An icon display on the item. The icon will be destroyed by the menu.

  • callback (function) – Function called when the user select the item.

Returns

Returns the new item.

Return type

MenuItem

item_separator_add¶

Add a separator item to menu under parent.

This item is a Separator.

Parameters

parent (Object) – The item to add the separator under

Returns

The created item or None on failure

Return type

MenuSeparatorItem

items¶

Returns a list of item’s.

Type

tuple of MenuItem

items_get¶
last_item¶

The last item in the menu

Type

MenuItem

last_item_get¶
move¶

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
  • x (Evas_Coord (int)) – The new position.

  • y (Evas_Coord (int)) – The new position.

open¶

Open a closed menu

Show the menu with no child sub-menus expanded.

New in version 1.20.

parent¶

The parent for the given menu widget.

Type

Object

parent_get¶
selected_item¶

The selected item in the menu

See also

MenuItem.selected

Type

MenuItem

selected_item_get¶
class efl.elementary.MenuItem(MenuItem parent=None, label=None, icon=None, callback=None, cb_data=None, *args, **kargs)¶

Bases: efl.elementary.__init__.ObjectItem

add_to¶
icon_name¶

The standard icon name of a menu item

Once this icon is set, any previously set icon will be deleted.

Type

string

icon_name_get¶
icon_name_set¶
index¶

Get the position of a menu item

This function returns the index position of a menu item in a menu. For a sub-menu, this number is relative to the first item in the sub-menu.

Note

Index values begin with 0

Type

int

index_get¶
is_separator¶

Returns whether the item is a separator.

See also

Menu.item_separator_add()

Type

bool

next¶

Get the next item in the menu.

Type

MenuItem

next_get¶
object¶

Get the Evas_Object of an Elm_Object_Item

Warning

Don’t manipulate this object!

Returns

The edje object containing the swallowed content

object_get¶
prev¶

Get the previous item in the menu.

Type

MenuItem

prev_get¶
selected¶

The selected state of the item.

Type

bool

selected_get¶
selected_set¶
subitems¶

A list of item’s subitems.

Type

tuple of MenuItem

New in version 1.8: Calling del on this property clears the subitems

subitems_clear¶
subitems_get¶

Navigation

  • index
  • modules |
  • next |
  • previous |
  • Home |
  • What is elementary? »
© Copyright 2008-2022, Simon Busch, Gustavo Sverzut Barbieri, Ulisses Furquim, ProFUSION embedded systems, Boris Faure, Fabiano Fidencio, Davide Andreoli, Kai Huuhko.
Created using Sphinx 2.3.1.