View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

the early days of sc silent movie

(
//the early days of sc silent movie
//(for sc3d)
//jrh 2000
var  x, p, r, t, i, d, path,opener ; 
x = GUIScreen.new("~", Rect.newBy(70,80,500,268));
x.view = View.new(Pen(action: \fill, foreColor: Color.black));
p = View.new(Pen(action: \fill, foreColor: Color.new(255.rand, 255.rand, 255.rand)));

x.view.items.add(Rect.newBy(0,0,500,268));
x.view.items.add(p);
r = Rect.newBy(300,200,35,36);
p.items.add(r);

t = TextBox( 
                        Pen(    textFont: \Monaco, 
                                textSize: 9, 
                                foreColor: rgb(128,128,128), 
                                backColor: rgb(0,0,0)
                        ), 
                Rect(0,0,500,500), "");
p.items.add(t);
p.items.swap(0, 1);

opener = {              i = 0;
                        path = ":common:" ++ (["Math", "Audio", "Core",  "Collections"].choose);
                        d = Directory.new(path).scan;  
};
opener.value;


x.sched(0, inf, {
        p.items.put(1, r.moveBy(3.rand2, 3.rand2));
        t.bounds = t.bounds.moveBy(0, -3); 
        x.refresh; 0.01 
});

x.sched(0, inf, { 
        var entry;
        entry = d.at(i);
        
        
        if(entry.notNil,{ 
                if(entry.isDir.not, { 
                                p.pen.foreColor = Color.new(255.rand, 255.rand, 255.rand);
                                l = entry.pathName;
                                
                                f = File(l, "rb");
                                s = f.readAllString;
                                f.close;
                                
                                t.bounds = Rect(0,290,500,290 + (s.size*0.8));
                                i = i + 1;
                })},  
        { opener.value });
        p.items.at(0).string_(s);
        x.refresh;
        s.size/60;
})
)



Links to this Page