Index

../_images/index-preview.png

Widget description

An index widget gives you an index for fast access to whichever group of other UI items one might have.

It’s a list of text items (usually letters, for alphabetically ordered access).

Index widgets are by default hidden and just appear when the user clicks over it’s reserved area in the canvas. In its default theme, it’s an area one finger wide on the right side of the index widget’s container.

When items on the index are selected, smart callbacks get called, so that its user can make other container objects to show a given area or child object depending on the index item selected. You’d probably be using an index together with List, Genlist or Gengrid.

Emitted signals

  • changed - When the selected index item changes. event_info is the selected item’s data.

  • delay,changed - When the selected index item changes, but after a small idling period. event_info is the selected item’s data.

  • selected - When the user releases a mouse button and selects an item. event_info is the selected item’s data.

  • level,up - when the user moves a finger from the first level to the second level

  • level,down - when the user moves a finger from the second level to the first level

The delay,changed event has a delay on change before the event is actually reported and moreover just the last event happening on those time frames will actually be reported.

Inheritance diagram

Inheritance diagram of Index, IndexItem
class efl.elementary.Index(Object parent, *args, **kwargs)

Bases: efl.elementary.__init__.LayoutClass

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

autohide_disabled

Enable or disable auto hiding feature for a given index widget.

Type

bool

autohide_disabled_get()
autohide_disabled_set(disabled)
callback_changed_add(func, *args, **kwargs)

When the selected index item changes. event_info is the selected item’s data.

callback_changed_del(func)
callback_delay_changed_add(func, *args, **kwargs)

When the selected index item changes, but after a small idling period. event_info is the selected item’s data.

callback_delay_changed_del(func)
callback_level_down_add(func, *args, **kwargs)

When the user moves a finger from the second level to the first level.

callback_level_down_del(func)
callback_level_up_add(func, *args, **kwargs)

When the user moves a finger from the first level to the second level.

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

When the user releases a mouse button and selects an item. event_info is the selected item’s data .

callback_selected_del(func)
delay_change_time

Delay change time for index object.

Type

double

Note

Delay time is 0.2 sec by default.

New in version 1.8.

delay_change_time_get()
delay_change_time_set(delay_change_time)
horizontal

Enable or disable horizontal mode on the index object

In horizontal mode items are displayed on index from left to right, instead of from top to bottom. Also, the index will scroll horizontally. It’s an area one finger wide on the bottom side of the index widget’s container.

Note

Vertical mode is set by default.

Type

bool

horizontal_get()
horizontal_set(horizontal)
indicator_disabled

Whether the indicator is disabled or not.

In Index widget, Indicator notes popup text, which shows a letter has been selecting.

Type

bool

indicator_disabled_get()
indicator_disabled_set(disabled)
item_append(letter, callback=None, *args, **kargs)

A constructor for IndexItem

See

IndexItem.append_to()

item_clear()

Removes all items from a given index widget.

If deletion callbacks are set, via efl.elementary.object_item.ObjectItem.delete_cb_set(), that callback function will be called for each item.

item_find(data)

Find a given index widget’s item, using item data.

param data

The item data pointed to by the desired index item

return

The index item handle, if found, or None otherwise

rtype

IndexItem

Deprecated since version 1.8: Broken, don’t use.

item_insert_after(after, letter, callback=None, *args, **kargs)

A constructor for IndexItem

See

IndexItem.insert_after()

item_insert_before(before, letter, callback=None, *args, **kargs)

A constructor for IndexItem

See

IndexItem.insert_before()

item_level

The items level for a given index widget.

0 or 1, the currently implemented levels.

Type

int

item_level_get()
item_level_set(level)
item_prepend(letter, callback=None, *args, **kargs)

A constructor for IndexItem

See

IndexItem.prepend_to()

level_go(level)

Go to a given items level on a index widget

Parameters

level (int) – The index level (one of 0 or 1)

omit_enabled

Enable or disable omit feature for a given index widget.

Type

bool

New in version 1.8.

omit_enabled_get()
omit_enabled_set(enabled)
selected_item_get(level)

Returns the last selected item, for a given index widget.

Parameters

level (int) – 0 or 1, the currently implemented levels.

Returns

The last item selected (or None, on errors).

Return type

IndexItem

standard_priority

Control standard_priority group of index.

Priority group will be shown as many items as it can, and other group will be shown one character only.

Type

int

..versionadded:: 1.16

standard_priority_get()
standard_priority_set(value)
class efl.elementary.IndexItem(letter, callback=None, cb_data=None, *args, **kwargs)

Bases: efl.elementary.__init__.ObjectItem

An item on an Index widget.

Despite the most common usage of the letter argument is for single char strings, one could use arbitrary strings as index entries.

item will be the item returned back on "changed", "delay,changed" and "selected" smart events.

Parameters
  • letter (string) – Letter under which the item should be indexed

  • callback (callable) – The function to call when the item is selected.

  • cb_data – User data for the callback function

  • **kwargs – All the remaining keyword arguments are interpreted as properties of the instance

append_to(index)

Append this item to the index.

Parameters

index (Index) – The index object to append to.

insert_after(after)

Insert this item after the item after.

Parameters

after (IndexItem) – The index item to insert after.

insert_before(before)

Insert this item before the item before.

Parameters

before (IndexItem) – The index item to insert before.

insert_sorted(index, compare_func, data_compare_func=None)
Parameters
  • cmp_func (function) – The comparing function to be used to sort index items by index item handles

  • cmp_data_func (function) – A fallback function to be called for the sorting of index items by item data). It will be used when cmp_func returns 0 (equality), which means an index item with provided item data already exists. To decide which data item should be pointed to by the index item in question, cmp_data_func will be used. If cmp_data_func returns a non-negative value, the previous index item data will be replaced by the given item. If the previous data need to be freed, it should be done by the cmp_data_func function, because all references to it will be lost. If this function is not provided (None is given), index items will be duplicated, if cmp_func returns 0.

letter

Get the letter (string) set on a given index widget item.

Type

string

letter_get()
prepend_to(index)

Prepend this item to the index.

Parameters

index (Index) – The index object to prepend to.

priority

The priority of an item.

The priority is -1 by default, which means that the item doesn’t belong to a group. The value of the priority starts from 0. In elm_index_level_go, the items are sorted in ascending order according to priority. Items of the same priority make a group and the primary group is shown by default.

Type

int

..versionadded:: 1.16

priority_set(value)
selected

Set the selected state of an item.

This sets the selected state of the given item. True for selected, False for not selected.

If a new item is selected the previously selected will be unselected. Previously selected item can be get with function Index.selected_item_get().

Selected items will be highlighted.

Type

bool

selected_set(selected)