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

LOGO-L> MSWLogo windows



;Hello Every Body
;Here is a trial to use windows functions of MSWLogo. To be honest
;I am not so comfortable with it. As you can see the core of this demo
;could be run without windows;with only 3 procedures totalling less than
;25 % of the code size. Does it worth?.
;Best Regards
;Mhelhefny
;------------------------------------------------- 
TO COL :N
OP ITEM :N [[255 255 0][255 0 0][0 255 0][0 0 255]
            [255 155 0][50 255 120][130 0 130]
            [30 200 200][255 0 255][200 200 100]
            [120 20 120][200 100 50]]
END

to draw
cs ht pd
poly_star 50*scrollbarget "size scrollbarget "depth scrollbarget "sides
pu sety -100 rt 90 label se "THE "POLY_STAR 
end

to fil
setfc col :lev pu rt 45 fd :size*.66 pd fill pu bk :size*.66 lt 45 pd 
end

to go
windowcreate "main "panel [poly_star] 0 0 100 130[setup]
end

to poly_star :size :lev :sides
if :lev =0 [stop]
repeat :sides [setpc col repcount fd :size/ 4 
poly_star :size/3 :lev-1 :sides fd :size/ 2 rt 360/:sides]
fil 
end

to scale1
staticupdate "text1 (se "depth scrollbarget "depth)
draw
end

to scale2
staticupdate "text2 (se "size scrollbarget "size)
draw
end

to scale3
staticupdate "text3 (se "sides scrollbarget "sides)
draw
end

to setup
buttoncreate "panel "stop [Exit] 30 100 40 15 [windowdelete "panel]
staticcreate "panel "text1 [depth] 15 10 70 10
scrollbarcreate "panel "depth 15 20 70 10 [scale1]
staticcreate "panel "text2 [size] 20 40 60 10
scrollbarcreate "panel "size 15 50 70 10 [scale2]
staticcreate "panel "text3 [sides] 20 70 60 10
scrollbarcreate "panel "sides 15 80 70 10 [scale3]
scrollbarset "depth 2 4 3
scrollbarset "size 1 5 3
scrollbarset "sides 4 7 5
end
;-------------------------------------------------
---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org.  Mail
questions about the list administration to logofdn@gsn.org.  To
unsubscribe send    unsubscribe logo-l    to majordomo@gsn.org.



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home