Make text in a label flash

And don’t forget to remove the handler in Close as Michel did. Without that a cyclic reference isn’t broken and if it’s blinking when the window is closed you get a crash because the Timer is still trying to blink a closed Label.

The difference was I was initializing in the CONSTRUCTOR, and should have been in OPEN
my class is ALMOST identical to Michels, expect I exposed color, period, and a boolean isFlashing value

now how to shadow the Labels TEXTCOLOR attribute with a computed property of the same name?

Why do you need to shadow it ? What I do is put it aside in originalColor in Open, so I can manipulate it, and put it back afterward.

Because I want to present it in the IDE, and need to update my zTextcolor, should the user change it AFTER adding the label

Here is a link to my version www.rdS.com/labelblink.zip
and here is what its inspector looks like

I want to to be transparent to the developer… drop it in like any other Label, but with enhanced properties

You could check TextColor before blinking.

could do a number of things… but this way I know for sure what the two colors involved should be at all times…
Otherwise it is possible to screw it up, since the control itself is swapping textcolor around as well

[quote=299301:@Michel Bujardet]Here is my subclass

https://dl.dropboxusercontent.com/u/17407375/LabelBlink.xojo_binary_project[/quote]

just incorporate your blinking label class into my class for LabelAdv.
Work very well on iMac.

oops… i was using Dave S version.

As Dave pointed out, they are very similar. His offers more bells and whistles.

My point was not to create the next toy for Christmas, but, rather, to show how to build such a feature.

Teach a man how to fish …

And I got bored and built a Christmas toy for all to enjoy :smiley:

flashing label is perfect for christmas… like flashing light on the christmas tree

Ugh you guys are making me want to put up my christmas lights. :stuck_out_tongue:

we are going to put up on 1st December

I am trying to get the label to flash , do some process like creating pdf file and when the pdf file stop the flashing or make it invisible.
but for some reason, the label become visible and start flashing after the pdf file is generate which is not what i want.

how do i make the label flashing in the beginning of the long process??

Please don’t. Use a Progress Wheel or an Indeterminate Progress Bar for indeterminate progress.

ok… will try that…

To let the user know what’s going on you can put a label next to it:

Generating PDF…

Blinking text can’t really be interpreted by screen readers, and if it’s blinking colors you risk losing the message with color-blind users as well. Using color as a supplement is okay, but it should not be the only method of conveying status.

how do i set it to invisible first, then when i click on the button to generate the pdf, show the progress wheel and then when the pdf is ready, hide the progress wheel again??

i still get the progress wheel show after pdf is created.

[quote=299449:@Richard Duke]how do i set it to invisible first, then when i click on the button to generate the pdf, show the progress wheel and then when the pdf is ready, hide the progress wheel again??

i still get the progress wheel show after pdf is created.[/quote]
Remember (from the top of this thread,) interface updates happen at the end of a method. I would use a timer/thread combo. Show progress indicator, start thread, start timer. Timer watches thread status, and the end of thread Timer hides progress indicator.

Normally, as soon as you turn the visible property of a control false, a control should disappear instantly.

For those of you that want Christmas/Holiday lights, here is a class I whipped up this morning, based on the Blinking Label class from yesterday…

www.rdS.com/ledblink.xojo_xml_project.zip