bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mvcur() function does not work


From: Thomas Dickey
Subject: Re: mvcur() function does not work
Date: Mon, 21 May 2007 08:47:18 -0400 (EDT)

On Mon, 21 May 2007, Alexey Miheev wrote:

I have tried to use mvcur() function to move the cursor on screen. But
as I see this functions does nothing on major Linux distributions (Red
Hat 4, SuSe 10, Ubuntu 6.06).
LSB 3.1 refers to SUSv2 (The Single UNIX Specification, Version 2) for the
description of the libncurses functions. According to this standard,
the function returns 0 only upon successful completion.

In the following code, mvcur() returns OK, but the visible cursor does
not change its place.

That's not surprising.

mvcur() is a low-level function, like tputs().  Note the comment at the
end of http://www.opengroup.org/onlinepubs/007908799/xcurses/mvcur.html -

After use of mvcur(), the model Curses maintains of the state of the terminal might not match the actual state of the terminal. The application should touch and refresh the window before resuming conventional use of Curses.

Curses may use this function internally (ncurses does), but calling it from a curses application doesn't have a specified behavior.

> #include <stdio.h>
#include <curses.h>

int main(int argc, char* argv[])
{
       int res;

       initscr();

       getch();
       move(LINES/2, COLS/2);
       getch();
       res=mvcur(LINES/2, COLS/2, 5, 5);
       getch();

       endwin();
       printf("mvcur() return value was %d\n", res);

       return 0;
}


Regards, Alexey Miheev

Linux Verification Center, ISPRAS
web:    http://www.linuxtesting.org
e-mail: address@hidden




_______________________________________________
Bug-ncurses mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-ncurses


--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]