home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
lb091.zip
/
BUTTONS.BAS
< prev
next >
Wrap
BASIC Source File
|
1995-09-27
|
2KB
|
82 lines
' This is a turtle graphics demo,
' this new version shows how to custom size buttons
size$ = "100"
size = val(size$)
color$ = "black"
button #1, Triangle, [triangle], LR, 230, 15, 65, 20
button #1, Square, [square], LR, 160, 15, 55, 20
button #1, Size, [size], LR, 100, 15, 45, 20
button #1, Quit, [quit], LR, 50, 15, 45, 20
button #1, Red, [colorRed], UL, 5, 5, 45, 20
button #1, Blue, [colorBlue], UL, 55, 5, 45, 20
button #1, Green, [colorGreen], UL, 105, 5, 45, 20
open "This is a turtle graphics window!" for graphics as #1
print"Press one of the buttons in the graphics window"
[loop]
input a$
goto [loop]
[triangle]
print #1, "color "; color$
print #1, "cls ; home ; down ; north"
for x = 1 to size
print #1, "turn 122 ; go "; str$(x*2)
next x
print #1, "flush"
goto [loop]
[square]
print #1, "color "; color$
print #1, "cls ; home ; down ; north"
for x = 1 to size
print #1, "turn 88 ; go "; str$(x*2)
next x
print #1, "flush"
goto [loop]
[colorRed]
color$ = "red"
goto [loop]
[colorBlue]
color$ = "blue"
goto [loop]
[colorGreen]
color$ = "green"
goto [loop]
[size]
prompt "What size figure?"; size$
size = val(size$)
if size < 1 then beep : goto [size]
goto [loop]
[quit]
confirm "Do you want to quit?"; quit$
if quit$ = "no" then [loop]
close #1
end