Dialog.EndModal -- close dialog and end modal loop
moai.DoMethod(id, "EndModal", retval[, nodestroy])
This method will close the specified dialog that has been opened using Dialog.ShowModal and it will break its modal loop. The value you pass in retval will be the return value of the call to this dialog's Dialog.ShowModal method then. This value is often used to indicate success or failure, i.e. you could return True in case the user pressed the "OK" button, and False otherwise.

Additionally, this method will automatically destroy the dialog, i.e. it will implicitly call moai.FreeDialog() on the dialog object. If you don't want this, you have to set the optional argument nodestroy to True. However, it is recommended and it is good programming practice to destroy every dialog as soon as you are finished with it. See Dialog class for details.

id of the dialog object
desired return value for Dialog.ShowModal
optional: True if this method shouldn't automatically destroy the dialog (defaults to False which means destroy the dialog after closing it)

Show TOC