slint/api/rs/slint
Olivier Goffart 43c7f57b0f spawn_local: initialize the platform if not initialized before the call
Take the opportunity to refactor a bit the way the global platform or
context is accessed

Fixes: #5871
2024-08-21 13:26:04 +02:00
..
LICENSES Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
tests spawn_local: initialize the platform if not initialized before the call 2024-08-21 13:26:04 +02:00
android.rs Janitor: fix formatting 2024-06-03 16:05:51 +02:00
Cargo.toml Improve documented workaround for Tokio integration (#5736) 2024-08-09 08:28:43 +02:00
compile_fail_tests.rs Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
docs Move api/sixtyfps-rs to api/rs/slint (no crate rename!) 2022-02-02 13:26:34 +01:00
docs.rs Mark SampleComponent in rust docs as !Send and !Sync 2024-08-02 09:31:20 +02:00
lib.rs spawn_local: initialize the platform if not initialized before the call 2024-08-21 13:26:04 +02:00
mcu.md Bump version in docs 2024-07-18 10:45:48 +02:00
private_unstable_api.rs Timer Element 2024-08-16 16:36:38 +02:00
README.md Bump version in docs 2024-07-18 10:45:48 +02:00
type-mappings.md Change foo type from i32 to int for Slint's struct 2024-03-04 08:59:32 +01:00

Slint

Crates.io Docs.rs

A Rust UI toolkit

Slint is a Rust based UI toolkit to build native user interfaces on desktop platforms and for embedded devices. This crate provides the Rust APIs to interact with the user interface implemented in Slint.

The complete Rust documentation for Slint can be viewed online at https://slint.rs/docs/rust/slint/.

Getting Started

The crate documentation shows how to use this crate.

Hello World

The most basic "Hello world" application can be achieved with a few lines of code:

In your Cargo.toml add:

[dependencies]
slint = "1.7.0"

And in your main.rs:

slint::slint!{
    export component HelloWorld {
        Text {
            text: "hello world";
            color: green;
        }
    }
}
fn main() {
    HelloWorld::new().unwrap().run().unwrap();
}

The slint crate documentation contains more advanced examples and alternative ways to use this crate.

To quickly get started, you can use the Template Repository with the code of a minimal application using Slint that can be used as a starting point to your program.

cargo install cargo-generate
cargo generate --git https://github.com/slint-ui/slint-rust-template

More examples

You can quickly try out the examples by cloning this repo and running them with cargo run

# Runs the "printerdemo" example
cargo run --release --bin printerdemo