level 1
liyuansi2222
楼主
Gentoo如何运行rust图形界面eguihelloworld
运行截图:

rust图形界面官方helloworld项目,在 https://github. com/emilk/egui.git

先克隆这项目,
gitclonehttps://github.com/emilk/egui.git

cd/home/liyuansi/egui/examples/hello_world/

cargorun

完成。

现在运行我们的简化rust图形界面eguihelloworld
百度,最简单rust图形界面eguihelloworld。
下载百度生成的两个文件Cargo.toml,main.rs
建立新项目
cargonewhelloworld-rust-egui
把百度生成的Cargo.toml放到helloworld-rust-egui目录
把百度生成的main.rs放到helloworld-rust-egui/src/目录
cdhelloworld-rust-egui/
cargorun
结果出来了,新建一个窗口,输出helloworld。

这是main.rs

关键是三行
useeframe::egui;
#Rust中引入eframe框架内置的egui模块
viewport:egui::ViewportBuilder::default().with_inner_size([320.0,240.0]),
#建立一个窗口
ui.heading("HelloWorld!");
#输出helloworld
编译好后,可以直接运行
./target/debug/egui_hello_world

2026年08月05日 05点08分
1
运行截图:

rust图形界面官方helloworld项目,在 https://github. com/emilk/egui.git
先克隆这项目,gitclonehttps://github.com/emilk/egui.git

cd/home/liyuansi/egui/examples/hello_world/
cargorun
完成。
现在运行我们的简化rust图形界面eguihelloworld百度,最简单rust图形界面eguihelloworld。
下载百度生成的两个文件Cargo.toml,main.rs
建立新项目
cargonewhelloworld-rust-egui
把百度生成的Cargo.toml放到helloworld-rust-egui目录
把百度生成的main.rs放到helloworld-rust-egui/src/目录
cdhelloworld-rust-egui/
cargorun
结果出来了,新建一个窗口,输出helloworld。

这是main.rs
关键是三行useeframe::egui;
#Rust中引入eframe框架内置的egui模块
viewport:egui::ViewportBuilder::default().with_inner_size([320.0,240.0]),
#建立一个窗口
ui.heading("HelloWorld!");
#输出helloworld
编译好后,可以直接运行
./target/debug/egui_hello_world
