1extern crate text_box;
2
3use text_box::TextBox;
4use text_box::utils::{clear_screen, goto};
5
6fn main() {
7 clear_screen();
8
9 let box1 = TextBox::new(
10 30, 10,
11 15, 6,
12 2,
13 "Box 1",
14 "This box have a border type 2. A first level message, must be checked quickly."
15 ).unwrap();
16 let box2 = TextBox::new(
17 10, 10,
18 15, 6,
19 0,
20 "Box 2",
21 "This box have a border type 0. Normal boxed text for alingment."
22 ).unwrap();
23 let box3 = TextBox::new(
24 10, 2,
25 35, 6,
26 1,
27 "Box 3",
28 "This box have a border type 1. A second level message. \n You can create multiple boxes, just be careful with console window size."
29 ).unwrap();
30 let box4 = TextBox::new(
31 47, 2,
32 15, 14,
33 2,
34 "Box 4",
35 "If you want a new line inside a box you need to put it between spaces like \n this: ' \\n '. Formatter identifies this as a new line word, so it can be printed. \n \n Right?"
36 ).unwrap();
37
38 println!("{}{}{}{}", box1, box2, box3, box4);
39
40 goto(1, 40);
41}