We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi All--
I'm trying to send system.out data to a console in a controlP5 GUI. I'm sending the data to a textarea using the following:
import controlP5.*;
ControlP5 controlP5;
Textarea Output;
Println console;
void setup()
{
controlP5 = new ControlP5(this);
size(700, 600);
Output=controlP5.addTextarea("Output")
.setPosition(360, 110)
.setSize(330, 430)
.setLineHeight(14)
.setColorBackground(color(255,100))
.setColorForeground(color(255,100))
.scroll(1)
.hideScrollbar();
controlP5.addButton("Start", 0, 360, 550, 160, 40);
console = controlP5.addConsole(Output);
}
void draw()
{
background(0);
stroke(255);
}
void Start()
{
for (int i = 0; i < 1000; i++) {
println(str(i));
delay(4);
}
for (int i = 0; i < 500; i++) {
println(str(i));
delay(4);
}
}
It works but the data doesn't show up in the console until all the code in my "Start" function is finished. I would like this info to show after each "println(str(I));" is executed. I tried adding "redraw()" in my for loops but it doesn't help. Any one have any ideas?
Answers
true
.Thanks GoToLoop...I guess the only way to do it is to use a different structure. The following works: