Removing Modal Loops in AlertWindow Prompt

I am currently trying to figure out how to remove the modalLoop on this code. I am trying to use AlertWindow::showAsync() function to do this but I am running into the issue of the callback function not having access to the context from which it was called i.e. I can’t access any of the class functions I need access to. Anyone know a way around this?

        
        String name = prompt.getTextEditorContents("name");
        
        if (result == 1)
        {
            prep->setName(name);
            vc->fillSelectCB(Id, Id);
            processor.saveGalleryToHistory("Rename Tuning Preparation");
        }

A bit more code to understand your problem could be helpful.

But I assume you are using a lambda callback? You can make it capture the “this” pointer, which then does give the lambda access to the class.

auto myLambdaCallback = [this]()
{
    myGreatClassFunction(1,2,3);
};