list/list.rs
1#![feature(type_alias_impl_trait, impl_trait_in_assoc_type)]
2
3use nuit::{Text, List, View, Bind};
4
5#[derive(Bind)]
6struct ListView;
7
8impl View for ListView {
9 type Body = impl View;
10
11 fn body(&self) -> Self::Body {
12 List::new((
13 Text::new("Hello, world!"),
14 Text::new("This is an item."),
15 Text::new("This is another."),
16 Text::new("You get the idea."),
17 ))
18 }
19}
20
21fn main() {
22 nuit::run_app(ListView);
23}