A safe wrapper over libui-ng-sys.
Background
libui is a C library that provides a neutral interface to native GUI technologies (e.g., windows, widgets) on major OSes. libui-ng is the "next generation" of libui, developed and maintained separately. libui-ng-sys provides Rust bindings to libui-ng, and boing is a safe yet fairly unopinionated layer on top of libui-ng-sys.
Usage
To get started with boing, see the [Ui] struct.
Examples
# fn main() -> Result<(), boing::Error> {
# use boing::Ui;
#
let ui = Ui::new()?;
// Append a drop-down menu labeled "File" to the menubar of all windows created with
// `has_menubar` set to `true`; see [`Ui::create_window`] for more information.
let file_menu = ui.create_menu("File")?;
// Append a menu item labeled "Quit" (in English) to the previously-created file menu. This
// "Quit" item will exit the application when clicked.
file_menu.push_quit_item()?;
// Create a 200x200 pixel window titled "Hello World!" with a menubar that exits the application
// when closed.
let window = ui.create_window("Hello World!", 200u16, 200u16, true, true)?;
// Create a button labeled "Press Me!" and set it as the main child control of the
// previously-created window.
window.set_child(ui.create_pushbutton("Press Me!")?);
// Present the window to the user. Calling this method is necessary for the window to appear at
// all.
window.show();
// Enter the UI event loop. As [`Ui::run`] borrows immutably, this can be called again.
ui.run();
#
# Ok(())
# }
For more examples, including a control gallery, see the examples subdirectory.