Ctxpopup

../_images/ctxpopup-preview.png

Widget description

A ctxpopup is a widget that, when shown, pops up a list of items. It automatically chooses an area inside its parent object’s view to optimally fit into it. In the default theme, it will also point an arrow to it’s top left position at the time one shows it. Ctxpopup items have a label and/or an icon. It is intended for a small number of items (hence the use of list, not genlist).

Note

Ctxpopup is a specialization of Hover.

Emitted signals

  • dismissed - This is called when 1. the outside of ctxpopup was clicked or 2. its parent area is changed or 3. the language is changed and also when 4. the parent object is resized due to the window rotation. Then ctxpopup is dismissed.
  • geometry,update - The geometry has changed (since 1.17)

Layout content parts

  • default - A content of the ctxpopup
  • icon - An icon in the title area

Layout text parts

  • default - Title label in the title area

Enumerations

Ctxpopup arrow directions

efl.elementary.ELM_CTXPOPUP_DIRECTION_DOWN

Arrow is pointing down

efl.elementary.ELM_CTXPOPUP_DIRECTION_RIGHT

Arrow is pointing right

efl.elementary.ELM_CTXPOPUP_DIRECTION_LEFT

Arrow is pointing left

efl.elementary.ELM_CTXPOPUP_DIRECTION_UP

Arrow is pointing up

efl.elementary.ELM_CTXPOPUP_DIRECTION_UNKNOWN

Arrow direction is unknown

Inheritance diagram

Inheritance diagram of Ctxpopup, CtxpopupItem

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

Bases: efl.elementary.__init__.LayoutClass

Changed in version 1.8: Inherits from LayoutClass

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

Set ctxpopup auto hide mode triggered by ctxpopup policy.

Use this property when you want ctxpopup not to hide automatically. By default, ctxpopup is dismissed whenever mouse clicked its background area, language is changed, and its parent geometry is updated(changed).

Type:bool

New in version 1.9.

auto_hide_disabled_get()
auto_hide_disabled_set(disabled)
callback_dismissed_add(func, *args, **kwargs)

the ctxpopup was dismissed

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

the ctxpopup geometry has changed

New in version 1.17.

callback_geometry_update_del(func)
clear()

Clear all items in the given ctxpopup object.

direction

Get the current direction of a ctxpopup.

Warning

Only once the ctxpopup is shown can the direction be determined

Type:Ctxpopup arrow directions
direction_get()
direction_priority

The direction priority order of a ctxpopup.

This functions gives a chance to user to set the priority of ctxpopup showing direction. This doesn’t guarantee the ctxpopup will appear in the requested direction.

Type:(first, second, third, fourth) Ctxpopup arrow directions
direction_priority_get()
direction_priority_set(first, second, third, fourth)
dismiss()

Dismiss a ctxpopup object

Use this function to simulate clicking outside the ctxpopup to dismiss it. In this way, the ctxpopup will be hidden and the “dismissed” signal will be emitted.

first_item

The first item of the Ctxpopup.

Type:CtxpopupItem

New in version 1.11.

first_item_get()
horizontal

Ctxpopup objects orientation.

Type:bool
horizontal_get()
horizontal_set(horizontal)
hover_parent

Ctxpopup hover’s parent

Type:Object
hover_parent_get()
hover_parent_set(parent)
item_append(label, icon=None, func=None, *args, **kwargs)

A constructor for a CtxpopupItem.

See:CtxpopupItem.append_to()
item_prepend(label, icon=None, func=None, *args, **kwargs)

A constructor for a CtxpopupItem.

See:CtxpopupItem.prepend_to()

New in version 1.11.

items

Get the list of items in the ctxpopup widget.

This list is not to be modified in any way and is only valid until the object internal items list is changed. It should be fetched again with another call to this function when changes happen.

Type:list of CtxpopupItem

New in version 1.11.

items_get()
last_item

The last item of the Ctxpopup.

Type:CtxpopupItem

New in version 1.11.

last_item_get()
class efl.elementary.CtxpopupItem(label=None, Object icon=None, callback=None, cb_data=None, *args, **kargs)

Bases: efl.elementary.__init__.ObjectItem

Warning

Ctxpopup can’t hold both an item list and a content at the same time. When an item is added, any previous content will be removed.

Parameters:
  • label (string) – The Label of the new item
  • icon (efl.evas.Object) – Icon to be set on new item
  • callback (callable) – Convenience function called when item selected
  • cb_data – User data for the callback function
  • **kwargs – All the remaining keyword arguments are interpreted as properties of the instance
append_to(ctxpopup)

Add a new item to a ctxpopup object.

See also

content

Parameters:ctxpopup (Ctxpopup) – The Ctxpopup widget this item is to be appended on
Returns:The item added or None, on errors
Return type:CtxpopupItem
next

The next item.

Type:CtxpopupItem

New in version 1.11.

prepend_to(ctxpopup)

Prepend a new item to a ctxpopup object.

See also

content

Parameters:ctxpopup (Ctxpopup) – The Ctxpopup widget this item is to be prepended on
Returns:The item added or None, on errors
Return type:CtxpopupItem

New in version 1.11.

prev

The previous item.

Type:CtxpopupItem

New in version 1.11.