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

leaveok Subroutine

Purpose

Controls physical cursor placement after a call to the refresh subroutine.

Library

Curses Library (libcurses.a)

Syntax

#include <curses.h>
leaveok(Window, Flag)
WINDOW *Window;
bool Flag;

Description

The leaveok subroutine controls cursor placement after a call to the refresh subroutine. If the Flag parameter is set to FALSE, curses leaves the physical cursor in the same location as logical cursor when the window is refreshed.

If the Flag parameter is set to TRUE, curses leaves the cursor as is and does not move the physical cursor when the window is refreshed. This option is useful for applications that do not use the cursor, because it reduces physical cursor motions.

By default leaveok is FALSE, and the physical cursor is moved to the same position as the logical cursor after a refresh.

Parameters

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 Identifies the window to set the Flag parameter for.

Return Values

OK Indicates the subroutine completed. The leaveok subroutine always returns this value.

Examples

  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);

Implementation Specifics

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

Related Information

The refresh subroutine.

Controlling the Cursor with Curses, Curses Overview for Programming, List of Curses Subroutines in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.


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