slint/api/sixtyfps-rs
Simon Hausmann 87e0cc7d85 Fix resource embedding doing a wasm build of a project using the sixtyfps! macro
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
2020-12-10 15:09:32 +01:00
..
sixtyfps-build Fix resource embedding doing a wasm build of a project using the sixtyfps! macro 2020-12-10 15:09:32 +01:00
sixtyfps-macros Fix resource embedding doing a wasm build of a project using the sixtyfps! macro 2020-12-10 15:09:32 +01:00
build.rs Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
Cargo.toml Bump version numbers 2020-12-07 15:41:29 +01:00
compile_fail_tests.rs Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
docs Remove trailing slash from docs symlink 2020-09-07 11:22:55 +02:00
docs.rs Fix up the docs of the sample component for the new wrapping API 2020-12-03 08:13:40 +01:00
lib.rs Fix Rust docs about generated API 2020-12-09 16:48:02 +01:00
README.md Update the version in the README and doc as we prepare the release 2020-12-09 15:34:41 +01:00
sixtyfps-docs-integration.html Prepare the compiler to be async 2020-10-30 15:00:04 +01:00

SixtyFPS-rs

Crates.io Docs.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