From 49e69b0c6f767e2e6cfb5c00891a18cdb9362b58 Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Fri, 17 Mar 2023 13:59:57 -0500 Subject: [PATCH] Got addstr to read string variable This did not display anything when I worked on it this morning. Saving to be safe. --- src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index f9ec9f7..227d5e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,8 +24,8 @@ fn main() -> std::io::Result<()> { let mut contents = String::new(); file.read_to_string(&mut contents).expect("unreadable file."); - println!("{}", contents); - screen(); + + screen(&contents); Ok(()) @@ -33,10 +33,10 @@ fn main() -> std::io::Result<()> { //screen init function -fn screen(){ - +fn screen(line: &str){ + ncurses::initscr(); - ncurses::addstr("Hello World!"); + ncurses::addstr(line); ncurses::refresh(); ncurses::getch(); ncurses::endwin();