afrish/lib.rs
1//! A Rust binding for the Tk graphics toolkit.
2//!
3//! afrish opens and communicates with Tk's wish program as a separate process.
4//! The library provides:
5//!
6//! * low-level functions to directly communicate with wish, suitable for
7//! writing additional extensions
8//! * high-level API to write GUI applications with minimal knowledge of Tk.
9//!
10//! The top-level functions to start/stop the GUI are contained
11//! in the [wish] module.
12//!
13//! The remaining modules describe a widget or supporting component
14//! (such as a font or image). Each widget has a constructor function,
15//! usually named "make_WIDGET", and this returns a struct of name "TkWIDGET".
16//!
17//! Click on the struct name to get a list of methods supported by the
18//! widget; functionality is divided between various traits, such as
19//! [TkWidget](widget::TkWidget).
20//!
21//! # Example
22//!
23//! A simple hello-world example:
24//!
25//! ```ignore
26//! use afrish::*;
27//!
28//! fn main() {
29//! let root = afrish::start_wish().unwrap();
30//!
31//! let hello = afrish::make_label(&root);
32//! hello.text("Hello from Rust/Tk");
33//!
34//! hello.grid().layout();
35//!
36//! afrish::mainloop();
37//! }
38//! ```
39//!
40//! ## Widget lifetimes
41//!
42//! The Tk process operates independently of your rust program. All references
43//! to widgets in rust are merely string names used to 'lookup' the widget
44//! when calling out to Tk. As such, widgets will remain live and visible even
45//! if a variable referring to them goes out of scope in your rust code.
46//! If you wish to destroy a widget, use the [destroy](widget::TkWidget::destroy)
47//! method available on all widgets.
48//!
49
50pub mod button;
51pub use button::*;
52
53pub mod canvas;
54pub use canvas::*;
55
56pub mod check_button;
57pub use check_button::*;
58
59pub mod combobox;
60pub use combobox::*;
61
62pub mod dialog;
63pub use dialog::*;
64
65pub mod entry;
66pub use entry::*;
67
68pub mod font;
69pub use font::*;
70
71pub mod frame;
72pub use frame::*;
73
74pub mod grid;
75pub use grid::*;
76
77pub mod image;
78pub use image::*;
79
80pub mod label;
81pub use label::*;
82
83pub mod label_frame;
84pub use label_frame::*;
85
86pub mod listbox;
87pub use listbox::*;
88
89pub mod menu;
90pub use menu::*;
91
92pub mod notebook;
93pub use notebook::*;
94
95pub mod pack;
96pub use pack::*;
97
98pub mod paned_window;
99pub use paned_window::*;
100
101pub mod progressbar;
102pub use progressbar::*;
103
104pub mod radio_button;
105pub use radio_button::*;
106
107pub mod scale;
108pub use scale::*;
109
110pub mod scrollbar;
111pub use scrollbar::*;
112
113pub mod separator;
114pub use separator::*;
115
116pub mod spinbox;
117pub use spinbox::*;
118
119pub mod text;
120pub use text::*;
121
122pub mod theme;
123pub use theme::*;
124
125pub mod toplevel;
126pub use toplevel::*;
127
128pub mod treeview;
129pub use treeview::*;
130
131pub mod widget;
132pub use widget::*;
133
134pub mod wish;
135pub use wish::*;