G4P GWindow issue.
in
Contributed Library Questions
•
8 months ago
Hi I want to use a second window, using GWindow, to plot a graph with realtime input. (let's say mouse position)
The problem is that also if I don't put 'background()' neither in the main draw() nor in the GWindow draw(), the second window always refresh as if i was calling background() each cycle.
This way I cannot plot a graph, because each cycle the GWindow is blanked.
Can someone help me?
Linuxmint 13 and latest processing/G4P library.
here is some code to reproduce the issue:
The problem is that also if I don't put 'background()' neither in the main draw() nor in the GWindow draw(), the second window always refresh as if i was calling background() each cycle.
This way I cannot plot a graph, because each cycle the GWindow is blanked.
Can someone help me?
Linuxmint 13 and latest processing/G4P library.
here is some code to reproduce the issue:
- import g4p_controls.*;
GWindow NewWindow;
void setup() {
size(400,400,JAVA2D);
background(100,30,30);
NewWindow = new GWindow(this, "Scope Window", 0, 50, 600, 380, false, JAVA2D);
NewWindow.addDrawHandler(this, "NewWindow_Draw");
}
void draw() {
stroke(255);
if(mousePressed) {
line(mouseX, mouseY, pmouseX, pmouseY);
}
}
void NewWindow_Draw(GWinApplet appc, GWinData data) {
if(appc.mousePressed) {
appc.line(appc.mouseX, appc.mouseY, appc.pmouseX, appc.pmouseY);
}
}
1