Update for latest ncurses-rs

This commit is contained in:
Alexandre Bury 2016-10-09 17:48:31 -07:00
parent 651c7d619b
commit 9871e12734
2 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ unicode-width = "0.1"
[dependencies.ncurses] [dependencies.ncurses]
features = ["wide"] features = ["wide"]
optional = true optional = true
version = "5.82.0" version = "5.83.0"
[dependencies.termion] [dependencies.termion]
optional = true optional = true

View File

@ -12,12 +12,12 @@ impl backend::Backend for NcursesBackend {
::std::env::set_var("ESCDELAY", "25"); ::std::env::set_var("ESCDELAY", "25");
ncurses::setlocale(ncurses::LcCategory::all, ""); ncurses::setlocale(ncurses::LcCategory::all, "");
ncurses::initscr(); ncurses::initscr();
ncurses::keypad(unsafe { ncurses::stdscr }, true); ncurses::keypad(unsafe { ncurses::stdscr() }, true);
ncurses::noecho(); ncurses::noecho();
ncurses::cbreak(); ncurses::cbreak();
ncurses::start_color(); ncurses::start_color();
ncurses::curs_set(ncurses::CURSOR_VISIBILITY::CURSOR_INVISIBLE); ncurses::curs_set(ncurses::CURSOR_VISIBILITY::CURSOR_INVISIBLE);
ncurses::wbkgd(unsafe { ncurses::stdscr }, ncurses::wbkgd(unsafe { ncurses::stdscr() },
ncurses::COLOR_PAIR(ColorStyle::Background.id())); ncurses::COLOR_PAIR(ColorStyle::Background.id()));
NcursesBackend NcursesBackend
@ -26,7 +26,7 @@ impl backend::Backend for NcursesBackend {
fn screen_size(&self) -> (usize, usize) { fn screen_size(&self) -> (usize, usize) {
let mut x: i32 = 0; let mut x: i32 = 0;
let mut y: i32 = 0; let mut y: i32 = 0;
ncurses::getmaxyx(unsafe { ncurses::stdscr }, &mut y, &mut x); ncurses::getmaxyx(unsafe { ncurses::stdscr() }, &mut y, &mut x);
(x as usize, y as usize) (x as usize, y as usize)
} }