Add example to the documentation
This commit is contained in:
parent
e9665b08c2
commit
a0955acabd
14
src/lib.rs
14
src/lib.rs
@ -1,3 +1,17 @@
|
||||
//! Rustic bindings to [libnotify](https://developer.gnome.org/libnotify/)
|
||||
//!
|
||||
//! ```rust
|
||||
//! extern crate libnotify;
|
||||
//!
|
||||
//! fn main() {
|
||||
//! let notify = libnotify::Context::new("hello").unwrap();
|
||||
//! let n = notify.new_notification("This is the summary.",
|
||||
//! Some("This is the optional body text."),
|
||||
//! None).unwrap();
|
||||
//! n.show().unwrap();
|
||||
//! }
|
||||
//! ```
|
||||
|
||||
extern crate "libnotify-sys" as sys;
|
||||
extern crate "glib-2_0-sys" as glib;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user