mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-06 03:20:26 +00:00
a880eaf018
- new example poc-menu (WIP). - improve constructors for NcMenu*. - divide NcMenu* methods into submodules. - fix return type for NcPlane constructors. - use NcResult on functions returning references. - fix a couple of Notcurses methods. - add more NcChannelPair methods. - refactor NcInput constructors. - rename error_ptr![] to error_ref_mut![] - new macro cstring_mut![]. - new error_ref![] macro. - update examples & tests. - bump version in readme.
23 lines
480 B
Rust
23 lines
480 B
Rust
//! based on the proof of concept at ../../src/poc/cjkscroll.c
|
|
|
|
use libnotcurses_sys::*;
|
|
|
|
fn main() -> NcResult<()> {
|
|
|
|
let nc = Notcurses::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![nc, 0, 0, 50];
|
|
}
|
|
}
|