👏

[rust]icedのexampleを試す

2020/11/16に公開

icedについて

rustで書かれたGUIライブラリ。
iced レポジトリ

ライブラリの構成思想としてはelm architechtureを参考にしている。

Inspired by The Elm Architecture, Iced expects you to split user interfaces into four different concepts:

State — the state of your application
Messages — user interactions or meaningful events that you care about
View logic — a way to display your state as widgets that may produce messages on user interaction
Update logic — a way to react to messages and update your state

icedを実行するための環境

OS

  • Ubuntu 20.04.1 LTS

packageのインストール

# driverのインストール
apt install -y software-properties-common
add-apt-repository -y ppa:graphics-drivers/ppa
apt update
export DEBIAN_FRONTEND=noninteractive 
# ドライバは最新を選ぶ
apt install -y  nvidia-driver-455
# icedのコンパイル時にパッケージが足りないとエラーが出る対処
apt install -y build-essential libfontconfig1-dev libfreetype6-dev libexpat1-dev libxcb1-dev libx11-dev libxcursor1 libxrandr2 libxi6 libx11-xcb1
unset DEBIAN_FRONTEND

icedのexampleを実行

# icedのレポジトリをダウンロード
git clone https://github.com/hecrj/iced.git
# icedのexampleを実行
cd iced
cargo run --package stopwatch

Discussion