moai.DoMethod(id, "AddWindow", window)
Detached window objects can be created either by calling the moai.CreateObject() function or by explicitly detaching them from their parent by using the Application.RemoveWindow method.
Please do note that you must not call Application.AddWindow for dialogs created using moai.CreateDialog() since moai.CreateDialog() already calls Application.AddWindow internally.