This repository provides example for building counter example for ICED GUI framework.
Code is taken from the repo, with minor modifications.
In order to build those steps were needed:
- Generate lock file. Result already in repo, so it is needed only then you will be recreating it in your project.
cargo check
- Generate Cargo.nix. Again result already in repo, so it is needed only then you will be recreating it in your project.
nix run github:cargo2nix/cargo2nix
- nix build
nix build
resulting executable will apprear as ./result-bin/bin/counter
flake.nix provided by this repo will only build for wayland systems. Building for x11 will require extra effort.
The classic counter example explained in the README
.
The main
file contains all the code of the example.
You can run it with cargo run
:
cargo run --package counter
The web version can be run with trunk
:
cd examples/counter
trunk serve