Hi, I am using Clarion 4 and hope someone can help me!
I'm trying to draw rectangles or buttons on the screen, and then randomly change the background or fill color. I have tried to do this, but can't get the colors to change on a hand-coded project.
My code:
Program
! global declarations
include('equates.clw')
map !begin defining prototypes
main procedure
end !prototypes
code !begins here
main !is called
return !to OS
main procedure !defined
! local definitions
WinOne WINDOW,AT(0,0,400,400),auto
b1 Box,use(?b1),AT(100,100,20,20)
b2 box,use(?b2),AT(140,140,20,20)
b3 box,use(?b3),AT(180,180,20,20)
button,at(190,190,20,20)
END
c long(0)
code !for main procedure goes here
open(winone)
accept
case event()
of event:selected
message(c)
c=random(0,00ffffffh)
message(c)
?b1{prop:fill} = c
c=random(0,00ffffffh)
message(c)
?b2{prop:fill} = c
c=random(0,00ffffffh)
message(c)
?b3{prop:fill} = c
display
.
.
return !main procedure ends
Can anyone help?
I'm trying to draw rectangles or buttons on the screen, and then randomly change the background or fill color. I have tried to do this, but can't get the colors to change on a hand-coded project.
My code:
Program
! global declarations
include('equates.clw')
map !begin defining prototypes
main procedure
end !prototypes
code !begins here
main !is called
return !to OS
main procedure !defined
! local definitions
WinOne WINDOW,AT(0,0,400,400),auto
b1 Box,use(?b1),AT(100,100,20,20)
b2 box,use(?b2),AT(140,140,20,20)
b3 box,use(?b3),AT(180,180,20,20)
button,at(190,190,20,20)
END
c long(0)
code !for main procedure goes here
open(winone)
accept
case event()
of event:selected
message(c)
c=random(0,00ffffffh)
message(c)
?b1{prop:fill} = c
c=random(0,00ffffffh)
message(c)
?b2{prop:fill} = c
c=random(0,00ffffffh)
message(c)
?b3{prop:fill} = c
display
.
.
return !main procedure ends
Can anyone help?