Simple egui examples as a learning source

hi!

i'm looking for som simple, self-contained examples of using egui to build a desktop application.

the uber-detailed example on egui.rs is quite complex, and learning from it can take quite a lot of source reading with little possibility of separating-out elements to practice and build upon, especially if you're an egui beginner.

any pointer to a good learning source, or simply very small apps, would be appreciated!

Thanks
Sharon

Did you look at the eframe template?

Get it to run.

Then go get the source of the clock in egui demo app. Edit the clock source into your copy of eframe template.

Get it to run.

Then edit that code to add color or some extra nobs of whatever.

Get your edits to run.

If you get that far, you will start flying.

Of course you will hit some errors or confusion on the way. Come back here with questions when you get stuck.

1 Like

I have downloaded, unpacked and tried to build it:

E:\eframe_template-master>cargo build

info: syncing channel updates for '1.72.0-x86_64-pc-windows-msvc'
info: latest update on 2023-08-24, rust version 1.72.0 (5680fa18f 2023-08-23)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
info: installing component 'rust-std' for 'wasm32-unknown-unknown'
info: installing component 'rust-std'
info: installing component 'rustc'
info: installing component 'rustfmt'
Updating crates.io index
Fetch [=======================> ] 231 complete; 7 pending
^C

E:eframe_template-master>

What is that?! Why?!
It without any warming started to download and to install rust!
I do not want to install multiple rust instances on my pc (win11)!
How to find and uninstall that rust ?

eframe_template is configured to use Rust toolchain version 1.72.0 and target wasm32-unknown-unknown. If those are not installed, they will be downloaded and installed on first build.

You can manage installed toolchains and targets with rustup:

rustup toolchain --help
rustup target --help
3 Likes

Good work. You are on your way.

That part confused me too. The auto-magic parts of rust and cargo can be strange. You can remove the rust-toolchain file if you want. It should still compile. I think emilk likes to keep the eframe-template stable.

1 Like

Just check out the examples and the web demo

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.