Rand Stats

GUI::Wings

zef:ash

GUI::Wings

Windows with wings: a native GUI framework for Raku. Declarative builders for windows and widgets, every event a Supply, react/whenever as the event loop.

Synopsis

use GUI::Wings;

app 'Counter', {
    my $n = 0;
    window :title('Camelia counts'), :size(480, 220), {
        my $l = label 'clicked 0 times', :font(28);
        my $b = button 'Click me';

        react {
            whenever $b.clicks        { $l.text = "clicked {++$n} times" }
            whenever Supply.interval(1) { window.title = DateTime.now.hh-mm-ss }
            whenever signal(SIGINT)   { done }
        }
    }
}

Status

v0.1.0, a proof of concept.

Three backends:

All three backends are behind a single API.

Supported widgets:

The module splits into a toolkit-free front GUI::Wings and backends behind ten methods: GUI::Wings::Backend::Cocoa, ::Gtk, ::Win32. WINGS_BACKEND picks one of them explicitly.

Examples

examples/counter.raku — a button that counts its clicks

The code shown above in the Synopsis section.

The counter app on macOS

examples/calculator.raku — a four-function desk calculator

Its arithmetic is exact Rats behind a rounded display, so 1 ÷ 3 × 3 is exactly 1, which is more than most desk calculators manage.

One program, three backends, no conditionals in it:

macOS — CocoaUbuntu — GtkWindows 10 — Win32
The calculator on macOSThe calculator on UbuntuThe calculator on Windows 10

Each takes its look from the toolkit it is standing on: rounded keys and a system orange on macOS, GTK's flatter ones on Ubuntu, and on Windows the digits are ordinary push buttons while the tinted keys are painted by the backend, bevel and all, because Win32 has no coloured button to ask for.

Running them

Both examples take the same command; swap in calculator.raku for the other.

macOS, Raku++RAKUPP_MAIN_THREAD=1 rakupp -I lib examples/counter.raku
macOS or Linux, Rakudoraku -I lib examples/counter.raku
Windows, Raku++rakupp -I lib examples\counter.raku

Test options

Requirements

Scope

What v0.1.0 still leaves out: any widget beyond label and button, real layout (children stack top-down and centred unless placed with :at), menus, dialogs, images, and multiple apps per process. The three backends sit behind the same ten methods; a terminal or DOM one would too, and neither exists.

Compatibility

The t/ suite is deliberately headless — the native declarations dlopen on first call, so loading the module opens no window and the tests run on any OS. The GUI itself is tested by the examples, which WINGS_AUTODRIVE drives to a clean exit with no hands on the mouse.

engineversiont/examples
Rakudov2026.08 (MoarVM 2026.08, Raku v6.d)8/8both self-drive to exit 0
Raku++v3.25.0 and newer; Win32 needs v3.26.0-g03454ac (RAKUPP_MAIN_THREAD=1 on macOS)8/8both self-drive to exit 0

Backends, and the platform each is supported on:

backendplatformengine
CocoamacOS 15.7, arm64 and x86-64Raku++ (RAKUPP_MAIN_THREAD=1) and Rakudo
GtkGTK 3.24 — Ubuntu, and macOS against Homebrew GTK (Quartz)Raku++ and Rakudo
Win32Windows 10 x64Raku++ and Rakudo

Tested with Raku++ v3.26.0-g03454ac and Rakudo 2026.07/2026.08.

Author

Andrew Shitov (zef:ash).

Licence

Artistic-2.0.