nim_duilib/ui_components/modal_wnd/async_do_modal.h

21 lines
698 B
C
Raw Normal View History

2019-04-19 17:19:57 +08:00
#ifndef NIM_WIN_GUI_MSG_BOX_ASYNC_DO_MODAL_H_
#define NIM_WIN_GUI_MSG_BOX_ASYNC_DO_MODAL_H_
#include "modal_wnd_base.h"
namespace nim_comp {
2019-04-19 17:19:57 +08:00
// The function will create a helper thread and run a modal dialog on it.
// Once the modal dialog ended, the thread will be destroyed automatically.
// NOTE: Once this function is called, the ownership of |dlg| will be taken.
bool AsyncDoModal(ModalWndBase *dlg);
// This function will send requests to all modal dialogs created by AsyncDoModal
// and wait until all of them ended.
// Typically, the function should be called when the application wants to quit.
void CancelAllAsyncModalDialogs();
}
2019-04-19 17:19:57 +08:00
#endif // NIM_WIN_GUI_MSG_BOX_ASYNC_DO_MODAL_H_