Hoversel

../_images/hoversel-preview.png

Widget description

A hoversel is a button that pops up a list of items (automatically choosing the direction to display) that have a label and, optionally, an icon to select from.

It is a convenience widget to avoid the need to do all the piecing together yourself. It is intended for a small number of items in the hoversel menu (no more than 8), though is capable of many more.

Emitted signals

  • clicked - the user clicked the hoversel button and popped up the sel
  • selected - an item in the hoversel list is selected. event_info is the item
  • dismissed - the hover is dismissed
  • expanded - the hover is expanded (since 1.9)
  • item,focused - the hoversel item has received focus. (since 1.10)
  • item,unfocused - the hoversel item has lost focus. (since 1.10)

Layout content parts

  • icon - An icon of the hoversel

Layout text parts

  • default - Label of the hoversel

Inheritance diagram

Inheritance diagram of Hoversel, HoverselItem

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

Bases: efl.elementary.__init__.Button

Parameters:
  • parent (efl.evas.Object) – The parent object
  • **kwargs – All the remaining keyword arguments are interpreted as properties of the instance
auto_update

Automatically change the label and icon of hoversel to that of the selected item.

Type:bool

..versionadded:: 1.16

auto_update_get()
auto_update_set(enable)
callback_clicked_add(func, *args, **kwargs)

The user clicked the hoversel button and popped up the sel.

callback_clicked_del(func)
callback_dismissed_add(func, *args, **kwargs)

The hover is dismissed.

callback_dismissed_del(func)
callback_expanded_add(func, *args, **kwargs)

The hover is expanded.

New in version 1.9.

callback_expanded_del(func)
callback_item_focused_add(func, *args, **kwargs)

When the hoversel item has received focus.

New in version 1.10.

callback_item_focused_del(func)
callback_item_unfocused_add(func, *args, **kwargs)

When the hoversel item has lost focus.

New in version 1.10.

callback_item_unfocused_del(func)
callback_selected_add(func, *args, **kwargs)

An item in the hoversel list is selected. event_info is the item.

callback_selected_del(func)
clear()

This will remove all the children items from the hoversel.

Warning

Should not be called while the hoversel is active; use expanded to check first.

See also

delete()

expanded

Returns whether the hoversel is expanded.

Type:bool
expanded_get()
horizontal

Whether the hoversel is set to expand horizontally.

Note

The initial button will display horizontally regardless of this setting.

Type:bool
horizontal_get()
horizontal_set(horizontal)
hover_begin()

This triggers the hoversel popup from code, the same as if the user had clicked the button.

hover_end()

This dismisses the hoversel popup as if the user had clicked outside the hover.

hover_parent

The Hover parent.

The hover parent object, the area that will be darkened when the hoversel is clicked. Should probably be the window that the hoversel is in. See Hover objects for more information.

Type:Object
hover_parent_get()
hover_parent_set(parent)
item_add(label=None, icon_file=None, icon_type=enums.ELM_ICON_NONE, callback=None, *args, **kwargs)
items

Get the list of items within the given hoversel.

Type:tuple of HoverselItem‘s
items_get()
class efl.elementary.HoverselItem(label=None, icon_file=None, icon_type=enums.ELM_ICON_NONE, callback=None, cb_data=None, *args, **kwargs)

Bases: efl.elementary.__init__.ObjectItem

For more information on what icon_file and icon_type are, see Icon.

Parameters:
  • label (string) – The text label to use for the item (None if not desired)
  • icon_file (string) – An image file path on disk to use for the icon or standard icon name (None if not desired)
  • icon_type (Icon type) – The icon type if relevant
  • callback (function) – Convenience function to call when this item is selected
  • cb_data – User data for the callback function
  • **kwargs – All the remaining keyword arguments are interpreted as properties of the instance
add_to(hoversel)

Add an item to the hoversel button

This adds an item to the hoversel to show when it is clicked.

Note

If you need to use an icon from an edje file then use HoverselItem.icon right after this function.

Returns:The item added.
Return type:HoverselItem
icon

This sets the icon for the given hoversel item.

The icon can be loaded from the standard set, from an image file, or from an edje file.

Type:(string file, string group, Icon type type)
icon_get()
icon_set(icon_file, icon_group, icon_type)