Diskselector

../_images/diskselector-preview.png

Widget description

A diskselector is a kind of list widget. It scrolls horizontally, and can contain label and icon objects. Three items are displayed with the selected one in the middle.

It can act like a circular list with round mode and labels can be reduced for a defined length for side items.

Emitted signals

  • selected - when item is selected, i.e. scroller stops.

  • clicked - This is called when a user clicks an item

  • scroll,anim,start - scrolling animation has started

  • scroll,anim,stop - scrolling animation has stopped

  • scroll,drag,start - dragging the diskselector has started

  • scroll,drag,stop - dragging the diskselector has stopped

Note

The scroll,anim,* and scroll,drag,* signals are only emitted by user intervention.

Layout content parts

  • icon - An icon in the diskselector item

Layout text parts

  • default - Label of the diskselector item

Scrollable Interface

This widget supports the scrollable interface.

If you wish to control the scrolling behaviour using these functions, inherit both the widget class and the Scrollable class using multiple inheritance, for example:

class ScrollableGenlist(Genlist, Scrollable):
    def __init__(self, canvas, *args, **kwargs):
        Genlist.__init__(self, canvas)

Inheritance diagram

class efl.elementary.Diskselector(Object parent, *args, **kwargs)
Parameters
  • parent (efl.evas.Object) – The parent object

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

class efl.elementary.DiskselectorItem(label=None, Object icon=None, callback=None, cb_data=None, *args, **kargs)

A new item will be created and appended to the diskselector, i.e., will be set as last item. Also, if there is no selected item, it will be selected. This will always happens for the first appended item.

If no icon is set, label will be centered on item position, otherwise the icon will be placed at left of the label, that will be shifted to the right.

Items created with this method can be deleted with delete().

If a function is passed as argument, it will be called every time this item is selected, i.e., the user stops the diskselector with this item on center position.

Simple example (with no function callback or data associated):

disk = Diskselector(win)
ic = Icon(win, file="path/to/image", resizable=(True, True))
disk.item_append("label", ic)

See also

delete() Diskselector.clear() Image

Parameters
  • label (string) – The label of the diskselector item.

  • icon (Object) – The icon object to use at left side of the item. An icon can be any Evas object, but usually it is an Icon.

  • 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