mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-02 16:47:24 +00:00
1.1 KiB
1.1 KiB
Getting Started
We assume that you are a somewhat familiar with Rust, and that you know how to create a Rust application with
cargo new
. The Rust Getting Started Guide can help you get set up.
We recommend using rust-analyzer and our editor integrations for .slint
files for following this tutorial.
First, we create a new cargo project:
cargo new memory
cd memory
Then we edit Cargo.toml
to add the slint dependency:
[package]
#...
edition = "2021"
[dependencies]
slint = "0.3.0"
Finally we copy the hello world program from the Slint documentation into our src/main.rs
:
{{#include main_initial.rs:main}}
We run this example with cargo run
and a window will appear with the green "Hello World" greeting.