-
Notifications
You must be signed in to change notification settings - Fork 2k
Support exiting event loop (closing native window) without quitting program #1223
Description
Is your feature request related to a problem? Please describe.
I am using egui in a command line application. The app displays a window for the user to provide some input. After the window is closed egui should exit the event loop and return from eframe::run_native, so that the app can continue running.
However this is currently impossible because the return type of eframe::run_native is ! and std::process::exit is called when the window is closed.
Describe the solution you'd like
Change eframe::run_native to return to the caller once all windows have been closed and the event loop is done.
Optionally provide a way to return a value to the caller via epi::frame::quit. A Box<dyn Any> would suffice.
Describe alternatives you've considered
Since the event loop must be run on the main thread and std::process::exit is called, I see no alternative.