Table Of Contents

Previous topic

plug Module

Next topic

progressbar Module

popup Module

../_images/popup-preview.png

Widget description

This widget is an enhancement of Notify. In addition to Content area, there are two optional sections namely Title area and Action area.

Popup Widget displays its content with a particular orientation in the parent area. This orientation can be one among top, center, bottom, left, top-left, top-right, bottom-left and bottom-right. Content part of Popup can be an Evas Object set by application or it can be Text set by application or set of items containing an icon and/or text. The content/item-list can be removed using elm_object_content_set with second parameter passed as None.

Following figures shows the textual layouts of popup in which Title Area and Action area area are optional ones. Action area can have up to 3 buttons handled using elm_object common APIs mentioned below. If user wants to have more than 3 buttons then these buttons can be put inside the items of a list as content. User needs to handle the clicked signal of these action buttons if required. No event is processed by the widget automatically when clicked on these action buttons.

Figure:

|---------------------|    |---------------------|    |---------------------|
|     Title Area      |    |     Title Area      |    |     Title Area      |
|Icon|    Text        |    |Icon|    Text        |    |Icon|    Text        |
|---------------------|    |---------------------|    |---------------------|
|       Item 1        |    |                     |    |                     |
|---------------------|    |                     |    |                     |
|       Item 2        |    |                     |    |    Description      |
|---------------------|    |       Content       |    |                     |
|       Item 3        |    |                     |    |                     |
|---------------------|    |                     |    |                     |
|         .           |    |---------------------|    |---------------------|
|         .           |    |     Action Area     |    |     Action Area     |
|         .           |    | Btn1  |Btn2|. |Btn3 |    | Btn1  |Btn2|  |Btn3 |
|---------------------|    |---------------------|    |---------------------|
|       Item N        |     Content Based Layout     Description based Layout
|---------------------|
|     Action Area     |
| Btn1  |Btn2|. |Btn3 |
|---------------------|
   Item Based Layout

Timeout can be set on expiry of which popup instance hides and sends a smart signal “timeout” to the user. The visible region of popup is surrounded by a translucent region called Blocked Event area. By clicking on Blocked Event area, the signal “block,clicked” is sent to the application. This block event area can be avoided by using API elm_popup_allow_events_set. When gets hidden, popup does not get destroyed automatically, application should destroy the popup instance after use. To control the maximum height of the internal scroller for item, we use the height of the action area which is passed by theme based on the number of buttons currently set to popup.

Signals that you can add callbacks for are:

  • timeout - when ever popup is closed as a result of timeout.
  • block,clicked - when ever user taps on Blocked Event area.
  • focused - When the popup has received focus. (since 1.8)
  • unfocused - When the popup has lost focus. (since 1.8)
  • language,changed - the program’s language changed (since 1.8)

Styles available for Popup

  • “default”

Default contents parts of the popup widget that you can use for are:

  • “default” - The content of the popup
  • “title,icon” - Title area’s icon
  • “button1” - 1st button of the action area
  • “button2” - 2nd button of the action area
  • “button3” - 3rd button of the action area

Default text parts of the popup widget that you can use for are:

  • “title,text” - This operates on Title area’s label
  • “default” - content-text set in the content area of the widget

Enumerations

Wrap modes

efl.elementary.popup.ELM_WRAP_NONE

No wrap

efl.elementary.popup.ELM_WRAP_CHAR

Wrap between characters

efl.elementary.popup.ELM_WRAP_WORD

Wrap in allowed wrapping points (as defined in the unicode standard)

efl.elementary.popup.ELM_WRAP_MIXED

Word wrap, and if that fails, char wrap.

class efl.elementary.popup.Popup

Bases: efl.elementary.layout_class.LayoutClass

This is the class that actually implements the widget.

Changed in version 1.8: Inherits from LayoutClass.

allow_events

Whether events should be passed to by a click outside.

Enabling allow event will remove the Blocked event area and events will pass to the lower layer objects otherwise they are blocked.

Note

The default value is False.

Type :bool
callback_block_clicked_add()

When the user taps on Blocked Event area.

callback_focused_add()

When the popup has received focus.

New in version 1.8.

callback_language_changed_add()

the program’s language changed

New in version 1.8.

callback_timeout_add()

When popup is closed as a result of timeout.

callback_unfocused_add()

When the popup has lost focus.

New in version 1.8.

content_text_wrap_type

Sets the wrapping type of content text packed in content area of popup object.

Type :Elm_Wrap_Type
item_append(unicode label, evas.Object icon, func = None, *args, **kwargs) → PopupItem

Add a new item to a Popup object

Both an item list and a content cannot be set at the same time! Once you add an item, the previous content will be removed.

Parameters:
  • label (string) – The Label of the new item
  • icon (Object) – Icon to be set on new item
  • func (function) – Convenience function called when item selected
Returns:

A handle to the item added or None on errors.

Return type:

PopupItem

Warning

When the first item is appended to popup object, any previous content of the content area is deleted. At a time, only one of content, content-text and item(s) can be there in a popup content area.

orient

Sets the orientation of the popup in the parent region

Sets the position in which popup will appear in its parent

Type :Popup orientation types
timeout

A timeout to hide popup automatically

Setting this starts the timer controlling when the popup is hidden. Since calling evas_object_show() on a popup restarts the timer controlling when it is hidden, setting this before the popup is shown will in effect mean starting the timer when the popup is shown. Smart signal “timeout” is called afterwards which can be handled if needed.

Note

Set a value <= 0.0 to disable a running timer.

Note

If the value > 0.0 and the popup is previously visible, the timer will be started with this value, canceling any running timer.

Type :float
class efl.elementary.popup.PopupItem

Bases: efl.elementary.object_item.ObjectItem

An item for Popup.

Default contents parts of the popup items that you can use for are:

  • “default” -Item’s icon

Default text parts of the popup items that you can use for are:

  • “default” - Item’s label