Skip to content

About eframe::App::on_close_event #7529

@ssrlive

Description

@ssrlive

In older versions of eframe, there was a eframe::App::on_close_event method:

impl eframe::App for AppUI {

    fn on_close_event(&mut self) -> bool {
        self.state.on_show_confirm_quit_dialog();
        self.state.is_allowed_to_quit()
    }

    fn on_exit(&mut self, _gl: Option<&eframe::glow::Context>) {
        log::info!("on_exit");
    }
    
    // ...
}

I used it to intercept the user's click on the X button and decide whether to actually exit the app.

However, this method has been removed in newer versions.

Now, how can I achieve my original goal?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions