mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-10 03:10:41 +00:00
Update lorem example
Load text before initializing ncurses.
This commit is contained in:
parent
222c4465d9
commit
cb03f79e24
@ -7,13 +7,13 @@ use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
||||
fn main() {
|
||||
let mut siv = Cursive::new();
|
||||
|
||||
// Read some long text from a file.
|
||||
let mut file = File::open("assets/lorem.txt").unwrap();
|
||||
let mut content = String::new();
|
||||
file.read_to_string(&mut content).unwrap();
|
||||
|
||||
let mut siv = Cursive::new();
|
||||
|
||||
// We can quit by pressing q
|
||||
siv.add_global_callback('q' as i32, |s| s.quit());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user