2019-09-06 00:13:23 +10:00
|
|
|
// Remove once the TODO below is fixed
|
|
|
|
#![allow(unused_variables)]
|
|
|
|
|
2018-08-12 22:51:08 +10:00
|
|
|
extern crate crossterm;
|
|
|
|
|
2019-05-04 04:15:07 +10:00
|
|
|
use crossterm::{Color, Crossterm};
|
|
|
|
// use the `Crossterm` to get an instance to the cursor module | demonstration.
|
|
|
|
pub fn main() {
|
|
|
|
// Create the crossterm type to access different modules.
|
|
|
|
let crossterm = Crossterm::new();
|
2018-08-12 22:51:08 +10:00
|
|
|
|
2019-05-04 04:15:07 +10:00
|
|
|
// pass a reference to the current screen.
|
|
|
|
let cursor = crossterm.cursor();
|
|
|
|
let color = crossterm.color();
|
|
|
|
let terminal = crossterm.terminal();
|
|
|
|
let terminal = crossterm.input();
|
|
|
|
let style = crossterm
|
2019-06-22 02:10:46 +10:00
|
|
|
.style("Black text on green background")
|
2019-05-04 04:15:07 +10:00
|
|
|
.with(Color::Black)
|
|
|
|
.on(Color::Green);
|
2018-08-12 22:51:08 +10:00
|
|
|
|
2019-05-04 04:15:07 +10:00
|
|
|
// TODO: perform some actions with the instances above.
|
2018-08-12 22:51:08 +10:00
|
|
|
}
|