This class makes it easy to tell your user that the program is temporarily busy.
Normally the main thread should always return to the main loop to continue dispatching events as quickly as possible, hence this class shouldn't be needed. However if the main thread does need to block, this class provides a simple way to at least show this to the user: just create a wxBusyInfo object on the stack, and within the current scope, a message window will be shown.
It works by creating a window in the constructor, and deleting it in the destructor.
This window is rather plain by default but can be customized by passing wxBusyInfo constructor an object of wxBusyInfoFlags class instead of a simple message. Here is an example from the dialogs sample:
This shows that separate title and text can be set, and that simple markup (wxControl::SetLabelMarkup()) can be used in them, and that it's also possible to add an icon and customize the colours and transparency of the window.
You may also want to call wxTheApp->Yield() to refresh the window periodically (in case it had been obscured by other windows, for example) like this:
|wxBusyInfo (const wxBusyInfoFlags &flags)|
|General constructor. More...|
|wxBusyInfo (const wxString &msg, wxWindow *parent=NULL)|
|Simple constructor specifying only the message and the parent. More...|
|Hides and closes the window containing the information text. More...|
|wxBusyInfo::wxBusyInfo||(||const wxBusyInfoFlags &||flags||)|
This constructor allows to specify all supported attributes by calling the appropriate methods on wxBusyInfoFlags object passed to it as parameter. All of them are optional but usually at least the message should be specified.
Simple constructor specifying only the message and the parent.
This constructs a busy info window as child of parent and displays msg in it. It is exactly equivalent to using
Hides and closes the window containing the information text.