mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-12 20:23:35 +00:00
Added doc for event module
This commit is contained in:
parent
2ed8552e4b
commit
1010c825ae
13
src/event.rs
13
src/event.rs
@ -1,4 +1,17 @@
|
||||
//! User-input events and their effects.
|
||||
//!
|
||||
//! * Every user input the application receives is converted to an
|
||||
//! [`Event`](./enum.Event.html).
|
||||
//! * Each event is then given to the root, and descends the view tree down to
|
||||
//! the view currently in focus, through the
|
||||
//! [`on_event`](../view/trait.View.html#method.on_event) method.
|
||||
//! * If the view consumes the event, it may return a callback to be
|
||||
//! executed.
|
||||
//! * Otherwise, it ignores the event, and the view parent can in turn
|
||||
//! choose to consume it or not.
|
||||
//! * If no view consumes the event, the
|
||||
//! [global callback](../struct.Cursive.html#method.add_global_callback)
|
||||
//! table is checked.
|
||||
|
||||
use std::rc::Rc;
|
||||
|
||||
|
18
src/lib.rs
18
src/lib.rs
@ -13,7 +13,23 @@
|
||||
//! * Finally, the event loop is started by calling
|
||||
//! [`Cursive::run(&mut self)`](struct.Cursive.html#method.run).
|
||||
//!
|
||||
//! ## Example
|
||||
//! ## Views
|
||||
//!
|
||||
//! Views are the main components of a cursive interface.
|
||||
//! The [`view`](./view/index.html) module contains many views to use in your
|
||||
//! application; if you don't find what you need, you may also implement the
|
||||
//! [`View`](view/trait.View.html) trait and build your own.
|
||||
//!
|
||||
//! ## Callbacks
|
||||
//!
|
||||
//! Cursive is a *reactive* UI: it *reacts* to events generated by user input.
|
||||
//!
|
||||
//! During the declarative phase, callbacks are set to trigger on specific
|
||||
//! events. These functions usually take a `&mut Cursive` argument, allowing
|
||||
//! them to modify the view tree at will.
|
||||
//!
|
||||
//! ## Examples
|
||||
//!
|
||||
//! ```no_run
|
||||
//! extern crate cursive;
|
||||
//!
|
||||
|
Loading…
Reference in New Issue
Block a user