Next: , Previous: , Up: Curses   [Contents][Index]

5.12.1 Output Options Setting

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

Function: clearok win bf

If enabled (bf is #t), the next call to force-output or refresh with win 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.

Function: idlok win bf

If enabled (bf is #t), curses will consider using the hardware “insert/delete-line” feature of terminals so equipped. If disabled (bf is #f), curses will very seldom use this feature. The “insert/delete-character” feature is always considered. This option should be enabled only if your 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 is not really needed. If “insert/delete-line” cannot be used, curses will redraw the changed portions of all lines.

Function: leaveok win bf

Normally, the hardware cursor is left at the location of the window cursor being refreshed. This 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. If possible, the cursor is made invisible when this option is enabled.

Function: scrollok win bf

This option controls what happens when the cursor of window win is moved off the edge of the window or scrolling region, either from a newline 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 at the location where the offending character was entered. If enabled (bf is #t), force-output is called on the window win, and then the physical terminal and window win are scrolled up one line.

Note in order to get the physical scrolling effect on the terminal, it is also necessary to call idlok.

Function: nodelay win bf

This option causes wgetch to be a non-blocking call. If no input is ready, wgetch will return an eof-object. If disabled, wgetch will hang until a key is pressed.

Next: , Previous: , Up: Curses   [Contents][Index]