Instead of Label, you could add your own component.
Also, from the documentation for launchAsync(), "When the dialog's close button is clicked, it'll automatically terminate its modal state..." So you shouldn't need to do this yourself. I'm guessing if you do it the way it's done in WindowsDemo.cpp, you won't need your hack.
What is happening is when i press the button on the DialogWindow that calls the showComponentOne and nothing happens, DialogWindow is closed but my component is not shown.
What am I doing wrong ?
How can I position this component to be on my DocumentWindow.
I can use a button on my FrontPageComponent that opens the new component called FirstComponent without any problem the same way:
addAndMakeVisible(showFirstComponent());
if (showFirstComponent() != nullptr)
{
showFirstComponent()->setBounds(0,0,1024,768);
}
But opening a DialogWindow and from the DialogWindow calling this, cannot !
You’re way over thinking this… Simply create a new class based on Component, in the main class display the the opaque new class on top of the original class as a child and make it the same size as the parent. It will completely cover the parent and when you close it the parent will be visible.
the situation is not related with me hidding the main component, but what I want is that from the DialogWindow to be able to close it and show a diferent Component, not the main.
So when the first component closes have the parent create and display the next component class object… The parent is always there and runs the show… The parent doesn’t need to be your main window… It can be a controller class which handles what components you display