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

Re: [sc-users] drawHook and do loops



Looks like win.refresh calls the drawHook again and again:

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

};

Josh


******************************************
Joshua Parmenter
Post-Doctoral Research Associate - Center for Digital Arts and Experimental Media
Raitt Hall - University of Washington
Seattle, Washington 98195



On Mar 6, 2006, at 2:51 PM, Jascha Narveson wrote:


f = { 

var win;

win = SCWindow.new("penplot", Rect(100,100,400,200));

win.view.background_(Color.white);

win.drawHook = {

Pen.translate(0,100);

Color.grey.set;

Pen.moveTo(Point(0,0));

Pen.lineTo(Point(400,0));

Pen.stroke;

2.do({|i| i.postln});

win.refresh;

win.front;

};

};


f.value;