is_linetouched, is_wintouched, touchline, touchwin, untouchwin, or wtouchin Subroutine

Purpose

Window refresh control functions.

Library

Curses Library (libcurses.a)

Syntax

#include <curses.h>

bool is_linetouched(WINDOW *win,
int line);
bool is_wintouched(WINDOW *win);

int touchline(WINDOW *win,
int start,
int count);

int touchwin(WINDOW *win);

int untouchwin(WINDOW *win);

int wtouchln(WINDOW *win,
int y,
int n,
int changed);

Description

The touchline subroutine touches the specified window (that is, marks it as having changed more recently than the last refresh operation). The touchline subroutine only touches count lines, beginning with line start.

The untouchwin subroutine marks all lines in the window as unchanged since the last refresh operation.

Calling the wtouchln subroutine, if changed is 1, touches n lines in the specified window, starting at line y. If changed is 0, wtouchln marks such lines as unchanged since the last refresh operation.

The is_wintouchwin subroutine determines whether the specified window is touched. The is_linetouched subroutine determines whether line line of the specified window is touched.

Parameters

Item Description
line  
start  
count  
changed  
y  
n  
*win  

Return Values

The is_linetouched and is_wintouched subroutines return TRUE if any of the specified lines, or the specified window, respectively, has been touched since the last refresh operation. Otherwise, they return FALSE.

Upon successful completion, the other subroutines return OK. Otherwise, they return ERR. Exceptions to this are noted in the preceding subroutine.

Examples

For the touchline subroutine:

To set 10 lines for refresh starting from line 5 of the user-defined window my_window, use:

WINDOW *my_window;
touchline(my_window, 5, 10);
wrefresh(my_window);

This forces curses to disregard any optimization information it may have for lines 0-4 in my_window. curses assumes all characters in lines 0-4 have changed.

For the touchwin subroutine:

To refresh a user-defined parent window, parent_window, that has been edited through its subwindows, use:

WINDOW *parent_window;
touchwin(parent_window);
 
wrefresh(parent_window);

This forces curses to disregard any optimization information it may have for my_window. curses assumes all lines and columns have changed for my_window.