]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/curs_window.3x
ncurses 6.4 - patch 20230923
[ncurses.git] / man / curs_window.3x
index 5a671c707a8af9c056a8a18d344289755faf561c..931372db1ffe1e2c55c608701d976c2400727e00 100644 (file)
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright 2020-2021,2022 Thomas E. Dickey                                *
+.\" Copyright 2020-2022,2023 Thomas E. Dickey                                *
 .\" Copyright 1998-2015,2016 Free Software Foundation, Inc.                  *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_window.3x,v 1.25 2022/02/12 20:06:41 tom Exp $
-.TH curs_window 3X ""
+.\" $Id: curs_window.3x,v 1.36 2023/09/16 23:37:03 tom Exp $
+.TH curs_window 3X 2023-09-16 "ncurses 6.4" "Library calls"
 .de bP
 .ie n  .IP \(bu 4
 .el    .IP \(bu 2
 ..
-.na
-.hy 0
 .SH NAME
-\fBnewwin\fP,
-\fBdelwin\fP,
-\fBmvwin\fP,
-\fBsubwin\fP,
-\fBderwin\fP,
-\fBmvderwin\fP,
-\fBdupwin\fP,
-\fBwsyncup\fP,
-\fBsyncok\fP,
-\fBwcursyncup\fP,
-\fBwsyncdown\fP \- create \fBcurses\fP windows
-.ad
-.hy
+\fB\%newwin\fP,
+\fB\%delwin\fP,
+\fB\%mvwin\fP,
+\fB\%subwin\fP,
+\fB\%derwin\fP,
+\fB\%mvderwin\fP,
+\fB\%dupwin\fP,
+\fB\%wsyncup\fP,
+\fB\%syncok\fP,
+\fB\%wcursyncup\fP,
+\fB\%wsyncdown\fP \-
+create and manipulate \fIcurses\fR windows
 .SH SYNOPSIS
 \fB#include <curses.h>\fP
 .sp
@@ -79,7 +76,6 @@
 \fBvoid wcursyncup(WINDOW *\fIwin\fB);\fR
 .br
 \fBvoid wsyncdown(WINDOW *\fIwin\fB);\fR
-.br
 .SH DESCRIPTION
 .SS newwin
 Calling \fBnewwin\fP creates and returns a pointer to a new window with the
@@ -125,20 +121,17 @@ wtimeout
 .RE
 .ad
 .SS delwin
-.PP
 Calling \fBdelwin\fP 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.
 .SS mvwin
-.PP
 Calling \fBmvwin\fP moves the window so that the upper left-hand
 corner is at position (\fIx\fP, \fIy\fP).
 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.
 .SS subwin
-.PP
 Calling \fBsubwin\fP creates and returns a pointer to a new window
 with the given number of lines, \fInlines\fP, and columns, \fIncols\fP.
 The window is at position (\fIbegin\fR_\fIy\fP,
@@ -150,7 +143,6 @@ When using this routine, it is necessary to call
 \fBtouchwin\fP or \fBtouchline\fP on \fIorig\fP before calling
 \fBwrefresh\fP on the subwindow.
 .SS derwin
-.PP
 Calling \fBderwin\fP is the same as calling \fBsubwin,\fP except that
 \fIbegin\fR_\fIy\fP and \fIbegin\fR_\fIx\fP are relative to the origin
 of the window \fIorig\fP rather than the screen.
@@ -163,23 +155,19 @@ This routine is used to display different
 parts of the parent window at the same physical position on the
 screen.
 .SS dupwin
-.PP
 Calling \fBdupwin\fP creates an exact duplicate of the window \fIwin\fP.
 .SS wsyncup
-.PP
 Calling \fBwsyncup\fP touches all locations in ancestors of \fIwin\fP that are
 changed in \fIwin\fP.
 If \fBsyncok\fP is called with second argument
 \fBTRUE\fP then \fBwsyncup\fP is called automatically whenever there is a
 change in the window.
 .SS wsyncdown
-.PP
 The \fBwsyncdown\fP routine touches each location in \fIwin\fP that has been
 touched in any of its ancestor windows.
 This routine is called by
 \fBwrefresh\fP, so it should almost never be necessary to call it manually.
 .SS wcursyncup
-.PP
 The routine \fBwcursyncup\fP updates the current cursor position of all the
 ancestors of the window to reflect the current cursor position of the
 window.
@@ -256,8 +244,27 @@ is patterned on the XPG4 curses standard.
 The weaker XPG4 spec may result in slower updates.
 .SH PORTABILITY
 The XSI Curses standard, Issue 4 describes these functions.
+.PP
+X/Open Curses states regarding \fBdelwin\fP:
+.bP
+It must delete subwindows before deleting their parent.
+.bP
+If \fBdelwin\fP is asked to delete a parent window,
+it can only succeed if the curses library keeps a list of the subwindows.
+SVr4 curses kept a count of the number of subwindows rather than a list.
+It simply returned \fBERR\fP when asked to delete a subwindow.
+Solaris X/Open curses does not even make that check,
+and will delete a parent window which still has subwindows.
+.bP
+Since release 4.0 (1996), ncurses maintains a list of windows for each screen,
+to ensure that a window has no subwindows before allowing deletion.
+.bP
+NetBSD copied this feature of ncurses in 2003.
+.br
+PDCurses follows the scheme used in Solaris X/Open curses.
 .SH SEE ALSO
 \fBcurses\fP(3X),
+\fBcurs_initscr\fP(3X),
 \fBcurs_refresh\fP(3X),
 \fBcurs_touch\fP(3X),
 \fBcurs_variables\fP(3X)