touchwin Subroutine

Purpose

Forces every character in a window's buffer to be refreshed at the next call to the wrefresh subroutine.

Library

Curses Library (libcurses.a)

Syntax

#include <curses.h>

touchwin( Window)
WINDOW *Window;

Description

The touchwin (touchwin Subroutine) subroutine forces every character in the specified window to be refreshed during the next call to the refresh or wrefresh subroutine. To force a specific range of lines to be refreshed, use the touchline (is_linetouched, is_wintouched, touchline, touchwin, untouchwin, or wtouchin Subroutine) subroutine.

The combined usage of the touchwin and wrefresh subroutines is helpful when dealing with subwindows or overlapping windows. When dealing with overlapping windows, it may become necessary to bring the back window to the front. A call to the wrefresh subroutine does not change the terminal because none of the characters in the window were changed. Calling the touchwin subroutine on the back window before the wrefresh subroutine redisplays the window on the terminal and, effectively, brings it to the front.

Parameters

Item Description
Window Specifies the window to be touched.

Example

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.