1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//! too -- a different kind of tui library
//!
//! # Feature flags
//! | Flag | Description | Default |
//! | --- | --- | -- |
//! |`terminal` | enable the terminal backend | `true` |
//! |`sync` | enable `Send`+`Sync` wrappers | `false` |
//! |`profile` | enable [`profiling`](https://docs.rs/profiling/1.0.16/profiling/index.html) support | `false` |
//!
//! # Simple examples
//! ## Centering some text:
//! ```rust,no_run
//! fn main() -> std::io::Result<()> {
//! too::run(|ui| {
//! ui.center(|ui| ui.label("hello world"));
//! })
//! }
//! ```
//! ## A pair of buttons to increment and decrement a counter
//! ```rust,no_run
//! fn main() -> std::io::Result<()> {
//! let mut counter = 0;
//! too::run(|ui| {
//! ui.vertical(|ui|{
//! ui.horizontal(|ui|{
//! if ui.button("add 1").clicked() {
//! counter += 1;
//! }
//! if ui.button("subtract 1").clicked() {
//! counter -= 1;
//! }
//! });
//! ui.label(counter)
//! });
//! })
//! }
//! ```
//! ## Storing state in a struct
//! ```rust,no_run
//! use too::view::Ui;
//!
//! #[derive(Default)]
//! struct App {
//! value: f32
//! }
//!
//! impl App {
//! fn view(&mut self, ui: &Ui) {
//! ui.slider(&mut value);
//! }
//! }
//!
//! fn main() -> std::io::Result<()> {
//! let mut app = App::default()
//! too::run(|ui| app.view(ui))
//! }
//! ```
//! ## Storing state seperately from an application
//! ```rust,no_run
//! use too::view::Ui;
//!
//! #[derive(Default)]
//! struct State {
//! value: f32
//! }
//!
//! struct App ;
//!
//! impl App {
//! fn view(&self, state: &mut State, ui: &Ui) {
//! ui.slider(&mut state.value);
//! }
//! }
//!
//! fn main() -> std::io::Result<()> {
//! let app = App;
//! let mut state = State::default();
//! too::run(|ui| app.view(&mut state, ui))
//! }
//! ```
//!
//! Some pre-made views are provided in: [`too::views`](crate::views)
//!
pub use strStr;
pub use format_compact as __dont_use_this_because_semver;
pub use ;