egui icon indicating copy to clipboard operation
egui copied to clipboard

Continue execution after closing native eframe window

Open emilk opened this issue 3 years ago • 0 comments

Closes https://github.com/emilk/egui/issues/1223

This adds NativeOptions::run_and_return with default value true.

If true, execution will continue after the eframe window is closed. This is a new behavior introduced in this PR. If false, the app will close once the eframe window is closed. The is the old behavior.

This is true by default, and the false option is only there so we can revert if we find any bugs.

When true, winit::platform::run_return::EventLoopExtRunReturn::run_return is used. The docs warns users from using it, recommending EventLoop::run, but 🤷 When false, winit::event_loop::EventLoop::run is used.

This is a really useful feature. You can now use eframe to quickly open up a window and show some data or options, and then continue your program after the eframe window is closed

My previous attempt at this caused some problems, but my new attempt seems to be working much better, at least on my Mac.

emilk avatar Aug 03 '22 19:08 emilk