minicrossterm/examples/examples.rs

34 lines
609 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 02:05:53 +10:00
fn main()
{
use crossterm::screen::RawScreen;
use crossterm::Screen;
2018-08-22 02:05:53 +10:00
let mut screen = Screen::new(true);
2018-08-20 07:13:21 +10:00
2018-08-22 02:05:53 +10:00
write!(screen, "text \n\r");
let a = screen.enable_alternate_modes(true).unwrap();
2018-08-22 02:05:53 +10:00
write!(a, "text \n\r");
2018-08-18 20:54:06 +10:00
}