Blinking LEDs
[1/4] from: sanghabum:aol at: 25-Jun-2001 6:39
Does anyone know the secret of getting a VID LED style to change color? The
code below seems to indicate that 'Show resets the color to an internal
default.
unview/all
view layout [
myled: led
button "press me" [
myled/color: 0.255.0
print myled/color
show myled
print myled/color
]
]
I get:
0.255.0 ;; that's me having changed the color
255.0.0 ;; that's VID overriding my change
Thanks,
Colin
[2/4] from: chris:ross-gill at: 25-Jun-2001 7:39
Hi Colin,
> Does anyone know the secret of getting a VID LED style to change
> color? The code below seems to indicate that 'Show resets the color to
> an internal default.
Try
myled/data: true
and
myled/data: false
to change back again. The color defaults are in 'myled/colors.
- Chris
[3/4] from: allenk:powerup:au at: 25-Jun-2001 21:39
You can provide your own led colors, this example will flash on and off
view layout [l1: led blue yellow 0:00:00.20]
view layout [l1: led blue yellow button "Change" [l1/data: not l1/data]
show l1]
There are a couple of scripts on my reb that play with led style.
led chooses its color from face/colors based on whether the led is on or
off.
view layout [
myled: led
button "press me" [
myled/colors/2: 0.255.0
print myled/color
show myled
print myled/color
]
]
Cheers,
Allen K
[4/4] from: sanghabum:aol at: 25-Jun-2001 10:29
Thanks Chris and Allen:
> Try
>
> myled/data: true
>
> and
>
> myled/data: false
>
I'd looked at /data (and /text and /options) and everywhere else to find
where the value was lurking. I'd missed it in /data as that has a default
value of None, not True/False.
--Coiln.