minicrossterm/examples/examples.rs

38 lines
766 B
Rust
Raw Normal View History

//! This bin folder can be used to try the examples out located in the examples directory.
//!
//! All you need to do is:
//!
//! - Download the crossterm source code.
//! - Run program with: `cargo run --example examples`
extern crate crossterm;
// modules that could be test
mod terminal;
mod color;
mod cursor;
mod some_types;
mod input;
2018-08-22 02:05:53 +10:00
use std::io::Write;
2018-08-22 05:17:53 +10:00
use std::{thread,time};
2018-08-22 02:05:53 +10:00
fn main()
{
2018-08-22 05:17:53 +10:00
use crossterm::screen::RawScreen;
use crossterm::Screen;
let mut screen = Screen::new(true);
cursor::goto();
2018-08-22 02:22:22 +10:00
// write!(screen, "text \n\r");
2018-08-22 05:17:53 +10:00
let a = screen.enable_alternate_modes(true).unwrap();
// cursor::goto();
thread::sleep(time::Duration::from_millis(2000));
drop(a);
cursor::goto();
2018-08-22 02:22:22 +10:00
//
// write!(a, "text \n\r");
}