notcurses/rust/examples/poc-cjkscroll.rs
joseLuís 797ef4b0ae rust: more changes and improvements
- raw field of new wrapping structs is now public just to the crate.
- NcNotcurses.stdplane method now doesn't return an NcResult since it can't fail.
- rename NcNotcurses to Notcurses and NcNotcursesOptions to NotcursesOptions.
- rename NcPlane::new_termsize constructor to with_termsize.
- bump MSV to 1.48 for the doc links.
- improve lib documentation.
- minor fixes.
2021-01-03 02:40:41 +01:00

23 lines
494 B
Rust

//! based on the proof of concept at ../../src/poc/cjkscroll.c
use libnotcurses_sys::*;
fn main() -> NcResult<()> {
let mut nc = FullMode::new()?;
let plane = nc.stdplane();
plane.set_scrolling(true);
let mut wc = '\u{4e00}'; // 一
loop {
plane.putchar(wc)?;
wc = core::char::from_u32(wc as u32 + 1).expect("invalid char");
// 龣
if wc == '\u{9fa5}' {
wc = '\u{4e00}';
}
rsleep![&mut nc, 0, 0, 30];
}
}