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


5.2.39 Window creation

Procedure: window? win

Returns #t if win is a window, and #f otherwise.

Note that panel windows also return #t.

Procedure: newwin nlines ncols begin-y begin-x #:key panel

Calling newwin creates and returns a pointer to a new window with the given number of lines and columns. The upper left-hand corner of the window is at line begin-y, column begin-x. If either nlines or ncols is zero, they default to (- (lines) begin-y) and (- (cols) begin-x). A new full-screen window is created by calling (newwin 0 0 0 0).

If the optional keyword argument #:panel is #t, the window is created as a panel window, and the panel library functions are used to draw and move the window.

Procedure: delwin win

Calling delwin deletes the named window, freeing all memory associated with it (it does not actually erase the window’s screen image). Subwindows must be deleted before the main window can be deleted.

This function is called implicitly if a window is garbage collected.

Procedure: mvwin win y x

Calling mvwin moves the window so that the upper left-hand corner is at position x, y. If the move would cause the window to be off the screen, it is an error and the window is not moved. Moving subwindows is allowed, but should be avoided.

The return value is unspecified;

Procedure: subwin orig nlines ncols begin-y begin-x #:key panel

Calling subwin creates and returns a pointer to a new window with the given number of lines, nlines, and columns, ncols. The window is at position (begin-y, begin-x) on the screen. (This position is relative to the screen, and not to the window orig.) The window is made in the middle of the window orig, so that changes made to one window will affect both windows. The subwindow shares memory with the window orig. When using this routine, it is necessary to call touchwin or touchline on orig before calling refresh on the subwindow.

If the optional keyword argument #:panel is #t, the window is created as a panel window, and the panel library functions are used to draw and move the window.

Procedure: is-subwin? win

Returns #t if win is a subwin. Otherwise, #f.

If the underlying ncurses implementation is not capable of reporting whether a window is a subwindow, this function will always return #t. This can happen in older versions of ncurses that were compiled with the NCURSES_OPAQUE option enabled.

To see if this is-subwin? procedure actually works, you can check the constant %is-subwin-broken, which will be #f is is-subwin? actually works.

Procedure: derwin orig nlines ncols begin-y begin-x #:key panel

Calling derwin is the same as calling subwin, except that begin-y and begin-x are relative to the origin of the window orig rather than the screen. There is no difference between the subwindows and the derived windows.

If the optional keyword argument #:panel is #t, the window is created as a panel window, and the panel library functions are used to draw and move the window.

It returns a window that shares memory with orig, or #f if the window could not be created.

Procedure: mvderwin win par-y par-x

Calling mvderwin moves a derived window (or subwindow) inside its parent window. The screen-relative parameters of the window are not changed. This routine is used to display different parts of the parent window at the same physical position on the screen.

The return value is unspecified.

Procedure: dupwin win

Calling dupwin returns a new window that is an exact duplicate of the window win.

Procedure: syncup win

Calling syncup touches all locations in ancestors of win that are changed in win. If syncok! is called with second argument #t then syncup is called automatically whenever there is a change in the window.

Procedure: syncok! win bf

If syncok! is called with the second argument #t then syncup is called automatically whenever there is a change in the window.

The return value is unspecified.

Procedure: syncdown win

The syncdown routine touches each location in win that has been touched in any of its ancestor windows. This routine is called by refresh, so it should almost never be necessary to call it manually.

Procedure: cursyncup win

The routine cursyncup updates the current cursor position of all the ancestors of the window to reflect the current cursor position of the window.

The return value is unspecified.


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