Cursor moving in one position

Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default Cursor moving in one position

    Hi all,
    in some aplicantions, we can see the cursor moving in
    one position, like an "indicator of application is running".
    In the examples that I see, they have made in C/C++.
    It is possible in perl?

    Sorry my bad english.
    Thanks in advance!
    Ricardo Pichler

    Ricardo Pichler Guest

  2. Similar Questions and Discussions

    1. Cursor position in the mx:TextInput
      Hi guys, does anyone knows how to set the exact cursor position in the mx:TextInput ? For example I want to set cursor after the second symbol. Is...
    2. HELP! DIV throws off position of cursor
      I put together a quick page to show something strange. If I remove the <Div> everything is fine. With the <Div> the cursor is off. That is, if...
    3. setting cursor position
      I have a login section in my app, and i am trying to put the cursor in the username textinput field on creationComplete. Currently when the app...
    4. How can I can I get the cursor mouse position (x, y) ??
      Hi, i'd like to get back my cursor mouse coords; My problem is to create a pdf formulary witch contains about 100 fiedls (checkbox). So I want to...
    5. cursor in position
      When a page is opened is there a way to set focus of the cursor to a named input. I want the cursor to be in the input box when the page is opened....
  3. #2

    Default Re: Cursor moving in one position

    This for win32, so you have to escape the double quotes on the inside:

    perl -e "$|++; while (1) {print \"\b+\";sleep 1;print \"\b-\";sleep 1;}"

    You'll probably find the use of "\" and "/" to make a spinner (at least
    under win32) a good way to wait for the paint to dry.... ;-}


    At 04:44 PM 2/9/04 -0300, you wrote:
    >Hi all,
    >in some aplicantions, we can see the cursor moving in
    >one position, like an "indicator of application is running".
    >In the examples that I see, they have made in C/C++.
    >It is possible in perl?
    >
    >Sorry my bad english.
    >Thanks in advance!
    >Ricardo Pichler
    >
    >
    >--
    >To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
    >For additional commands, e-mail: [email]beginners-help@perl.org[/email]
    ><http://learn.perl.org/> <http://learn.perl.org/first-response>
    Tim Guest

  4. #3

    Default Re: Cursor moving in one position

    Thanks for your reply!
    I go learn more about your example!

    Regards,
    Ricardo Pichler
    ----- Original Message -----
    From: "Tim" <timlhunt@mindspring.com>
    To: "Ricardo Pichler" <ricardo@pichler.com.br>
    Cc: <beginners@perl.org>
    Sent: Monday, February 09, 2004 4:53 PM
    Subject: Re: Cursor moving in one position

    > This for win32, so you have to escape the double quotes on the inside:
    >
    > perl -e "$|++; while (1) {print \"\b+\";sleep 1;print \"\b-\";sleep 1;}"
    >
    > You'll probably find the use of "\" and "/" to make a spinner (at least
    > under win32) a good way to wait for the paint to dry.... ;-}
    >
    >
    > At 04:44 PM 2/9/04 -0300, you wrote:
    > >Hi all,
    > >in some aplicantions, we can see the cursor moving in
    > >one position, like an "indicator of application is running".
    > >In the examples that I see, they have made in C/C++.
    > >It is possible in perl?
    > >
    > >Sorry my bad english.
    > >Thanks in advance!
    > >Ricardo Pichler
    > >
    > >
    > >--
    > >To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
    > >For additional commands, e-mail: [email]beginners-help@perl.org[/email]
    > ><http://learn.perl.org/> <http://learn.perl.org/first-response>
    >
    Ricardo Pichler Guest

  5. #4

    Default Re: Cursor moving in one position

    On Mon, 9 Feb 2004, Ricardo Pichler wrote:
    > Hi all,
    > in some aplicantions, we can see the cursor moving in
    > one position, like an "indicator of application is running".
    > In the examples that I see, they have made in C/C++.
    > It is possible in perl?
    >
    > Sorry my bad english.
    > Thanks in advance!
    > Ricardo Pichler
    First, your English is fine. Much better than my Portuguese would be!

    I tested the following on RedHat Linux 9.0 using Perl 5.8.0. It makes a
    rather slow spinner. The alarm() function only has resolution to about 1
    second. Spinning faster than once a second or so would require using one
    of the other methods mentioned if you do a "perldoc -f alarm", such as
    Time::HiRes from CPAN. I don't know if this works the same in Windows or
    not. I don't have Perl on my Windows box.

    #!/usr/bin/perl
    use strict;
    use warnings;
    our $click=0;
    $|=1;
    $SIG{ALRM}=sub {
    if ($click==0) { print "|\b";$click=1}
    elsif ($click==1) {print "/\b";$click=2}
    elsif ($click==2) {print "-\b";$click=3}
    else {print "\\\b";$click=0}
    alarm(10);
    };
    print "setting alarm\n";
    alarm(10);
    print "entering for loop\n";
    for (;;) { 1}

    Replace this for() loop with your code. Note that the $SIG{ALRM}
    subroutine must set the alarm again. Also note that only one alarm can be
    set at a time. If you set another alarm, the previous alarm is canceled.
    This means you can cancel your "spinner" using

    alarm(0);

    Hope this of use to you.


    --
    Maranatha!
    John McKown

    John McKown Guest

  6. #5

    Default Re: Cursor moving in one position

    hi Ricardo Pichler
    Its possible in perl using the module "Win32::Console::ANSI" .
    visit the following link for more..
    http://search.cpan.org/~jlmorel/Win32-Console-ANSI-1.04/lib/Win32/Console/ANSI.pm#AUXILIARY_FUNCTIONS
    cmkswamy@gmail.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139