More documentation

This commit is contained in:
Alexandre Bury 2015-05-15 12:16:58 -07:00
parent e5c623bb07
commit 6fad4aa36a
5 changed files with 31 additions and 4 deletions

View File

@ -1,3 +1,5 @@
//! User-input events and their effects.
use std::rc::Rc; use std::rc::Rc;
/// Callback is a function that can be triggered by an event. /// Callback is a function that can be triggered by an event.

View File

@ -1,12 +1,31 @@
//! # Cursive
//!
//! Cursive is a TUI library built on top of ncurses-rs.
//! It allows to easily build layouts for text-based applications.
//!
//! ## Example
//! ```
//! extern crate cursive;
//!
//! use cursive::Cursive;
//! use cursive::view::TextView;
//!
//! fn main() {
//! let mut siv = Cursive::new();
//!
//! siv.add_layer(TextView::new("Hello World!\nPress q to quit."));
//!
//! siv.add_global_callback('q' as i32, |s| s.quit());
//!
//! siv.run();
//! }
//! ```
extern crate ncurses; extern crate ncurses;
/// User-input events and their effects.
pub mod event; pub mod event;
/// Defines various views to use when creating the layout.
pub mod view; pub mod view;
/// Makes drawing on ncurses windows easier.
pub mod printer; pub mod printer;
/// 2D points.
pub mod vec2; pub mod vec2;
mod box_view; mod box_view;
mod stack_view; mod stack_view;

View File

@ -1,3 +1,5 @@
//! Makes drawing on ncurses windows easier.
use ncurses; use ncurses;
use vec2::{Vec2,ToVec2}; use vec2::{Vec2,ToVec2};

View File

@ -1,3 +1,5 @@
//! 2D points.
use std::ops::{Add, Sub}; use std::ops::{Add, Sub};
use std::cmp::min; use std::cmp::min;

View File

@ -1,3 +1,5 @@
//! Defines various views to use when creating the layout.
use event::EventResult; use event::EventResult;
pub use box_view::BoxView; pub use box_view::BoxView;