Rand Stats

Libui

cpan:GARLANDG

Libui

Perl6 binding to andlabs/libui

andlabs/libui is currently alpha software. This binding works with the current release, 0.4.1. It does not have full functionality, and is subject to change as andlabs/libui changes underneath it. The raw bindings accessible in Libui::Raw should be feature-complete, but only some widgets have an object-oriented implementation.

Cross-platform: Windows, Mac, Linux

This library provides an object-oriented interface to libui. Shared libraries ui.dll, libui.dylib, and libui.so are provided in resources.

Windows Windows requires a 64-bit Visual C++ Redistributable to properly function.

Linux

Linux requires GTK3.

Debian: apt install libgtk-3-0

Basic Use:

use Libui;

Libui::Init;
my Libui::App $app .= new("test");

#This allows the window to be closed
#when the titlebar's close button is clicked
$app.window.closing.tap({$app.exit});

$app.run();

Widgets Provided:

WidgetDescription
ButtonA button with a label
CheckboxA checkbox with a label
ComboboxA simple combobox
ColorButtonA button for selecting a color
EditableComboboxA combobox that can be edited
EntryText input, can be disabled
FontButtonA button for selecting a font (Incomplete: Cannot set programmatically)
FormA container that takes labels for its contents
GridA container that aligns widgets for window design
GroupA container that provides a title for a set of items
LabelDisplays a single line of text
MenuCreates a single column of an application menu
MultilineEntryAn entry that allows multiple lines
Time and Date PickersAllows choosing of a date and/or time
ProgressBarDisplays a progress bar
RadioButtonA set of radio buttons
SeparatorA simple vertical or horizontal separator
SliderA draggable slider for choosing a value in a range
SpinboxA numerical input with a minimum and maximum range
TabA set named tabs for placing items in
WindowContains any other widget, cannot be embedded in a container
VBox, HBoxA vertical or horizontal box for grouping items

Install from CPAN with:

zef install Libui

Documentation

View on the web: https://github.com/Garland-g/perl6-libui/wiki

Use p6doc: e.g. p6doc Libui::Button

Examples:

Controlgallery Tab: Basic Controls

Linux

./examples/controlgallery-linux.png

Windows

./examples/controlgallery-windows.png

Macos

./examples/controlgallery-macos.png

License

Artistic License 2.0

Author

Travis Gibson