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
.
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.
efl.elementary.
Index
(Object parent, *args, **kwargs)¶Bases: efl.elementary.__init__.LayoutClass
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.
bool
autohide_disabled_get
¶autohide_disabled_set
¶callback_changed_add
¶When the selected index item changes. event_info
is the selected
item’s data.
callback_changed_del
¶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_delay_changed_del
¶callback_level_down_add
¶When the user moves a finger from the second level to the first level.
callback_level_down_del
¶callback_level_up_add
¶When the user moves a finger from the first level to the second level.
callback_level_up_del
¶callback_selected_add
¶When the user releases a mouse button and selects an item.
event_info
is the selected item’s data .
callback_selected_del
¶delay_change_time
¶Delay change time for index object.
double
Note
Delay time is 0.2 sec by default.
New in version 1.8.
delay_change_time_get
¶delay_change_time_set
¶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.
bool
horizontal_get
¶horizontal_set
¶indicator_disabled
¶Whether the indicator is disabled or not.
In Index widget, Indicator notes popup text, which shows a letter has been selecting.
bool
indicator_disabled_get
¶indicator_disabled_set
¶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
¶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
Deprecated since version 1.8: Broken, don’t use.
item_level
¶The items level for a given index widget.
0
or 1
, the currently implemented levels.
int
item_level_get
¶item_level_set
¶level_go
¶Go to a given items level on a index widget
level (int) – The index level (one of 0
or 1
)
omit_enabled
¶Enable or disable omit feature for a given index widget.
bool
New in version 1.8.
omit_enabled_get
¶omit_enabled_set
¶selected_item_get
¶Returns the last selected item, for a given index widget.
level (int) – 0
or 1
, the currently implemented levels.
The last item selected (or None
, on errors).
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.
int
..versionadded:: 1.16
standard_priority_get
¶standard_priority_set
¶efl.elementary.
IndexItem
(letter, callback=None, cb_data=None, *args, **kwargs)¶Bases: efl.elementary.__init__.ObjectItem
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.
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
insert_after
¶Insert this item after the item after
.
after (IndexItem
) – The index item to insert after.
insert_before
¶Insert this item before the item before
.
before (IndexItem
) – The index item to insert before.
insert_sorted
¶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.
string
letter_get
¶prepend_to
¶Prepend this item to the index
.
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.
int
..versionadded:: 1.16
priority_set
¶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.
See also
bool
selected_set
¶