A simple widget toolkit for Rust
Find a file
LevitatingBusinessMan (Rein Fernhout) 0a9214c0d1
All checks were successful
Cargo Build & Test / Rust Build & Test-1 (push) Successful in 1m26s
Cargo Build & Test / Rust Build & Test (push) Successful in 1m29s
0.2.0
2025-10-15 12:05:45 +02:00
.forgejo/workflows make apt a special step in the workflow 2025-09-13 02:10:31 +02:00
.github/workflows make apt a special step in the workflow 2025-09-13 02:10:31 +02:00
examples clean up some warnings 2025-10-15 12:05:31 +02:00
screenshots update screenshot 2025-09-13 01:48:47 +02:00
src clean up some warnings 2025-10-15 12:05:31 +02:00
.gitignore init 2025-09-10 15:45:27 +02:00
Cargo.lock 0.2.0 2025-10-15 12:05:45 +02:00
Cargo.toml 0.2.0 2025-10-15 12:05:45 +02:00
LICENSE add license 2025-09-10 23:13:45 +02:00
README.adoc readme typo 2025-09-14 13:48:04 +02:00
wtk.rb experimental ruby binding 2025-09-11 03:33:17 +02:00
wtktest.c ffi: changed wtk_button_set_text 2025-09-10 23:11:23 +02:00

Wtk is a widget toolkit for rust. The goal is to create a platform agnostic toolkit that can later be used for my own linux userland Azathos. However, currently SDL3 is supported as a backend.

Wtk is developed with three primary goals:

  • Keep the API extremely simple

  • Provide a C interface for use in language bindings (Ruby/Python etc)

  • Be backend agnostic (ready to go baremetal even)

2025 09 13 01 47

Examples

For more examples see the /examples directory.

use wtk;
use wtk::prelude::*;

fn main() {
    let mut app = App::<SDLBackend>::new("WTK button example");
    let button = Button::new("clickme", |b| {
        b.set_text("clicked");
    }).shared();
    app.add_widget(button.clone());
    app.run();
}
#include <libwtk.h>

void on_click(wtk_button_t button) {
    wtk_button_set_text("clicked", button);
}

int main(void) {
    wtk_app_t app = wtk_app_sdl_new("WTK button example");
    wtk_button_t button = wtk_button_new("clickme", on_click);
    wtk_app_sdl_add_widget(app, wtk_button_share(button));
    wtk_app_run(app);
    wtk_app_sdl_destroy(app);
}

Acknowledgements