Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Rust bindings to the minimalist, native, cross-platform UI toolkit `libui`

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

rust-native-ui/libui-rs

Repository files navigation

A cross-platform UI toolkit for Rust based on libui

travis-ci build statuslibui-rs appveyor build status badgeactively developed badge

iui:iui crates.io version badgedocs.rs for iuirustc 1.40ui-sys:ui-sys crates.io version badgedocs.rs for ui-sysrustc 1.40

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.

Using

Addiui to your project with:

iui ="0.3"

Then, in your code, all you have to do is:

  1. create aUI handle, initializing the UI library and guarding against memory unsafety
  2. make awindow, or a few, with title and platform-native decorations, into which your app will be drawn
  3. add all yourcontrols, like buttons and text inputs, laid out with both axial and grid layout options
  4. implement somecallbacks for user input, taking full advantage of Rust's concurrency protections
  5. callUI::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.

Examples

Three example GUI applications running on LinuxThree example GUI applications running on Ubuntu

Check out theexamples/ directory from the latest release for these examples and more.

Organization

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.

Building ui-sys

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.

Acknowledgments

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

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Contributors21

Languages


[8]ページ先頭

©2009-2025 Movatter.jp