About `eframe::App::on_close_event`
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
In older versions of eframe, there was a `eframe::App::on_close_event` method:
```rust
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?
Contributor guide
Research direction
The issue names no repository files or tests. Start by checking the current eframe::App API and the lifecycle references for on_exit and the removed on_close_event method; done means documenting or demonstrating the current-version way to show a confirmation dialog and allow or prevent application exit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100