How to exit from Alertwindow with ProgressBar


I have a Alertwindow with ProgressBar and no other components.
I invoke this by using “runModalLoop()”.
Alertwindow is displaying properly .But I am not able to exit from the alertwindow.

Are there any API’s like “runModalLoop” which displays the alert window and exits based on some condition.

Manjunath M

At any point you can just call exitModalState() or even just setVisible (false) to stop a component being modal.

Thanks Jules for the reply.

Here is the sample which I am trying.

double m_PercentageValue;
AlertWindow* m_AlertWindow;
ProgressBar* m_ptrPrgBar ;

void StopProgressBar()
delete m_ptrPrgBar;
delete m_AlertWindow;

void StartProgressBar()
m_PercentageValue = 1.0;
m_AlertWindow = new AlertWindow(“Test”,“Progress Bar”,AlertWindow::NoIcon);
m_ptrPrgBar = new ProgressBar(m_PercentageValue);
m_ptrPrgBar->setSize(400, 30);

First I want to invoke the “StartProgressBar()” and after some delay invoke StopProgressBar().

but it is not get exited from the alert window.

Are you getting confused because runModalLoop() won’t return until something cancels the modal loop? If you don’t want it to actually block, then use enterModalState() rather than runModalLoop()

If I use enterModalState() AlertWindows is getting displayed on backto the main window.
I mean I cant see the Alertwindow.

Make it visible?

I used m_AlertWindow->setVisible(true);
even though it is not getting displayed.

What the use of adding progess bar to alert window. U should use thread to increase the progress. When thread finishes its execution u can sat exit moal state