notcurses/rust/examples/poc-cjkscroll.rs
joseLuís bcd09be7d3 [rust] deprecate Notcurses use and rename it to Nc.
In order to be consistent with the rest of the naming scheme, and in order to avoid conflicts with the higher level rust wrappers, which will be using `Notcurses` for the wrapper struct from now on.

- also deprecate `NotcursesOptions` and rename it to `NcOptions`.
- update examples, docs and readme.
2021-06-15 21:00:52 +02:00

26 lines
509 B
Rust

//! based on the proof of concept at ../../src/poc/cjkscroll.c
use libnotcurses_sys::*;
fn main() -> NcResult<()> {
let mut nc = Nc::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];
}
// nc.stop()?;
}