bug-ncurses
[Top][All Lists]
Advanced

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

Function refresh()


From: jochen.walborn
Subject: Function refresh()
Date: Mon, 20 Dec 2004 06:49:49 GMT

Hello,

 

I am using ncurses-5.3, my terminal is of type "linux".

 

I have a question regarding the refresh() function.

I am not sure how it interacts with wrefresh(..).

The following source code works as expected,

the window with its frame will be drawn on the screen.

As we see, refresh() will be called before wrefresh(..).

1) If the refresh() line will be moved after wrefresh(..), nothing

will be drawn.

2) If I call refresh() additionally after wrefresh(..) the window will

be drawn but the cursor will be moved to the upper left corner

of the screen.

 

Do you have an explanation for this behaviour ?

 

Thanks & regards

Jochen Walborn

 

################################################

#include <curses.h>

int main( void )
{
  WINDOW *psFirstWin;

  initscr();                           /* start ncurses */
  refresh();                           /* flush output buffer */

  psFirstWin = newwin( 10, 20, 5, 5 ); /* create new window */
  box( psFirstWin, 0, 0 );             /* draw box around the window */
                                       /* 0,0 means default char's */
  wrefresh( psFirstWin );              /* draw the window on the screen */

  getch();                             /* wait for input key */

  delwin( psFirstWin );                /* delete window */
  endwin();                            /* end ncurses */

  return( 0 );
}
################################################



Online Viren Scan: Scannen Sie Ihren PC jetzt kostenlos online Jetzt scannen!


reply via email to

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