Modal dialog in JuceApplication::initialise() for iPhone


#1

I am having a problem where it seems I cannot display a modal dialog from within the application initialise() method for the iPhone/iPad builds. I have downloaded a snapshot of the latest juce tip and the problem is still there. I modified the hello world app to contain the following code:

[code] helloWorldWindow = new HelloWorldWindow();

	TextButton c("tester"); 
	c.setSize(300, 300); 
	DialogWindow::showModalDialog("nyasha",&c,helloWorldWindow,Colours::grey,true);/code]

All I see is a black screen. However, when I comment out the last line, things work.

Any ideas?


#2

The event loop won’t have fully started at that point - try using an asyncupdater or something to trigger it once the program has finished initialising.


#3

Thanks Jules, an async updater did the job. I wonder why this always works fine on the pc and mac though.