minicrossterm/examples/Crossterm 0.3.1/bin.rs

37 lines
829 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.
//! - Add this in the Cargo.toml file:
//! ``` [[bin]]
//! name = "example_bin"
//! path = "./examples/bin.rs"
//! ```
//!
//! - Run program with: `cargo run`
extern crate crossterm;
use crossterm::Crossterm;
use crossterm::style::Color;
// mod terminal;
// mod color;
// mod cursor;
// mod crossterm_type;
2018-07-28 02:44:38 +10:00
// mod input;
2018-07-28 02:44:38 +10:00
//use input::keyboard::{async_input, input as stdin};
2018-07-22 22:55:14 +10:00
use std::{thread, time};
2018-07-22 22:55:14 +10:00
fn main() {
let term = Crossterm::new();
let mut cursor = term.cursor();
2018-07-28 18:17:25 +10:00
cursor.goto(10, 10);
cursor.print("test");
term.terminal().set_size(20,20);
let mut color = term.color();
color.set_fg(Color::Red);
2018-07-28 18:09:09 +10:00
}