今回からGUIアプリケーションをやっていきます。
Icedというフレームワークを使用していきます。
[package]
name = "ui_demo"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
iced = { version = "0.1.1", feature = ["async-tsd"] }
iced_native = "0.2.2"
iced_futures = "0.1.2"
async-std = { version = "1.6.0", features = ["unstable"] }
use iced::{executor, Application, Command, Element, Text};
struct GUI;
impl Application for GUI {
type Executor = executor::Null;
type Message = ();
type Flags = ();
fn new(_flags: ()) -> (GUI, Command<Self::Message>) {
(GUI, Command::none())
}
fn title(&self) -> String {
String::from("DEMO")
}
fn update(&mut self, _message: Self::Message) -> Command<Self::Message> {
Command::none()
}
fn view(&mut self) -> Element<Self::Message> {
Text::new("Hello, World!").into()
}
}
use iced::Settings;
fn main() {
GUI::run(Settings::default());
}
「RUST勉強中、10/23の積み上げ」への1件のフィードバック