Next: , Previous: , Up: The basic curses library   [Contents][Index]

5.2.29 Output options

These routines set options that change the style of output within curses. All options are initially #f, unless otherwise stated. It is not necessary to turn these options off before calling endwin.

Procedure: clearok! win bf

If clearok! is called with bf as #t, the next call to refresh with this window will clear the screen completely and redraw the entire screen from scratch. This is useful when the contents of the screen are uncertain, or in some cases for a more pleasing visual effect.

The return value is unspecified.

Procedure: idlok! win bf

If idlok! is called with #t as second argument, curses considers using the hardware insert/delete line feature of terminals so equipped. Calling idlok! with bf as #f disables use of line insertion and deletion. This option should be enabled only if the application needs insert/delete line, for example, for a screen editor. It is disabled by default because insert/delete line tends to be visually annoying when used in applications where it isn’t really needed. If insert/delete line cannot be used, curses redraws the changed portions of all lines.

The return value is unspecified.

Procedure: idcok! win bf

If idcok! is called with bf as #f, curses no longer considers using the hardware insert/delete character feature of terminals so equipped. Use of character insert/delete is enabled by default. Calling idcok! with #t as second argument re-enables use of character insertion and deletion.

The return value is unspecified.

Procedure: immedok! win bf

If immedok! is called with #t as argument, any change in the window image, such as the ones caused by addch, clrtobot, scrl, etc., automatically cause a call to refresh. However, it may degrade performance considerably, due to repeated calls to refresh. It is disabled by default.

The return value is unspecified.

Procedure: leaveok! win bf

Normally, the hardware cursor is left at the location of the window cursor being refreshed. The leaveok! option allows the cursor to be left wherever the update happens to leave it. It is useful for applications where the cursor is not used, since it reduces the need for cursor motions.

Procedure: setscrreg! win top bot

The setscrreg! routine allows the application programmer to set a software scrolling region in a window. top and bot are the line numbers of the top and bottom margin of the scrolling region. (Line 0 is the top line of the window.) If this option and scrollok! are enabled, an attempt to move off the bottom margin line causes all lines in the scrolling region to scroll one line in the direction of the first line. Only the text of the window is scrolled. (Note that this has nothing to do with the use of a physical scrolling region capability in the terminal, like that in the VT100. If idlok! is enabled and the terminal has either a scrolling region or insert/delete line capability, they will probably be used by the output routines.)

Procedure: getscrreg win

Returns a two-element list that contains the line numbers of the top and bottom of the scroll region for the window win.

Procedure: scrollok! win bf

The scrollok! option controls what happens when the cursor of a window is moved off the edge of the window or scrolling region, either as a result of a newline action on the bottom line, or typing the last character of the last line. If disabled, (bf is #f), the cursor is left on the bottom line. If enabled, (bf is #t), the window is scrolled up one line (Note that to get the physical scrolling effect on the terminal, it is also necessary to call idlok!).

The return value is unspecified.

Procedure: nl!
Procedure: nonl!

The nl! and nonl! routines control whether the underlying display device translates RET (return) into NL (newline) on input, and whether it translates NL into RET and LF (linefeed) output (in either case, the call (addch (normal #\nl)) does the equivalent of return and line feed on the virtual screen). Initially, these translations do occur. If you disable them using nonl!, curses will be able to make better use of the line-feed capability, resulting in faster cursor motion. Also, curses will then be able to detect the return key.

The return values are unspecified.

There are a set of procedures to test the output options of a given window.

Procedure: is-cleared? win
Procedure: is-idlok? win
Procedure: is-idcok? win
Procedure: is-immedok? win
Procedure: is-leaveok? win
Procedure: is-scrollok? win

These test the output options of the window win and return #t if they are set.

Next: , Previous: , Up: The basic curses library   [Contents][Index]