You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-67Lines changed: 17 additions & 67 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,9 @@ iui: [](h
9
9
ui-sys: [](https://crates.io/crates/ui-sys/)
10
10
[](https://docs.rs/ui)
11
11
12
-
`iui` is a simple, small, easy to distribute GUI library, a Rusty user interface library that binds to platform native APIs.
13
-
These are work-in-progress bindings to the minimalistic native UI library [libui](https://github.com/andlabs/libui) via the `ui-sys` bindings crate.
12
+
`iui` is a **simple** (about 4 kLOC of Rust), **small** (about 800kb, including `libui`), **easy to distribute** (one shared library) GUI library, providing a **Rusty** user interface library that binds to **native APIs** via the [libui](https://github.com/andlabs/libui) and the `ui-sys` bindings crate.
14
13
15
-
`libui` is a wrapper library for native(ish) GUI libraries:
16
-
17
-
* Win32API on Windows
18
-
* Cocoa on Mac OS X
19
-
* GTK+ on Linux and elsewhere
20
-
21
-
This library exposes a Rusty procedural interface to the "Least Common Denominator" of GUI widgets.
14
+
`iui` wraps native retained mode GUI libraries, like Win32API on Windows, Cocoa on Mac OS X, and GTK+ on Linux and elsewhere. Thus all `iui` apps have a native look and feel and start from a highly performant base which is well integegrated with the native ecosystem on each platform. Because it implements only the least common subset of these platform APIs, your apps will work on all platforms and won't have significant behavioral inconsistencies, with no additional effort on your part.
22
15
23
16
## Using
24
17
@@ -28,70 +21,27 @@ Add `iui` to your project with:
28
21
iui = "0.3"
29
22
```
30
23
31
-
We have documentation on [docs.rs](https://docs.rs/iui) for released versions and on [github](https://leotindall.github.io/libui-rs/iui/index.html) for master.
24
+
Then, in your code, all you have to do is:
32
25
26
+
1. create a [`UI`](https://docs.rs/iui/*/iui/struct.UI.html#method.init) handle, initializing the UI library and guarding against memory unsafety
27
+
1. make a [window](https://docs.rs/iui/*/iui/controls/struct.Window.html), or a few, with title and platform-native decorations, into which your app will be drawn
28
+
1. add all your [controls](https://docs.rs/iui/*/iui/controls/index.html), like buttons and text inputs, laid out with both axial and grid layout options
29
+
1. implement some [callbacks](https://docs.rs/iui/*/iui/controls/struct.Button.html#method.on_clicked) for user input, taking full advantage of Rust's concurrency protections
30
+
1. call [`UI::main`](https://docs.rs/iui/*/iui/struct.UI.html#method.main), or take control over the event processing with an [`EventLoop`](https://docs.rs/iui/*/iui/struct.EventLoop.html), and voíla! A GUI!
33
31
32
+
Or, you can track the `master` branch, which may be broken and whose API often changes, with:
We have documentation on [docs.rs](https://docs.rs/iui) for released versions and on [github](https://leotindall.github.io/libui-rs/iui/index.html) for master.
39
+
40
+
## Examples
36
41
37
42

Check out the [`examples/`](https://github.com/LeoTindall/libui-rs/tree/0.3.0/iui/examples) directory from the latest release for these examples and more.
Copy file name to clipboardExpand all lines: iui/src/lib.rs
+8-18Lines changed: 8 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,18 @@
1
-
//! `iui`, the `i`mproved `u`ser `i`nterface crate, provides Rust bindings to `libui`, a wrapper library for native(ish) GUI libraries:
2
-
//!
3
-
//! - Win32API on Windows
4
-
//! - Cocoa on Mac OS X
5
-
//! - GTK+ on Linux and elsewhere
6
-
//!
7
-
//! This library exposes a Rusty procedural interface to the
8
-
//! "Least Common Denominator" of GUI widgets. They are all available on all supported platforms, though some functionality may not
9
-
//! perform precisely the same on all platforms. These inconsistencies are marked.
1
+
//! `iui`, the `i`mproved `u`ser `i`nterface crate, is a **simple** (about 4 kLOC of Rust), **small** (about 800kb, including `libui`), **easy to distribute** (one shared library) GUI library, providing a **Rusty** user interface library that binds to **native APIs** via the [libui](https://github.com/andlabs/libui) and the `ui-sys` bindings crate.
2
+
//! `iui` wraps native retained mode GUI libraries, like Win32API on Windows, Cocoa on Mac OS X, and GTK+ on Linux and elsewhere. Thus all `iui` apps have a native look and feel and start from a highly performant base which is well integegrated with the native ecosystem on each platform. Because it implements only the least common subset of these platform APIs, your apps will work on all platforms and won't have significant behavioral inconsistencies, with no additional effort on your part.
10
3
//!
11
4
//! To use the library, add the following to your `Cargo.toml`:
12
5
//!
13
6
//! ```toml
14
7
//! "iui" = "0.3"
15
8
//! ```
16
9
//!
17
-
//! Most of the functionality of the crate is exposed via the [UI](struct.UI.html) RAII guard, which handles all initialization and cleanup for the
18
-
//! underlying library.
19
-
//!
20
-
//! After initialization, all the functionality used for creating actual UIs is in the [`controls`](controls/index.html) module.
21
-
//!
22
-
//! Fine-grained control of the event loop is avilable via the [`EventLoop`](struct.EventLoop.html) struct.
23
-
//! Be aware the Cocoa (GUI toolkit on Mac OS) requires that the _first thread spawned_ controls
24
-
//! the UI, so do _not_ spin off your UI interactions into an alternative thread. You're likely to
25
-
//! have problems on Mac OS.
10
+
//! To build a GUI app with `iui`, you must:
11
+
//! 1. create a [`UI`](https://docs.rs/iui/*/iui/struct.UI.html#method.init) handle, initializing the UI library and guarding against memory unsafety
12
+
//! 1. make a [window](https://docs.rs/iui/*/iui/controls/struct.Window.html), or a few, with title and platform-native decorations, into which your app will be drawn
13
+
//! 1. add all your [controls](https://docs.rs/iui/*/iui/controls/index.html), like buttons and text inputs, laid out with both axial and grid layout options
14
+
//! 1. implement some [callbacks](https://docs.rs/iui/*/iui/controls/struct.Button.html#method.on_clicked) for user input, taking full advantage of Rust's concurrency protections
15
+
//! 1. call [`UI::main`](https://docs.rs/iui/*/iui/struct.UI.html#method.main), or take control over the event processing with an [`EventLoop`](https://docs.rs/iui/*/iui/struct.EventLoop.html), and voíla! A GUI!
26
16
//!
27
17
//! For code examples, see the [examples](https://github.com/LeoTindall/libui-rs/blob/master/iui/examples/)
0 commit comments