manjaro:

If you're referring to using a console window and having the cursor spin, then I can help you out. The way we do that is to draw the cursor, erase it, redraw it in its next position, etc.

So first, you need to decide on the character sequence for your cursor. The most commonly used appears to be: - \ | /

You can erase the character by simply backspacing and drawing the next character.

So your program should perform some variation of the steps:

1) Draw the current cursor character. 2) Pause for a little while. 3) Backspace. 4) Choose the next cursor character. 5) Go back to step 1.

Of course, you'll have to perform that sequence while doing whatever other tasks your program is doing. But this is a start.

Also, when you write the program, it may not appear to work, or work only in "bursts". To solve that problem, be sure to read Suffering from Buffering. If you need any more help, let us know.

...roboticus


In reply to Re: I am creating Perl Cursor by roboticus
in thread I want to use console window and having the cursor spin by manjaro

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.