I’m still not sure what’s happening. I don’t believe anything else is becoming modal after the creation of this dialog. What I know is that the currentlyModalFlag is being set in the call to runModalLoop(), but that by the time the OK button in my dialog is clicked, the dialog is no longer considered modal.
I’m going to post the calling code, which I think I stole from a juce example:
I put breakpoints on the Component::enterModalState(), which is the only place I thought the currentlyModalFlag could be set, but it doesn’t get hit by any other component.
Thanks for the posts–they enabled me to quickly solve a similar problem using DialogWindow::showModalDialog. Since this is a static function, the dialog needs to be controlled by the component passed in to the second argument. To exit, call getParentComponent()->exitModalState(result). The documentation for modal loop methods is in the Component class documentation and it’s not completely clear (at least to this non-gui programmer) which component’s methods should be called. I think an added sentence or two to the showModalDialog method documentation would clear it up. For example, in the documentation to contentComponent (the second argument to showModalDialog), you could append the following sentence: “To close the dialog from the content component, call getParentComponent()->exitModalState(result) where result is the value you wish showModalDialog to return.”