
-----------------------------------
stef_ios
Tue Apr 11, 2006 8:02 am

Colours and Boxes
-----------------------------------
Hey. So I have yet another code that needs fixing. This time, there are boxes with selections and when you pick a box it does what the box says. There are five selections: red, blue, green, exit, and clear. If your pick one of the colours, the oval should turn that colour, but if you pick clear it goes blank, and exit will stop the program. So here is my code.

procedure gui
    locatexy (110,285)
    put "RED"
    locatexy (110,200)
    put "BLUE"
    locatexy (110,75)
    put "GREEN"
    locatexy (290,75)
    put "EXIT"
    locatexy (500,75)
    put "CLEAR"
    drawbox (50,275,175,375,red)   %Red
    drawbox (50,150,175,250,red)   %Blue
    drawbox (50,25,175,125,red)    %Green 
    drawbox (400,25,175,125,red)   %Exit
    drawbox (600,25,175,125,red)   %Clear
    drawoval (450,250,25,25,black) %Oval    
end gui

var x, y, button: int
gui
loop
    mousewhere (x,y,button)
    if button = 1 and 50 