I have a question concerning MUIV_Application_ReturnID_Quit in MUI. The autodoc says that "the ideal input loop for an object oriented MUI application" should look like this:
{ ULONG sigs = 0; while (DoMethod(app,MUIM_Application_NewInput,&sigs) !=MUIV_Application_ReturnID_Quit) { if (sigs) { sigs = Wait(sigs | SIGBREAKF_CTRL_C); if (sigs & SIGBREAKF_CTRL_C) break; } } }
The input loop ends when the MUIM_Application_NewInput method says that the program shall terminate (e.g. upon receiving a window close event). Having no previous experience with MUI, I'd like to know how quit confirmation (such as displaying an "Are you sure?" requester) is best handled, after MUIV_Application_ReturnID_Quit breaks the input loop.
This should look familiar to a ReAction coder:
Note: I've written this from memory. I'll look up real existing (and working) MUI code of mine tomorrow.
Thank you Thomas, really appreciated!
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
@Trixie
Not related to what you ask exactly, but still about "ideal mui loop": year ago i ask Thore to implement MUIM_Application_Execute() to make AROS code be more easy portable (that function come from AROS's ZUNE), and so he add it, and in changelog it stated as "* Application.c: added the method MUIM_Application_Execute which implements the ideal main loop for an MUI application". The code of that MUIM_Application_Execute (at least on AROS), are:
And so you can just use now in our mui that MUIM_Application_Execute() directly, something like:
Combining thomas' and kas1e's code you could do: