MultiButtonEntry¶
Widget description¶
A Multibuttonentry is a widget to allow a user enter text and manage it as a number of buttons. Each text button is inserted by pressing the “return” key. If there is no space in the current row, a new button is added to the next row. When a text button is pressed, it will become focused. Backspace removes the focus. When the Multibuttonentry loses focus items longer than one line are shrunk to one line.
Typical use case of multibuttonentry is, composing emails/messages to a group of addresses, each of which is an item that can be clicked for further actions.
Emitted signals¶
item,selected
- this is called when an item is selected by api, user interaction, and etc. this is also called when a user press back space while cursor is on the first field of entry. event_info contains the item.item,added
- when a new multi-button entry item is added. event_info contains the item.item,deleted
- when a multi-button entry item is deleted. event_info contains the item.item,clicked
- this is called when an item is clicked by user interaction. Both “item,selected” and “item,clicked” are needed. event_info contains the item.clicked
- when multi-button entry is clicked.expanded
- when multi-button entry is expanded.contracted
- when multi-button entry is contracted.expand,state,changed
- when shrink mode state of multi-button entry is changed.
Layout text parts¶
default
- A label of the multibuttonentrydefault
- A label of the multibuttonentry item
Inheritance diagram¶
- class efl.elementary.MultiButtonEntry(Object parent, *args, **kwargs)¶
Bases:
efl.elementary.__init__.Object
This is the class that actually implements the widget.
- Parameters
parent (
efl.evas.Object
) – The parent object**kwargs – All the remaining keyword arguments are interpreted as properties of the instance
- callback_clicked_add(func, *args, **kwargs)¶
- callback_clicked_del(func)¶
- callback_contracted_add(func, *args, **kwargs)¶
- callback_contracted_del(func)¶
- callback_expand_state_changed_add(func, *args, **kwargs)¶
- callback_expand_state_changed_del(func)¶
- callback_expanded_add(func, *args, **kwargs)¶
- callback_expanded_del(func)¶
- callback_item_added_add(func, *args, **kwargs)¶
- callback_item_added_del(func)¶
- callback_item_clicked_add(func, *args, **kwargs)¶
- callback_item_clicked_del(func)¶
- callback_item_deleted_add(func, *args, **kwargs)¶
- callback_item_deleted_del(func)¶
- callback_item_longpressed_add(func, *args, **kwargs)¶
New in version 1.14.
- callback_item_longpressed_del(func)¶
New in version 1.14.
- callback_item_selected_add(func, *args, **kwargs)¶
- callback_item_selected_del(func)¶
- clear()¶
Remove all items in the multibuttonentry
- editable¶
Whether the multibuttonentry is to be editable or not.
- Type
bool
New in version 1.8.
- editable_get()¶
- editable_set(editable)¶
- entry_get()¶
- expanded¶
Control the multibuttonentry to expanded state.
In expanded state the entry widget expands to accommodate all items. Otherwise a single line of items will be displayed with a counter for items that don’t fit the line.
See also
- Type
bool
- expanded_get()¶
- expanded_set(enabled)¶
- filter_append(func, *args, **kwargs)¶
Append an item filter function for items inserted in the Multibuttonentry
Append the given callback to the list. This function will be called when a new text item is inserted into the Multibuttonentry, with the text to be inserted as a parameter.
If the item is wanted the function should return
True
, else returnFalse
. ReturningFalse
will also prevent any subsequent filters from being called.Callback signature:
func(obj, text, *args, **kwargs) -> bool
- filter_prepend(func, *args, **kwargs)¶
Prepend a filter function for items inserted in the Multibuttonentry
Prepend the given callback to the list. See
filter_append()
for more information
- filter_remove(func, *args, **kwargs)¶
Remove a filter from the list
Removes the given callback from the filter list. See
filter_append()
for more information.New in version 1.17.
- first_item¶
The first item in the multibuttonentry
- Type
- first_item_get()¶
- format_function_set(func, *args, **kwargs)¶
Set a function to format the string for the counter
Sets a function to format the string that will be used to display a counter for items that don’t fit the line when the widget is not in
expanded
state.- Parameters
func (callable) – The actual format function. signature: (int count, args, kwargs)->string
Note
Setting
func
to None will restore the default format.New in version 1.9.
- item_append(label, func=None, *args, **kwargs)¶
Append a new item to the multibuttonentry
- Parameters
label (string) – The label of new item
func – The callback function to be invoked when this item is pressed.
*args – The data to be attached for callback
**kwargs – The data to be attached for callback
- Returns
- item_insert_after(after, label, func=None, *args, **kwargs)¶
Add a new item to the multibuttonentry after the indicated object
- Parameters
before (MultiButtonEntryItem) – The item after which to add it
label (string) – The label of new item
func – The callback function to be invoked when this item is pressed.
*args – The data to be attached for callback
**kwargs – The data to be attached for callback
- Returns
- item_insert_before(before, label, func=None, *args, **kwargs)¶
Add a new item to the multibuttonentry before the indicated object
- Parameters
before (MultiButtonEntryItem) – The item before which to add it
label (string) – The label of new item
func – The callback function to be invoked when this item is pressed.
*args – The data to be attached for callback
**kwargs – The data to be attached for callback
- Returns
- item_prepend(label, func=None, *args, **kwargs)¶
Prepend a new item to the multibuttonentry
- Parameters
label (string) – The label of new item
func – The callback function to be invoked when this item is pressed.
*args – The data to be attached for callback
**kwargs – The data to be attached for callback
- Returns
- items¶
List of items in the multibuttonentry
- Type
list
- items_get()¶
- last_item¶
The last item in the multibuttonentry
- Type
- last_item_get()¶
- selected_item¶
The selected item in the multibuttonentry
- Type
- selected_item_get()¶
- class efl.elementary.MultiButtonEntryItem(label=None, callback=None, cb_data=None, *args, **kargs)¶
Bases:
efl.elementary.__init__.ObjectItem
An item for the MultiButtonEntry widget.
- append_to(mbe)¶
- insert_after(after)¶
- insert_before(before)¶
- next¶
Get the next item in the multibuttonentry
- Type
- next_get()¶
- prepend_to(mbe)¶
- prev¶
Get the previous item in the multibuttonentry
- Type
- prev_get()¶
- selected¶
Control the selected state of an item
- Type
bool
- selected_get()¶
- selected_set(selected)¶