# Class e.p.p.w.l.List(Widget):

Part of elisa.plugins.pigment.widgets.list View In Hierarchy

Known subclasses: elisa.plugins.pigment.widgets.list_carrousel.ListCarrousel, elisa.plugins.pigment.widgets.list_horizontal.ListHorizontal, elisa.plugins.pigment.widgets.list_vertical.ListVertical, elisa.plugins.poblesec.base.coverflow.CoverflowList, elisa.plugins.poblesec.player_slideshow.ListFading

    Abstract list widget. It displays data stored in the L{model} list. Items
    of L{model} are rendered into widgets instances of the widget class passed
    to the constructor using the specified L{renderer} function.

    Usage example for a list of strings rendered in Text drawables:

        l = List(Text)

        def renderer(item, widget):
            widget.label = str(item)
            widget.bg_a = 0

        model = range(100)

        l.set_renderer(renderer)
        l.set_model(model)

    Emit the signals:
      - item-clicked: when an item of the list is clicked
      - selected-item-changed: when the selected item in the list changes

    @ivar selected_item_index:    index of the currently selected item in the
                                  L{model}
    @type selected_item_index:    int
    @ivar visible_range_size:     number of rendered items
    @type visible_range_size:     float
    @ivar model:                  list of data items that is rendered by the
                                  list widget
    @type model:                  list
    @ivar drag_motion_resolution: minimum time between 2 drag events in milliseconds
    @type drag_motion_resolution: int
    @ivar drag_threshold:         amount of movement needed to activate dragging
                                  in canvas coordinates
    @type drag_threshold:         float
    @ivar animated:               True if the list is animated, False otherwise
    @type animated:               bool
    @ivar preloaded:              number of items that are prerendered before
                                  they become visible
    @type preloaded:              int
    @ivar focus_on_click:         whether the button will grab focus when clicked
    @type focus_on_click:         boolean

Line # | Kind | Name | Docs
--- | --- | --- | ---
91 | Method | __init__ |
139 | Method | set_model | Set the list of items that are rendered by the list widget. Further
163 | Method | set_renderer | Function used by the list widget to render an item of the model. It
177 | Method | set_selector | Undocumented
311 | Method | visible_range_start__get | Undocumented
314 | Method | visible_range_start__set | Undocumented
333 | Method | visible_range_size__get | Undocumented
336 | Method | visible_range_size__set | Undocumented
372 | Method | selected_item_index__get | Undocumented
375 | Method | selected_item_index__set | Undocumented
485 | Method | compute_height | Undocumented
488 | Method | compute_width | Undocumented
491 | Method | compute_x | Undocumented
494 | Method | compute_y | Undocumented
497 | Method | compute_z | Undocumented
500 | Method | compute_opacity | Undocumented
536 | Method | visible__set | Undocumented
545 | Method | do_focus | Undocumented
548 | Method | do_released | Undocumented
553 | Method | do_scrolled | Undocumented
562 | Method | do_drag_begin | Undocumented
577 | Method | do_drag_end | Undocumented
588 | Method | do_item_clicked | Undocumented
594 | Method | do_selected_item_changed | Undocumented

Inherited from Widget:

Line # | Kind | Name | Docs
--- | --- | --- | ---
92 | Method | _init_styles | Undocumented
132 | Method | state__get | The present state of the widget
136 | Method | state__set | Set the state of the widget and emit the "state-changed" signal if
152 | Method | do_state_changed | Default 'state-changed' handler
159 | Method | style__get | The present style
163 | Method | style__set | Set the present style, after binding it to the widget and subscribing
179 | Method | _style_property_changed | Undocumented
183 | Method | do_style_set | Default 'style-set' signal handler
188 | Method | _update_style_properties | Update the widget's appearence basing on the properties set.
205 | Method | get_parent | Get the parent, if exists.
213 | Method | get_children | Get the list of direct children.
221 | Method | get_root | Get the root of the widget's tree hierarchy
232 | Method | get_descendants | Get the list of nodes in the subtree
246 | Method | focus__get | Whether the widget has focus
250 | Method | focus__set | Set or unset the focus on the widget and emit the 'focus' signal.
278 | Method | focus_child__get | Get the child with focus
286 | Method | do_key_press_event | Default 'key-press-event' signal handler.
298 | Method | _do_real_key_press_event | Undocumented
302 | Class Method | _demo_create_viewport | Undocumented
309 | Class Method | _on_demo_delete | Undocumented
328 | Class Method | _set_demo_widget_defaults | Undocumented
349 | Class Method | demo | Create a demo widget, put it on a canvas and show it in a viewport.

Inherited from Group (via Widget):

Line # | Kind | Name | Docs
--- | --- | --- | ---
66 | Method | canvas__set | Undocumented
86 | Method | canvas__get | Undocumented
91 | Method | layer__set | Undocumented
104 | Method | layer__get | Undocumented
112 | Method | add | Undocumented
134 | Method | _proxy_child_signal_scrolled | Undocumented
138 | Method | _proxy_child_signal | Undocumented
142 | Method | _proxy_child_signal_with_pressure | Undocumented
146 | Method | remove | Undocumented
160 | Method | empty | Undocumented
170 | Method | __len__ | Undocumented
173 | Method | __iter__ | Undocumented
176 | Method | update_absolute_x | Undocumented
181 | Method | update_absolute_y | Undocumented
186 | Method | update_absolute_z | Undocumented
191 | Method | update_absolute_position | Undocumented
196 | Method | update_absolute_width | Undocumented
203 | Method | update_absolute_height | Undocumented
210 | Method | update_absolute_size | Undocumented
217 | Method | update_absolute_visible | Undocumented
222 | Method | update_absolute_opacity | Undocumented
228 | Method | regenerate | Undocumented
232 | Method | absolute_width__get | Undocumented
235 | Method | absolute_width__set | Undocumented
240 | Method | absolute_height__get | Undocumented
243 | Method | absolute_height__set | Undocumented
248 | Method | absolute_x__get | Undocumented
251 | Method | absolute_x__set | Undocumented
257 | Method | absolute_y__get | Undocumented
260 | Method | absolute_y__set | Undocumented
266 | Method | absolute_z__get | Undocumented
269 | Method | absolute_z__set | Undocumented
275 | Method | clean | Undocumented

