ListViewDelegate

public protocol ListViewDelegate

Undocumented

  • Method invoked to render one item on the ListView.

    This method should take into account both the selected state, which will be true, if this is being called to render a line that currently has the cursor selection, or false if it is just another row.

    In addition, this method needs to probe listView.hasFocus to determine if the listview is focused, if so, it should use the proper color from the ColorScheme to draw attention to the ListView and its selected element.

    Declaration

    Swift

    func render(listView: ListView, painter: Painter, selected: Bool, item: Int, col: Int, line: Int, width: Int)

    Parameters

    listView

    The source list view being drawn

    painter

    painter object that can be used to draw

    selected

    whether the line should be rendered as selected

    item

    the index of the item to render

    col

    The column where the rendering will take place

    line

    The line where the rendering will take place

    width

    The total number of columns to render

  • This method is invoked when the currently selected item has changed

    Declaration

    Swift

    func selectionChanged(listView: ListView)
  • Invoked when the return key has been pressed while on the ListView

    Declaration

    Swift

    func activate(listView: ListView, item: Int) -> Bool

    Parameters

    listView

    the listview that is raising the event

    item

    The item that was postiioned

    Return Value

    should return true if handled, otherwise false