A list of count rows, each row_h pixels high, with pool row nodes (the rows that show, plus two: height / row_h + 2) and the text of row i from label(i). It takes the room it is given (Length::Fill) until height says otherwise.
Only the rows that show have nodes (pool of them), however long the list is: a million rows cost the same as ten. .selected(..) marks one, .on_pick(f) sends the index of the one pressed.
Signature
pub const fn virtual_list<'a, M, F: Fn(usize) -> &'a str>( count: usize, row_h: u32, pool: usize, label: F, ) -> VirtualList<'a, M, F>Methods
.height(height: Length) -> Self— The list's height, which has to be fixed or filling: a list that grows to its content grows to all of it..selected(index: Option<usize>) -> Self— The row that is chosen (drawn as a chosen row, wherever the list is scrolled to)..on_pick(f: fn(usize) -> M) -> Self— Sends a message made from the index of the row that is chosen.
Example
use fusuma::{Length, virtual_list};
let names = ["Ada", "Grace", "Linus"];
let view = virtual_list(names.len(), 32, 6, |i| names[i]).height(Length::Fixed(96)).on_pick(|i| i);
let built = fusuma::doc::built::<usize, _>(&view);
assert!(built.texts().contains(&"Ada"));