Added rust to practice
This commit is contained in:
29
rust/curses_test/src/main.rs
Normal file
29
rust/curses_test/src/main.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
extern crate pancurses;
|
||||
|
||||
use pancurses::{initscr, endwin, noecho, curs_set};
|
||||
|
||||
fn main() {
|
||||
/*Create the window*/
|
||||
let window = initscr();
|
||||
|
||||
/*Set some ncurses config*/
|
||||
init();
|
||||
window.printw("Hello Rust");
|
||||
|
||||
/*See function for explination */
|
||||
refresh_win(&window);
|
||||
window.getch();
|
||||
endwin();
|
||||
}
|
||||
|
||||
fn init() {
|
||||
noecho();
|
||||
curs_set(0);
|
||||
}
|
||||
|
||||
|
||||
/* This is a test to see how I can find a way to manipulate main()
|
||||
* data in functions */
|
||||
fn refresh_win(window: &pancurses::Window) {
|
||||
window.refresh();
|
||||
}
|
||||
Reference in New Issue
Block a user