Based on the creation of single-page applications with the WYSISWYG visual editor in JUCE, itโs a little difficult for me to understand how to call new windows (outside the main window of the graphical user interface). I made a test application that has a small minimal basic GUI that I created using a visual editor. He has a button "Create a new window." My goal is to be able to click this button and open a new window, and that this new window is a component of the GUI JUCE (AKA, graphical / visual graphical editor). Now I really achieved this, however, throwing errors and statements, so it would be great to get a very simple step-by-step tutorial.
I studied the main.cpp file that Projucer automatically created to understand how they create the window. Here is what I did.
1) In my project, I added a new GUI component (which becomes a class) and named it "InvokedWindow". 2) In my main GUI component header, I added a new copied pointer of type InvokedWindow: ScopedPointer<InvokedWindow> invokedWindow; 3) I created a new button in the main graphics editor called "Make a new window" and added this to the handler code: newWindowPtr = new InvokedWindow; so that each time a button is pressed, a new object of type InvokedWindow is created. 4) In the InvokedWindow class, in the constructor, on top of the automatically generated code, I added:
setUsingNativeTitleBar (true); setCentrePosition(400, 400); setVisible (true); setResizable(false, false);
What kind I got from the main JUCE application file.
I also added a slider to this new window to add functionality to it.
5) I added an overloaded function to close the window:
void InvokedWindow::closeButtonPressed() { delete this; }
So, now when I launch the application and click the "Create New" button, a new window appears, but I get the statement:
In addition, I can close the window once and click on the button in the main GUI to create another instance of newWindow, but when I close it a second time, it results in an error:
template <typename ObjectType> struct ContainerDeletePolicy { static void destroy (ObjectType* object) {
It's all a little over my head. I realized that it would not be so bad to create a new window using the button. A new window that I could edit using a graphical graphics editor, but I can not fully figure it out on my own, I tried. Can someone post a walkthrough to do it right? I posted this on the JUCE forums, but due to the lack of a GUI, I was not able to figure out the solutions that were submitted (my own mistake), so I hope to get a very simple guide on this. That would be very appreciated. Thanks.