[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-users] drawHook and do loops





does anyone know why does the do loop in this simple Pen example executes multiple times? this is a concise version of a problem which is showing up in a much longer piece of code-in-progress, and i can't figure it out.

thanks,

jascha

-----code: -----------

f = {
var win;
win = "penplot", Rect(100,100,400,200));
win.view.background_(Color.white);
win.drawHook = {
Pen.translate(0,100);
Color.grey.set;
Point(0,0));
Point(400,0));
Pen.stroke;
2.do({|i| i.postln});
win.refresh;
win.front;
};
};

f.value;