]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/busyinfo.tex
Patches-1851591 ] dataview sample is crashing (under MSW)
[wxWidgets.git] / docs / latex / wx / busyinfo.tex
CommitLineData
704a4b75
VS
1\section{\class{wxBusyInfo}}\label{wxbusyinfo}
2
3This class makes it easy to tell your user that the program is temporarily busy.
4Just create a wxBusyInfo object on the stack, and within the current scope,
5a message window will be shown.
6
7For example:
8
9\begin{verbatim}
21977bac 10 wxBusyInfo wait("Please wait, working...");
704a4b75 11
21977bac
VZ
12 for (int i = 0; i < 100000; i++)
13 {
14 DoACalculation();
15 }
704a4b75
VS
16\end{verbatim}
17
18It works by creating a window in the constructor,
19and deleting it in the destructor.
20
21977bac
VZ
21You may also want to call wxTheApp->Yield() to refresh the window
22periodically (in case it had been obscured by other windows, for
23example) like this:
24
25\begin{verbatim}
26 wxWindowDisabler disableAll;
27
28 wxBusyInfo wait("Please wait, working...");
29
30 for (int i = 0; i < 100000; i++)
31 {
32 DoACalculation();
33
34 if ( !(i % 1000) )
35 wxTheApp->Yield();
36 }
37\end{verbatim}
38
39but take care to not cause undesirable reentrancies when doing it (see
40\helpref{wxApp::Yield()}{wxappyield} for more details). The simplest way to do
41it is to use \helpref{wxWindowDisabler}{wxwindowdisabler} class as illustrated
42in the above example.
43
704a4b75
VS
44\wxheading{Derived from}
45
46None
47
48\wxheading{Include files}
49
50<wx/busyinfo.h>
51
a7af285d
VZ
52\wxheading{Library}
53
54\helpref{wxCore}{librarieslist}
55
704a4b75
VS
56\latexignore{\rtfignore{\wxheading{Members}}}
57
f510b7b2 58\membersection{wxBusyInfo::wxBusyInfo}\label{wxbusyinfoctor}
704a4b75 59
0e10e38d 60\func{}{wxBusyInfo}{\param{const wxString\&}{ msg}, \param{wxWindow* }{parent = NULL}}
21977bac
VZ
61
62Constructs a busy info window as child of {\it parent} and displays {\it msg}
63in it.
64
65{\bf NB:} If {\it parent} is not {\tt NULL} you must ensure that it is not
66closed while the busy info is shown.
67
f510b7b2 68\membersection{wxBusyInfo::\destruct{wxBusyInfo}}\label{wxbusyinfodtor}
21977bac
VZ
69
70\func{}{\destruct{wxBusyInfo}}{\void}
704a4b75 71
21977bac 72Hides and closes the window containing the information text.
704a4b75 73