I am learning rust
using the official Rust Programming Language Book.
In chapter 2 it talks about creating a guessing game. It is a terminal game.
I wanted to have a simple ui to the game. So I searched for some and found Slint. The site looked cool ! I got interested.
The syntax looked similar to the react
library that I am somewhat familiar with, so I thought I would give it a try.
Here is the Github Project Guess Me.
Slint
is quite straight forward to use. As this game is really simple in logic and doesn't have a state management requirement, I thought it would be a good fit.
It took some extra work to get things working for the first time.
Such As:
- A build script
build.rs
is needed to make sure the slint files are usable in the rust file. - The intellisense worked after the first build. reminded me of Avalonia UI in dotnet.
- The first build takes quite a while.
- In windows a release build always opens a console window. According to the documentation of slint this is a Windows specific thing.
- Here is the official link about this topic how to resolve the issue. Handle the Console Window
- Issue can be found in the Github repo #3235
The youtube channel of slint is getting more updates recently, which is always amazing.