OK, I am a total newvie, and I am using Processing 3.5.4 with the G4P library. When I say newbie, I really, really mean it. A week ago I thought a class was a room full of kids, and I still have no clue what a handler is. But…
I am writing (and by “writing”, I mean “stealing someone else’s code and trying to work out what the hell it all means”) a little app that has a main window and some G4P-created GWindows.
The Gwindows are created like this:
First by defining the windows:
GWindow patterningWindow,
knitWindow,
configWindow;
Then by calling them in void setup:
void setup() {
dh = new DisposeHandler(this);
visualpassapSettings = new JSONObject();
size(1080, 800);
noSmooth();
surface.setTitle("Visual Passap");
UsedFont = loadFont("GillSansMT-48.vlw");
textFont(UsedFont);
//load Logo
visualpassapLogoImage = loadImage("VP_logo_80px.gif");
displayButtonsGUI(); //GUI tab
drop = new SDrop(this);
//load BasicSettings
visualpassapSettingsName = "data/BasicVPSettings.json";
loadvisualpassapSettingsFile();
// create Windows
createConfigWindow();
configWindow.setVisible(false);
createPatterningWindow();
patterningWindow.setVisible(false);
createKnitWindow();
knitWindow.setVisible(false);
}
And then by creating my own void-thingy (is that a class?) to actually create it:
public void createKnitWindow() {
knitWindow = GWindow.getWindow(this, "Knit", 0, 0, 200, 400, JAVA2D);
displayButtonsKnit();
knitWindow.setAlwaysOnTop(true);
knitWindow.addDrawHandler(this, "knitDraw");
knitWindow.addMouseHandler(this, "knitMouse");
}
but they are fixed firmly in place and I can’t drag them around with my mouse. How can I make this be possible? I know that it is possible because it works in one of the examples but I am blowed if I can see where my code is different…
Please can you explain slowly and carefully for the hard of thinking? Thank you!