- Notifications
You must be signed in to change notification settings - Fork74
Rust bindings to the minimalist, native, cross-platform UI toolkit `libui`
License
Apache-2.0, MIT licenses found
Licenses found
rust-native-ui/libui-rs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
iui
is asimple (about 4 kLOC of Rust),small (about 800kb, includinglibui
),easy to distribute (one shared library) GUI library, providing aRusty user interface library that binds tonative APIs via thelibui and theui-sys
bindings crate.
iui
wraps native retained mode GUI libraries, like Win32API on Windows, Cocoa on Mac OS X, and GTK+ on Linux and elsewhere. Thus alliui
apps have a native look and feel and start from a highly performant base which is well integrated 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.
Addiui
to your project with:
iui ="0.3"
Then, in your code, all you have to do is:
- create a
UI
handle, initializing the UI library and guarding against memory unsafety - make awindow, or a few, with title and platform-native decorations, into which your app will be drawn
- add all yourcontrols, like buttons and text inputs, laid out with both axial and grid layout options
- implement somecallbacks for user input, taking full advantage of Rust's concurrency protections
- call
UI::main
, or take control over the event processing with anEventLoop
, and voíla! A GUI!
Or, you can track thetrunk
branch, which may be broken and whose API often changes, with:
iui = {git ="https://github.com/rust-native-ui/libui-rs.git"branch="trunk" }
We have documentation ondocs.rs for released versions and ongithub fortrunk
.
Check out theexamples/
directory from the latest release for these examples and more.
This repository contains multiple Rust crates:
iui
is the safe Rust wrapper, to be used by most users.ui-sys
is the raw unsafe bindings to thelibui
C code.libui
is included as a submodule.
Also be sure to look at ourchangelog and learnhow to contribute.
ui-sys
includeslibui
as a sub-module and allows it to be built on-the-fly with thedefault featuresfetch
andbuild
. Withfetch
disabled, it will simply build theexisting sources without updating them, and withbuild
disabled it will build nothing,assuming either a system or local (in./lib/
) version oflibui
is available.
Note thatmost of the time, buildinglibui
on the fly is what you want.
Based on work by@pcwalton.
About
Rust bindings to the minimalist, native, cross-platform UI toolkit `libui`
Resources
License
Apache-2.0, MIT licenses found
Licenses found
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.