Skip to main content

Crate wtk

Crate wtk 

Source
Expand description

§Rust Widget Toolkit

Wtk is a simple widget toolkit.

use wtk::prelude::*;
fn main() {
    let mut app = App::<SDLBackend>::new("WTK button example");
    let button = Button::new("clickme", |b| {
        b.set_text("clicked");
    });
    app.add_widget(button.shared());
    app.run();
}

§Embedding

You don’t need to use App, you may embed wtk by directly utilizing a DrawBackend. See the embedded.rs example.

§log crate compatibility

Enable the log feature in wtk to make wtk log using log. You can then display those logs with something like env_logger. See the logger.rs example.

Modules§

app
backends
draw
Home of most drawing functions.
elm
A collection of helper traits and macros for creating an Elm Architecture like app.
event
font
macros
pixels
prelude
rect
theme
widgets

Macros§

elm_cb
A shorthand for creating a closure that sends a message over a reference counted channel.
enclose
A convenience macro for encapsulating cloned references with an expression.