Function ncursesw::wgetbkgrnd [−][src]
pub fn wgetbkgrnd(handle: WINDOW) -> Result<ComplexChar, NCurseswError>
Expand description
Returns the given window’s current background character/attribute pair.
Example
extern crate ncursesw;
use ncursesw::*;
use ncursesw::extend::*;
start_color()?;
let win_size = Size { lines: 10, columns: 50 };
let win_origin = Origin { y: 5, x: 5 };
let win = newwin(win_size, win_origin)?;
let yellow = Color::Dark(BaseColor::Yellow);
let blue = Color::Dark(BaseColor::Blue);
let color_pair1 = ColorPair::new(1, Colors::new(yellow, blue))?;
let mut attrs = Attributes::default();
attrs.set_dim(true);
match std::char::from_u32(0x2764) {
Some(c) => {
let background_char = ComplexChar::from_char(c, &attrs, &color_pair1)?;
wbkgrndset(win, background_char);
assert!(wgetbkgrnd(win)? == background_char);
},
None => panic!("unable to convert to character!")
}
delwin(win)?;