Function ncursesw::bkgrndset[][src]

pub fn bkgrndset(wch: ComplexChar)
Expand description

Manipulate the background on the standard screen.

The window background is a cchar_t consisting of any combination of attributes (i.e., rendition) and a complex character. The attribute part of the background is combined (OR’ed) with all non-blank characters that are written into the window with waddch. Both the character and attribute parts of the background are combined with the blank characters. The background becomes a property of the character and moves with the character through any scrolling and insert/delete line/character operations. To the extent possible on a particular terminal, the attribute part of the background is displayed as the graphic rendition of the character put on the screen.

Example

extern crate ncursesw;

use ncursesw::*;
use ncursesw::extend::*;

start_color()?;

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(0x20) {
    Some(c) => {
        let background_char = ComplexChar::from_char(c, &attrs, &color_pair1)?;
        bkgrndset(background_char);
    },
    None    => panic!("unable to convert to character!")
}