mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Update for latest ncurses-rs
This commit is contained in:
parent
651c7d619b
commit
9871e12734
@ -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
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user