mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 06:41:14 +00:00
![]() We need to embed resources in wasm builds. Unfortunately we can't detect that we're called by say wasm-pack and "TARGET"/"HOST" only works inside build.rs. So instead, to keep things simple, this change always embeds the image resources when targeting Rust. The `SIXTYFPS_EMBED_RESOURCES` environment variable can be used to override this anywhere for any language. Fixes #130 |
||
---|---|---|
.. | ||
sixtyfps-build | ||
sixtyfps-macros | ||
build.rs | ||
Cargo.toml | ||
compile_fail_tests.rs | ||
docs | ||
docs.rs | ||
lib.rs | ||
README.md | ||
sixtyfps-docs-integration.html |
SixtyFPS-rs
A Rust UI toolkit
SixtyFPS is a UI toolkit that supports different programming languages. SixtyFPS-rs is the Rust API to interact with a SixtyFPS UI design from Rust.
The complete Rust documentation can be viewed online at https://sixtyfps.io/docs/rust/sixtyfps/.
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]
sixtyfps = "0.0.3"
And in your main.rs
:
sixtyfps::sixtyfps!{
HelloWorld := Window {
Text {
text: "hello world";
color: green;
}
}
}
fn main() {
HelloWorld::new().run();
}
The sixtyfps
crate documentation
contains more advanced examples and alternative ways to use this crate.
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