We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm successfully using G4P GUI Builder to create and manage a GUI (thanks Peter!).
What I need to do now is have a second "conventional" Processing draw window open at the same time as the G4P window. Is there a more elegant way of doing this other than running a second applet as shown in the following code (this is hypothetical code -- I just created it a text editor to illustrate my point so it may will not compile):
setup() // Main Setup routine
{
//Usual setup code here
//
// G4P GUI Builder setup
size(1300, 320, JAVA2D);
createGUI();
customGUI();
// Start up second applet with it's own draw window
String[] args = {"New Window Caption"};
MySecondWindowClass swc = new MySecondWindowClass();
PApplet.runSketch(args, swc); // Run the second applet
}
// SECOND APPLET FOR CONVENTION PROCESSING DRAW WINDOW
public class MySecondWindowClass extends PApplet
{
setup() // Setup for second applet
{
size(1000,500); // For second window
}
draw() // Draw for second applet
{
textSize(10);
textAlign(LEFT,TOP);
text("Hello world!") // Text to be displayed on second window (not the G4P window)
}
}
The idea, of course, is to be able to do all the cool things one can do with Processing in the second draw window leaving the GUI window untouched.
Thanks in advance, Andy
Answers
Check these sites:
http://www.lagers.org.uk/g4p/ex-windows/index.html
http://www.lagers.org.uk/g4p/guides/g02-windows.html
Kf
Thanks, KF. Only goes to show you need to know what something's called to find it with Google. Duh!
Apologies for making you do Google searches for me! (see http://lmgtfy.com) :)
Andy