PDA

View Full Version : How to move the cursor to write in a different position of the screen?



edugarcia
01-12-2005, 01:50 PM
Hi guys,

How can I move the actual cursor position for writting in a different place of the screen? Is there some kind of movexy()
function for writting in a different place?

Thanx in advance!

Codeplug
01-12-2005, 02:09 PM
I'll assume that you didn't intend to double post since it's against forum guidelines.

NCURSES (http://en.tldp.org/HOWTO/NCURSES-Programming-HOWTO/)

gg

jim mcnamara
01-14-2005, 09:46 AM
IF you are in console mode use ANSI escape sequences. If your terminal is set up as one that will respond to them... like vt100.

http://www.delmar.edu/Courses/CIS415L/ANSIsys.htm

edugarcia
01-14-2005, 02:29 PM
Thanx guys. So there's no chance to do it cleanly without curses?

Of course it wasn't my intention to post twice. Is just that first time my browser got blocked, so I thought that it wasn't posted. :rolleyes:
Sorry anyway and thanks a lot!

Codeplug
01-14-2005, 04:34 PM
>> So there's no chance to do it cleanly without curses?
Depends on what you mean by "cleanly". If you don't care about terminal portability, then you can use your terminal's explicit escape sequences using printf(). For VT100/ANSI terminals, use the reference that jim posted. Here's another reference (http://www.termsys.demon.co.uk/vtansi.htm) as well.

[N]Curses is a library that allows you to perform most of those functions in a terminal independent manner (with some extra functionality to boot).

gg