Ask a Question related to PERL Beginners, Design and Development.
-
Ricardo Pichler #1
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
-
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... -
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... -
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... -
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... -
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.... -
Tim #2
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
-
Ricardo Pichler #3
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
-
John McKown #4
Re: Cursor moving in one position
On Mon, 9 Feb 2004, Ricardo Pichler wrote:
First, your English is fine. Much better than my Portuguese would be!> 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
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
-
cmkswamy@gmail.com #5
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_FUNCTIONScmkswamy@gmail.com Guest



Reply With Quote

