AudioProcessorEditor finished callback?

I want to add a login component (standard component with three children) to the editor and let it take focus in case no login information is stored on the computer, yet.

I create the component and add it to the editor, but when I call “enterModalState”, an assertion is triggered, because the component can’t get the focus, because the editor is not finished, yet.

If I pass as the first parameter “false”, the component shows, but it’s not modal at all. I can clearly click other components (that are not children of my login component) and interact with them.

Is there some kind of callback I can use, that let’s my editor know that everything is finished and the window is now visible etc. so I can enter the modal state from there?

Even with passing “false”, shouldn’t the component still be modal and prevent other components from receiving any mouse-clicks etc.?

Read this three regarding Modal components in a plugin.

Rail

I’m not running it modal, I’m turning it’s “modal” mode on. The call returns immediately. A real modal function (something that returns when the component is dismissed) is a huge no, no.

I guess I make the control as big as the window then to cover the “real” components. Bad work-around…

AFAIK this is the generally accepted way to do a modal dialog in a plugin since there’s not really any other way to block your whole UI from interaction other than tediously disabling every component.

Design-wise, one thing I’ve seen is to cover the entire window with a half-opaque black component (i.e. darken the whole UI) and then put the “modal” dialog on top of it. This serves the double function of visually telling the user the main UI can’t be used until the dialog is dismissed, as well as physically blocking any mouse clicks from reaching the main UI components.

2 Likes

FWIW, I use an AsyncUpdater for receiving a callback when the editor is up and running:

I trigger the async notification in the constructor of the editor. That way, it will stay pending until the constructor completes (and hopefully gets displayed).
At that point, the message manager will get its chance to run again and will serve the async update request which I triggered.
The handleAsyncUpdate() callback will then serve as a callback for all the stuff that must be done when the editor is complete, up and running.

1 Like

Great idea! Thanks. That will work fine with some stuff I had in mind for later in project.