mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-02 09:40:15 +00:00
b64a257ecf
- add NcCell constructors: new(), new_blank(), with_char() - remove cell initializer macros - update full-basics example - add more doc comments
35 lines
785 B
Rust
35 lines
785 B
Rust
// utility macro: sleep for $ms milliseconds
|
|
macro_rules! sleep {
|
|
($ms:expr) => {
|
|
std::thread::sleep(std::time::Duration::from_millis($ms));
|
|
};
|
|
}
|
|
|
|
// utility macro: convert the String $s to *mut CString
|
|
// macro_rules! cstring {
|
|
// ($s:expr) => {
|
|
// std::ffi::CString::new($s).unwrap().as_ptr();
|
|
// }
|
|
// }
|
|
|
|
use libnotcurses_sys::*;
|
|
|
|
fn main() {
|
|
unsafe {
|
|
let nc = Notcurses::new();
|
|
|
|
// use standard plane
|
|
let stdplane = notcurses_stdplane(nc);
|
|
|
|
for ch in "Initializing cells...".chars() {
|
|
let cell = NcCell::with_char(ch);
|
|
sleep![60];
|
|
ncplane_putc(&mut *stdplane, &cell);
|
|
let _ = notcurses_render(nc);
|
|
}
|
|
sleep![900];
|
|
|
|
notcurses_stop(nc);
|
|
}
|
|
}
|