PopupMenu and hidden ModalDialog (iPhone)

Hi guys,

I am working on the iPhone and am pretty new to the whole Juce environment, so please bear with me if my explanation seems a little “off”.

The problem I am having is that when I click on a commandItem on a popupMenu that spawns a dialog window (using DialogWindow::showModalDialog…), before it will actually display I have to click on the main window.

The point that confuses me is that this issue is averted if I put that same command item in a sub menu. I tested this by taking the exact same item and putting it directly in a popup menu and then in a submenu.

This only happens on the iPhone version of the app. On the desktop version all the modal dialogs are properly brought to the front of the application.

Does anyone know how I can fix this so that I don’t need to add submenus? Submenus become pretty pointless if a menu only has one item (e.g. About).

Thanks in advance.

And Juce is pretty new to the iPhone environment, so don’t be too surprised if there are still a few gremlins! (Remember that PopupMenu was written specifically for a large screen and mouse pointer - the fact that it even works on the phone is a miracle!)

But it just sounds like the dialog box you’re creating is appearing behind the other windows, and clicking on the main window will kick it to the front. Have you tried a toFront() on your dialog box once you’ve displayed it?

I thought that showModalDialog automatically brought it to the front. Anyway something I have noticed as well is that the dialog would show for a brief second (only noticable under heavy loads) and then dissapear, most likely behind the main window as you suspect.

I will continue working on it tomorrow and give you some feedback later. I am thinking of just creating a DocumentWindow and playing around with that until I get it working. Hopefully toFront() will then fix the problem.

Thanks for the response.

If that’s the problem I can make sure it comes to the front automatically, I’m really just trying to decipher what you’re describing.

How about using setAlwaysOnTop?