pthom / hello_imgui

Hello, Dear ImGui: unleash your creativity in app development and prototyping
https://pthom.github.io/hello_imgui
MIT License
678 stars 103 forks source link

Pre-exit behavior #55

Closed Guillaume227 closed 1 year ago

Guillaume227 commented 1 year ago

I am looking a way to have a confirmation dialog appear to ask the user whether they really want to close the app (e.g. because some changes might be lost). The BeforeExit callback is called at a stage when there is no way back, more like a c++ destructor that you can use to clean-up resources but from which you cannot change your mind about leaving a context.

I would like to achieve that while reusing the default 'Quit' menu entry that ships with the App menu.

Is that a case for introducing a new callback? Or is there another way I have overlooked?

Guillaume227 commented 1 year ago

redundant with https://github.com/pthom/imgui_bundle/issues/103