Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Blinking a row

by hdhairul
on Sep 10, 2003 at 02:06 UTC ( #290263=perlquestion: print w/ replies, xml ) Need Help??
hdhairul has asked for the wisdom of the Perl Monks concerning the following question:

Halo...

I want to build a function that can make a selected row blinking...

Can anyone give and idea.. or a help perhaps :)

Thank a lot

Comment on Blinking a row
(humor)Re: Blinking a row
by Anonymous Monk on Sep 10, 2003 at 02:18 UTC

    Sure, view it on a dodgy monitor. :)

      You can get that effect with a perfectly good monitor too, if you do it right. Set the monitor refresh rate to sixty hertz, position the monitor under fluorescent lighting, and set your screen colours to black on bright white. Voila, an eyesore. Alternately, use an older monitor (a VT510 will do nicely) positioned a couple of feet from a running microwave oven.


      $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
Re: Blinking a row
by jeffa (Chancellor) on Sep 10, 2003 at 02:23 UTC
    What kind of row? Tk? HTML?

    Personally (and i speak for many), i find that blinking things are distracting and hinder the information exchange process. Better is to assign a seperate background, one that is not obtrusive but still manages to stand out.

    Please explain more of what you what you want and you will probably get better responses.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      Personally (and i speak for many), i find that blinking things are distracting and hinder the information exchange process.

      Personally (and i speak for many), i find that Perl code is distracting and hinders the information exchange process.

      Just kidding, but simply because you think something is unelegant doesn't mean it shouldn't be done :)

Re: Blinking a row
by jonadab (Parson) on Sep 10, 2003 at 02:32 UTC

    You're going to need to tell us more about what you want. What kind of row are we talking about? A row in a relational database? A line on a terminal or console? (What kind? ANSI?) A row in a table in a widget? (What widget set? Tk? Gtk? Win32? Qt? Wx? Xaw3D?) A row in a table in a web page? A row in a table in an OpenOffice document? A row of LEDs on one of those cool computer-controlled signs? A row of pixels on your monitor?

    Also, by selected, do you mean that your program has in some fashion selected this row for highlighting, or is this something the user has selected using the keyboard or mouse?


    $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/

      Hey, I just remembered how I used to blink a row in Applesoft BASIC. I think I can emulate that effect in Perl...

      sub blinkrow { my ($rowtext) = @_; while (1) { print$/x60;sleep 1; print "$rowtext\n"; sleep 1; } }

      HTH.HAND.


      $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/

        The \r carriage return is useful for incrementing counters but can also do blink - If you have to! A reasonable purpose would be say if the nuclear reactor powering you computer is in danger of a China Syndrome meltdown due to problems with the heavy water supply from your municipal authority....

        do{ print 0==$a++%2 ?"Core Meltdown!\r" : " \r"; sleep 1} + while 1;

        cheers

        tachyon

        s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: Blinking a row
by jonnyfolk (Vicar) on Sep 10, 2003 at 05:21 UTC

    I assume that since you started your post with the word 'halo' that you are only interested in hearing from our saints on this one...

    This lowly monk thinks you might find what you're looking for using javascript.

Re: Blinking a row
by bart (Canon) on Sep 10, 2003 at 14:09 UTC
    If you mean in a normal text terminal, then look into the proper VT-100 escape codes. In that table "^[" is used as a symbolic representation of the escape character, chr(27) — in Perl you can use "\e".

    So I think you want

    print "\e[5m";
    after which you can print your text. Disable it again with
    print "\e[0m";

    I must say: I've tried it, and it doesn't blink. I think the resulting behaviour is very much dependent on your terminal. Instead, I see dark red on black. At least it stands out.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://290263]
Approved by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2014-08-21 03:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (127 votes), past polls