NAME

Rui::View::List - the list view


SYNOPSIS

  $list = $parent->List;                               # default renderer
  $list = $parent->List(renderer => $self);            # call $self->render($item)
  $list = $parent->
     List(renderer => sub { {value => shift->name} }); # callback renderer


SUPERCLASS

the Rui::View::Base manpage


MODEL

the Rui::Model::SelectionInList manpage


DESCRIPTION

A list view work with a selection in list model. It paints any changes from the list and the selection of the model, and changes the selection model when users modify the selection using the mouse or keyboard.

The list uses a renderer to render each item in the list. A renderer is a callback or an object, in which case the method render() will be called.

The renderer recieves one parameter: the item currently to be rendered by the view.

The renderer must return a rendering. A rendering is a hash ref. It will be used to construct a label for the list item. Valid keys are value, and image.

The list view has a default renderer that tries to DWIM.