[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 2

clearok, idlok, leaveok, scrollok, setscrreg or wsetscrreg Subroutine

Purpose

Terminal output control subroutines.

Library

Curses Library (libcurses.a)

Syntax

#include <curses.h>

int clearok(WINDOW *win,
bool bf);

int idlok(WINDOW *win,
bool bf);

int leaveok(WINDOW *win,
bool bf);

int scrollok(WINDOW *win,
bool bf);

int setscrreg(int top,
int bot);

int wsetscrreg(WINDOW *win,
int top,
int bot);

Description

These subroutines set options that deal with output within Curses.

The clearok subroutine assigns the value of bf to an internal flag in the specified window that governs clearing of the screen during a refresh. If, during a refresh operation on the specified window, the flag in curscr is TRUE or the flag in the specified window is TRUE, then the implementation clears the screen, redraws it in its entirety, and sets the flag to FALSE in curscr and in the specified window. The initial state is unspecified.

The idlok subroutine specifies whether the implementation may use the hardware insert-line, delete-line, and scroll features of terminals so equIpped. If bf is TRUE, use of these features is enabled. If bf is FALSE, use of these features is disabled and lines are instead redrawn as required. The initial state is FALSE.

The leaveok subroutine controls the cursor position after a refresh operation. If bf is TRUE, refresh operations on the specified window may leave the terminal's cursor at an arbitrary position. If bf is FALSE, then at the end of any refresh operation, the terminal's cursor is positioned at the cursor position contained in the specified window. The initial state is FALSE.

The scrollok subroutine controls the use of scrolling. If bf is TRUE, then scrolling is enabled for the specified window, with the consequences discussed in Truncation, Wrapping and Scrolling on page 28. If bf is FALSE, scrolling is disabled for the specified window. The initial state is FALSE.

The setscrreg and wsetscrreg subroutines define a software scrolling region in the current or specified window. The top and bot arguments are the line numbers of the first and last line defining the scrolling region. (Line 0 is the top line of the window.) If this option and the scrollok subroutine are enabled, an attempt to move off the last line of the margin causes all lines in the scrolling region to scroll one line in the direction of the first line. Only characters in the window are scrolled. If a software scrolling region is set and the scrollok subroutine is not enabled, an attempt to move off the last line of the margin does not reposition any lines in the scrolling region.

Parameters

The parameters for the clearok subroutine are:

Flag Sets the window clear flag. If TRUE, curses clears the window on the next call to the wrefresh or refresh subroutines. If FALSE, curses does not clear the window.
Window Specifies the window to clear.

The parameters for the idlok subroutine are:

Flag Specifies whether to enable curses to use the hardware insert/delete line feature (TRUE) or not (FALSE).
Window Specifies the window it will affect.

The parameters for the leaveok subroutine are:

Flag Specifies whether to leave the physical cursor alone after a refresh (TRUE) or to move the physical cursor to the logical cursor after a refresh (FALSE).
Window Specifies the window for which to set the Flag parameter.

The parameters for the scrollok subroutine are:

Flag Enables scrolling when set to TRUE. Otherwise, set the Flag parameter to FALSE to disable scrolling.
Window Identifies the window in which to enable or disable scrolling.

The parameters for the setscrreg and wsetscrreg subroutines are:

Bmargin Specifies the last line number in the scrolling region.
Tmargin Specifies the first line number in the scrolling region (0 is the top line of the window.).
Window Specifies the window in which to place the scrolling region. You specify this parameter only with the wsetscrreg subroutine.

Return Values

Upon successful completion, the setscrreg and wsetscrreg subroutines return OK. Otherwise, they return ERR.

The other subroutines always return OK.

Examples

Examples for the clearok subroutine are:

  1. To set the user-defined screen my_screen to clear on the next call to the wrefresh subroutine, enter:
    WINDOW *my_screen;
    clearok(my_screen, TRUE);
  2. To set the standard screen structure to clear on the next call to the refresh subroutine, enter:
    clearok(stdscr, TRUE);

Examples for the idlok subroutine are:

  1. To enable curses to use the hardware insert/delete line feature in stdscr, enter:
    idlok(stdscr, TRUE);
  2. To force curses not to use the hardware insert/delete line feature in the user-defined window my_window , enter:
    idlok(my_window, FALSE);

Examples for the leaveok subroutine are:

  1. To move the physical cursor to the same location as the logical cursor after refreshing the user-defined window my_window, enter:
    WINDOW *my_window; 
    leaveok(my_window, FALSE);
  2. To leave the physical cursor alone after refreshing the user-defined window my_window, enter:
    WINDOW *my_window;
    leaveok(my_window, TRUE);

Examples for the scrollok subroutine are:

  1. To turn scrolling on in the user-defined window my_window, enter:
    WINDOW *my_window;
    scrollok(my_window, TRUE);
  2. To turn scrolling off in the user-defined window my_window, enter:
    WINDOW *my_window;
    scrollok(my_window, FALSE);

Examples for the setscrreg or wsetscrreg subroutine are:

  1. To set a scrolling region starting at the 10th line and ending at the 30th line in the stdscr, enter:
    setscrreg(9, 29);
    Note: Zero is always the first line.
  2. To set a scrolling region starting at the 10th line and ending at the 30th line in the user-defined window my_window, enter:
    WINDOW *my_window;
    wsetscrreg(my_window, 9, 29);

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The delscreen, doupdate, and scrl subroutines.

The clear subroutine, refresh or wrefresh subroutine.

Curses Overview for Programming in AIX General Programming Concepts: Writing and Debugging Programs.

List of Curses Subroutines and Manipulating Characters with Curses in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Contents | Glossary | Home | Search ]