emilk / eframe_template

The easy way to make a Rust app with a GUI
Apache License 2.0
785 stars 176 forks source link

Empty canvas during local testing #141

Closed RockyXRQ closed 2 months ago

RockyXRQ commented 3 months ago

I'm currently using eframe-template with Rust Rover in win10 x86. At first time I did cargo run and everything seems just fine. But after I changed the code

        egui::TopBottomPanel::top("top_panel").show(ctx, |ui| {
            // The top panel is often a good place for a menu bar:

            egui::menu::bar(ui, |ui| {
                // NOTE: no File->Quit on web pages!
                let is_web = cfg!(target_arch = "wasm32");
                if !is_web {
                    ui.menu_button("File", |ui| {
                        if ui.button("Quit").clicked() {
                            ctx.send_viewport_cmd(egui::ViewportCommand::Close);
                        }
                    });
                    // ui.add_space(40.0); // from 16.0 to 40.0
                }

The canvas didn't show up, so I changed the value back (from 20.0 to 16.0), but seems the canvas still not show up. So I download the eframe-template and trying to run it without any change, I still get a empty canvas, I can't fix it with cargo clean and then rebuild.

image

emilk commented 3 months ago

try RUST_LOG=debug

RockyXRQ commented 3 months ago

I got these

image

emilk commented 3 months ago

You may wanna look into that app.ron and then try deleting it

RockyXRQ commented 3 months ago

OMG I deleted it and seems everything just alright now! Really appreciate! By the way can I know how this happened and what is the file app.ron for? Thanks again!

c-git commented 3 months ago

app.ron stores the state of the application so you can "resume". I haven't checked but based on what I've observed it serialized the state of the "App" Struct.