Table Of Contents

Previous topic

image Module

Next topic

innerwindow Module

index Module

../_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.

This widget emits the following signals, besides the ones sent from LayoutClass:

  • "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
  • "language,changed" - the program’s language changed
  • focused - When the index has received focus. (since 1.8)
  • unfocused - When the index has lost focus. (since 1.8)

The "delay,changed" event is so that it’ll wait a small time before actually reporting those events and, moreover, just the last event happening on those time frames will actually be reported.

class efl.elementary.index.Index

Bases: efl.elementary.layout_class.LayoutClass

This is the class that actually implements the widget.

autohide_disabled

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

Type :bool
callback_changed_add()

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

callback_delay_changed_add()

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

callback_focused_add()

When the index has received focus.

New in version 1.8.

callback_language_changed_add()

the program’s language changed

callback_level_down_add()

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

callback_level_up_add()

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

callback_selected_add()

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

callback_unfocused_add()

When the index has lost focus.

New in version 1.8.

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.

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
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
item_append(unicode letter, callback = None, *args, **kargs) → IndexItem

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) → IndexItem

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(IndexItem after, unicode letter, callback = None, *args, **kargs) → IndexItem

A constructor for IndexItem

See :IndexItem.insert_after()
item_insert_before(IndexItem before, unicode letter, callback = None, *args, **kargs) → IndexItem

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_prepend(unicode letter, callback = None, *args, **kargs) → IndexItem

A constructor for IndexItem

See :IndexItem.prepend_to()
level_go(int 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.

selected_item_get(int level) → IndexItem

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
class efl.elementary.index.IndexItem

Bases: efl.elementary.object_item.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 (function) – The function to call when the item is selected.
append_to()

Append this item to the index.

Parameters:index (Index) – The index object to append to.
insert_after()

Insert this item after the item after.

Parameters:after (IndexItem) – The index item to insert after.
insert_before()

Insert this item before the item before.

Parameters:before (IndexItem) – The index item to insert before.
insert_sorted()
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
prepend_to()

Prepend this item to the index.

Parameters:index (Index) – The index object to prepend to.
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