Inherited from Node (via Widget, Group):

Line # | Kind | Name | Docs
--- | --- | --- | ---
36 | Method | parent__set | Undocumented
55 | Method | parent__get | Undocumented
60 | Method | x__get | Undocumented
66 | Method | x__set | Undocumented
82 | Method | y__get | Undocumented
88 | Method | y__set | Undocumented
105 | Method | z__get | Undocumented
111 | Method | z__set | Undocumented
128 | Method | position__get | Undocumented
134 | Method | position__set | Undocumented
158 | Method | width__get | Undocumented
164 | Method | width__set | Undocumented
182 | Method | height__get | Undocumented
188 | Method | height__set | Undocumented
208 | Method | size__get | Undocumented
214 | Method | size__set | Undocumented
234 | Method | visible__get | Undocumented
258 | Method | opacity__get | Undocumented
264 | Method | opacity__set | Undocumented

def __init__(self, widget_class, visible_range_size=7):
overrides elisa.plugins.pigment.widgets.widget.Widget.__init__
overridden in elisa.plugins.poblesec.player_slideshow.ListFading, elisa.plugins.poblesec.widgets.search_results.SearchResultsWidget

Parameters | widget_class | widget type used to render the items of the model (type: type inheriting from `elisa.plugins.pigment.widgets.widget.Widget` )
| visible_range_size | DOCME (type: int )

def set_model(self, model):
overridden in elisa.plugins.pigment.widgets.list_carrousel.ListCarrousel
Set the list of items that are rendered by the list widget. Further updates to the model are automatically picked up by the list widget.

Parameters | model | list of items that should be rendered by the list widget (type: list )

def set_renderer(self, renderer):
Function used by the list widget to render an item of the model. It takes an item of the model as the first argument and an instance of the widget class passed to the constructor of the list widget as the second argument.

Parameters | renderer | function called to render an item of the model to the widget used for rendering (type: callable )

def set_selector(self, selector):
Undocumented
def visible_range_start__get(self):
Undocumented
def visible_range_start__set(self, visible_range_start):
overridden in elisa.plugins.pigment.widgets.list_carrousel.ListCarrousel
Undocumented
def visible_range_size__get(self):
Undocumented
def visible_range_size__set(self, visible_range_size):
overridden in elisa.plugins.pigment.widgets.list_carrousel.ListCarrousel, elisa.plugins.pigment.widgets.list_horizontal.ListHorizontal, elisa.plugins.pigment.widgets.list_vertical.ListVertical, elisa.plugins.poblesec.base.coverflow.CoverflowList
Undocumented
def selected_item_index__get(self):
Undocumented
def selected_item_index__set(self, index):
overridden in elisa.plugins.pigment.widgets.list_carrousel.ListCarrousel, elisa.plugins.shelf.shelf_controller.PluginsList
Undocumented
def compute_height(self, index):
Undocumented
def compute_width(self, index):
Undocumented
def compute_x(self, index):
overridden in elisa.plugins.pigment.widgets.list_carrousel.ListCarrousel, elisa.plugins.pigment.widgets.list_horizontal.ListHorizontal, elisa.plugins.poblesec.base.coverflow.CoverflowList
Undocumented
def compute_y(self, index):
overridden in elisa.plugins.pigment.widgets.list_carrousel.ListCarrousel, elisa.plugins.pigment.widgets.list_vertical.ListVertical
Undocumented
def compute_z(self, index):
overridden in elisa.plugins.pigment.widgets.list_carrousel.ListCarrousel, elisa.plugins.poblesec.base.coverflow.CoverflowList, elisa.plugins.shelf.shelf_controller.PluginsList
Undocumented
def compute_opacity(self, index):
overridden in elisa.plugins.pigment.widgets.list_carrousel.ListCarrousel, elisa.plugins.poblesec.base.coverflow.CoverflowList, elisa.plugins.poblesec.player_slideshow.ListFading
Undocumented
def visible__set(self, value):
overrides elisa.plugins.pigment.graph.node.Node.visible__set
Undocumented
def do_focus(self, focus):
overridden in elisa.plugins.poblesec.widgets.search_results.SearchResultsWidget
Undocumented
def do_released(self, x, y, z, button, time):
Undocumented
def do_scrolled(self, x, y, z, direction, time):
overridden in elisa.plugins.pigment.widgets.list_carrousel.ListCarrousel, elisa.plugins.poblesec.base.coverflow.CoverflowList
Undocumented
def do_drag_begin(self, x, y, z, button, time, pressure):
Undocumented
def do_drag_end(self, x, y, z, button, time):
Undocumented
def do_item_clicked(self, item):
overridden in elisa.plugins.poblesec.player_slideshow.ListFading
Undocumented
def do_selected_item_changed(self, item, prev_item):
Undocumented