mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Add unsafe block around ncurses::stdscr
One more reason to avoid ncurses
This commit is contained in:
parent
93980a7d0c
commit
a064400b6f
@ -12,19 +12,19 @@ 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(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(ncurses::stdscr,
|
ncurses::wbkgd(unsafe { ncurses::stdscr },
|
||||||
ncurses::COLOR_PAIR(ColorStyle::Background.id()));
|
ncurses::COLOR_PAIR(ColorStyle::Background.id()));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn screen_size() -> (usize, usize) {
|
fn screen_size() -> (usize, usize) {
|
||||||
let mut x: i32 = 0;
|
let mut x: i32 = 0;
|
||||||
let mut y: i32 = 0;
|
let mut y: i32 = 0;
|
||||||
ncurses::getmaxyx(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