* Bug or hidden feature ?
@ 1999-07-30 13:03 Alain Birtz
0 siblings, 0 replies; only message in thread
From: Alain Birtz @ 1999-07-30 13:03 UTC (permalink / raw)
To: linuxppc-dev
/*
In the code below, the second loop print char exactly is the same place
as the first loop. The only change is the char printed. Hit 3 time a key
A strange thing happen when the last half end of the line hold only
blanck space character.
Normally the blank must erase the underscore. This not happen.
Instead the remaining of the line (after the underscore) is erased.
This seem happen only in the X term window
Tested in Gnome terminal (linucPPC R5)
Is it an hidden feature ? Or is there something wrong with the code ?
*/
// gcc -I/usr/include/ncurses tst_addch.c -g -o tst -lncurses
#include <curses.h>
int main()
{
int r, c;
initscr();
for (r = 0; r < LINES; r++) /* fill screen of letter, so we can see
what happen */
{
for (c = 0; c < COLS; c++)
mvaddch(r, c, 'A'+ r);
}
refresh();
getchar();
// FIRST LOOP
for (r = 2; r < LINES - 2; r++) /* write in middle of the screen */
{
for (c = 3; c < COLS / 2; c++)
if (c < COLS / 5)
mvaddch(r, c, '*');
else
mvaddch(r, c, '_'); /* first loop -> use underscore */
}
refresh();
getchar();
// SECOND LOOP
for (r = 2; r < LINES - 2; r++) /* write in same place */
{
for (c = 3; c < COLS / 2; c++)
if (c < COLS / 5)
mvaddch(r, c, '/');
else
mvaddch(r, c, ' '); /* second loop -> use blanck space char */
}
refresh();
getchar();
endwin();
exit(0);
}
// the second loop is same as the first loop, except for the char
printed
// the underscore is not replaced by the blank char
// but the remainning of the line (after the unserscore) is erased
// if the terminal window is small, this not happen
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-07-30 13:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-07-30 13:03 Bug or hidden feature ? Alain Birtz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).