All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Alain Birtz <abz@videotron.ca>
To: linuxppc-dev@lists.linuxppc.org
Subject: Bug or hidden feature ?
Date: Fri, 30 Jul 1999 08:03:24 -0500	[thread overview]
Message-ID: <37A1A29B.43C7AE75@videotron.ca> (raw)



/*
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.   ]]

                 reply	other threads:[~1999-07-30 13:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37A1A29B.43C7AE75@videotron.ca \
    --to=abz@videotron.ca \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.