Package elementary :: Module c_elementary :: Class Popup
[hide private]
[frames] | no frames]

Class Popup

        object --+        
                 |        
evas.c_evas.Object --+    
                     |    
                Object --+
                         |
                        Popup

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:

Styles available for Popup

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

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

Instance Methods [hide private]
 
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
PopupItem
item_append(label, icon, func, *args, **kwargs)
Add a new item to a Popup object

Inherited from Object: tree_focus_allow_get, tree_focus_allow_set

Inherited from evas.c_evas.Object: __repr__, __str__, bottom_center_get, bottom_center_set, clipees_get, evas_get, left_center_get, left_center_set, map_enabled_get, map_enabled_set, map_get, map_set, name_get, name_set, parent_get, right_center_get, right_center_set, size_hint_align_get, size_hint_align_set, size_hint_aspect_get, size_hint_aspect_set, size_hint_max_get, size_hint_max_set, size_hint_min_get, size_hint_min_set, size_hint_padding_get, size_hint_padding_set, size_hint_request_get, size_hint_request_set, size_hint_weight_get, size_hint_weight_set, static_clip_get, static_clip_set, top_center_get, top_center_set, type_get

Inherited from evas.c_evas.Object (private): _set_common_params, _set_evas

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

    General

Inherited from Object: access_info_set, content_get, content_set, content_unset, domain_translatable_text_part_set, domain_translatable_text_set, elm_event_callback_add, elm_event_callback_del, name_find, part_content_get, part_content_set, part_content_unset, part_text_get, part_text_set, signal_emit, text_get, text_set, translatable_text_get, translatable_text_part_get, translatable_text_set

    Styles

Inherited from Object: disabled_get, disabled_set, style_get, style_set

    Widget Tree Navigation

Inherited from Object: parent_widget_get, top_widget_get, widget_check, widget_type_get

    Cursors

Inherited from Object: cursor_get, cursor_set, cursor_style_get, cursor_style_set, cursor_theme_search_enabled_get, cursor_theme_search_enabled_set, cursor_unset

    Focus

Inherited from Object: focus_allow_get, focus_allow_set, focus_custom_chain_append, focus_custom_chain_get, focus_custom_chain_prepend, focus_custom_chain_set, focus_custom_chain_unset, focus_get, focus_set

    Mirroring

Inherited from Object: mirrored_automatic_get, mirrored_automatic_set, mirrored_get, mirrored_set

    Widget Scaling

Inherited from Object: scale_get, scale_set

    Scrollhints

Inherited from Object: scroll_freeze_pop, scroll_freeze_push, scroll_hold_pop, scroll_hold_push, scroll_lock_x_get, scroll_lock_x_set, scroll_lock_y_get, scroll_lock_y_set

    Tooltips

Inherited from Object: tooltip_content_cb_set, tooltip_domain_translatable_text_set, tooltip_hide, tooltip_show, tooltip_style_get, tooltip_style_set, tooltip_text_set, tooltip_translatable_text_set, tooltip_unset, tooltip_window_mode_get, tooltip_window_mode_set

    Callbacks
 
callback_block_clicked_add(...)
When the user taps on Blocked Event area.
 
callback_block_clicked_del(...)
 
callback_timeout_add(...)
When popup is closed as a result of timeout.
 
callback_timeout_del(...)
    State manipulation

Inherited from evas.c_evas.Object: clip_get, clip_set, clip_unset, color_get, color_set, delete, hide, is_deleted, show, visible_get, visible_set

    Positioning

Inherited from evas.c_evas.Object: bottom_left_get, bottom_left_set, bottom_right_get, bottom_right_set, center_get, center_set, geometry_get, geometry_set, move, move_relative, pos_get, pos_set, resize, size_get, size_set, top_left_get, top_left_set, top_right_get, top_right_set

    Layer & Stack manipulation

Inherited from evas.c_evas.Object: above_get, below_get, bottom_get, layer_get, layer_set, lower, raise_, stack_above, stack_below, top_get

    Event processing control

Inherited from evas.c_evas.Object: pass_events_get, pass_events_set, propagate_events_get, propagate_events_set, repeat_events_get, repeat_events_set

    Event callbacks

Inherited from evas.c_evas.Object: event_callback_add, event_callback_del, on_changed_size_hints_add, on_changed_size_hints_del, on_del_add, on_del_del, on_focus_in_add, on_focus_in_del, on_focus_out_add, on_focus_out_del, on_free_add, on_free_del, on_hide_add, on_hide_del, on_hold_add, on_hold_del, on_key_down_add, on_key_down_del, on_key_up_add, on_key_up_del, on_mouse_down_add, on_mouse_down_del, on_mouse_in_add, on_mouse_in_del, on_mouse_move_add, on_mouse_move_del, on_mouse_out_add, on_mouse_out_del, on_mouse_up_add, on_mouse_up_del, on_mouse_wheel_add, on_mouse_wheel_del, on_move_add, on_move_del, on_resize_add, on_resize_del, on_restack_add, on_restack_del, on_show_add, on_show_del

    Often unused

Inherited from evas.c_evas.Object: anti_alias_get, anti_alias_set, pointer_mode_get, pointer_mode_set, render_op_get, render_op_set

Instance Variables [hide private]

Inherited from evas.c_evas.Object: data, evas

Properties [hide private]
bool allow_events
Whether events should be passed to by a click outside.
Elm_Popup_Orient orient
Sets the orientation of the popup in the parent region
float timeout
A timeout to hide popup automatically

Inherited from Object: content, cursor, mirrored, parent_widget, scale, style, theme, top_widget, tree_focus_allow, widget_type

Inherited from evas.c_evas.Object: bottom_center, clipees, left_center, map, map_enabled, name, parent, rect, right_center, size_hint_align, size_hint_aspect, size_hint_max, size_hint_min, size_hint_padding, size_hint_request, size_hint_weight, static_clip, top_center, type

Inherited from object: __class__

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

Inherited from Object: text, translatable_text

    Styles

Inherited from Object: disabled

    Cursors

Inherited from Object: cursor_style, cursor_theme_search_enabled

    Focus

Inherited from Object: focus_allow, focus_custom_chain

    Mirroring

Inherited from Object: mirrored_automatic

    Scrollhints

Inherited from Object: scroll_lock_x, scroll_lock_y

    Tooltips

Inherited from Object: tooltip_style, tooltip_window_mode

    State manipulation

Inherited from evas.c_evas.Object: clip, color, visible

    Positioning

Inherited from evas.c_evas.Object: bottom_left, bottom_right, center, geometry, pos, size, top_left, top_right

    Layer & Stack manipulation

Inherited from evas.c_evas.Object: above, below, bottom, layer, top

    Event processing control

Inherited from evas.c_evas.Object: focus, pass_events, propagate_events, repeat_events

    Often unused

Inherited from evas.c_evas.Object: anti_alias, pointer_mode, render_op

Method Details [hide private]

__init__(...)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • evas - Evas canvas for this object
Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

item_append(label, icon, func, *args, **kwargs)

 

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: PopupItem
A handle to the item added or None on errors.

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.


Property Details [hide private]

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.

Type:
bool

Note: The default value is False.

orient

Sets the orientation of the popup in the parent region

Sets the position in which popup will appear in its parent

Type:
Elm_Popup_Orient

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.

Type:
float
Notes:
  • Set a value <= 0.0 to disable a running timer.
  • If the value > 0.0 and the popup is previously visible, the timer will be started with this value, canceling any running timer.