
Gentoo 如何运行rust图形界面 egui helloworld这是运行结果rust图形界面 官方 helloworld 项目在https://github.com/emilk/egui.git先克隆这项目 git clone https://github.com/emilk/egui.gitcd /home/liyuansi/egui/examples/hello_world/cargo run结果出来了。现在运行我们的简化rust图形界面 egui helloworld百度最简单rust图形界面 egui helloworld。下载百度生成的两个文件Cargo.tomlmain.rs建立新项目cargo new helloworld-rust-egui把百度生成的Cargo.toml放到helloworld-rust-egui目录把百度生成的main.rs放到helloworld-rust-egui/src/目录cd helloworld-rust-egui/cargo run结果出来了。新建一个窗口输出 hello world。这是我们的main.rs。关键是三行use eframe::egui;Rust 中引入 eframe 框架内置的 egui 模块viewport: egui::ViewportBuilder::default().with_inner_size([320.0, 240.0]),建立一个窗口ui.heading(“Hello World!”);输出 helloworld编译好后可以直接运行./target/debug/egui_hello_world这项目在https://gitcode.com/liyuansi2222/helloworld-rust-guigit clone https://gitcode.com/liyuansi2222/helloworld-rust-gui.git可以编译运行