EvilZone

Programming and Scripting => C - C++ => : 0poitr January 09, 2013, 06:37:53 PM

: [ C ] Need some help with libncurses
: 0poitr January 09, 2013, 06:37:53 PM
EDIT : My bad. Its getsyx() and setsyx() not xy.

Hello. I actually want to update three different lines in console simultaneously (well, psudo), i.e. in a loop they will be constantly updated and they are three separate lines. Now of course the line are separated by \n s but I don't want to keep printing print new lines all the way throughout the loop. Just the three lines should be updated as the loop proceeds. Hope you get me :)
Now, I have left my hope with the std C library. I have been trying to manipulate the terminal with the ncurses library. As far as I've known yet I can do it like
:
getsxy(); /* get current cursor pos */
print 3 lines;
setsxy(); /* set curr cursor pos (only modifies the data structure)*/
wclrtobot(); /* clr from cursor to end of screen */
doupdate(); /* display the updated buffer */
Now, problem is, somehow, the linker throws undefined reference errors for getsxy and setsxy although not for the other functions from the library ( am compiling with gcc -lncurses )

Can someone help me out? This is first time am dealing with the curses library.
btw, here's the program am working on :: https://evilzone.org/c-c/(c)-matrix-effect-printing-text/msg44011/#msg44011 (https://evilzone.org/c-c/(c)-matrix-effect-printing-text/msg44011/#msg44011)
: Re: [ C ] Need some help with libncurses
: Xires January 15, 2013, 05:25:09 AM
Try ANSI escape sequences.

http://wiki.bash-hackers.org/scripting/terminalcodes (http://wiki.bash-hackers.org/scripting/terminalcodes)

: (bash)
echo -e "\033[y;xH"


: (c)
printf("\033[%d;%dH", y, x);
: Re: [ C ] Need some help with libncurses
: 0poitr January 15, 2013, 12:32:21 PM
Try ANSI escape sequences.
yeah, that's what I did.