1derwin(3XCURSES)        X/Open Curses Library Functions       derwin(3XCURSES)
2
3
4

NAME

6       derwin, newwin, subwin - create a new window or subwindow
7

SYNOPSIS

9       cc [ flag... ] file... -I /usr/xpg4/include  -L  /usr/xpg4/lib \
10        -R  /usr/xpg4/lib  -lcurses  [ library... ]
11
12       c89 [ flag... ] file... -lcurses [ library... ]
13
14       #include <curses.h>
15
16       WINDOW *derwin(WINDOW *orig, int nlines, int ncols,
17            int begin_y, int begin_x);
18
19
20       WINDOW *newwin(int nlines, int ncols, int begin_y, int begin_x);
21
22
23       WINDOW *subwin(WINDOW *orig, int nlines, int ncols, int begin_y,
24            int begin_x);
25
26

DESCRIPTION

28       The derwin() function creates a subwindow within window orig,  with the
29       specified number of lines and columns, and  upper  left  corner   posi‐
30       tioned  at  begin_x, begin_y relative to window orig.  A pointer to the
31       new window structure is returned.
32
33
34       The newwin() function creates a new window with the specified number of
35       lines  and  columns  and  upper  left  corner  positioned  at  begin_x,
36       begin_y.  A pointer to the new window structure is returned.   A  full-
37       screen window can be created by calling newwin(0,0,0,0).
38
39
40       If the number of lines specified is zero, newwin() uses a default value
41       of LINES minus begin_y; if the number of columns  specified  is   zero,
42       newwin() uses the default value of COLS minus begin_x.
43
44
45       The  subwin() function creates a subwindow within window orig, with the
46       specified number of lines and columns, and upper left corner positioned
47       at  begin_x,  begin_y  (relative  to the physical screen, not to window
48       orig). A pointer to the new window structure is returned.
49
50
51       The original window and subwindow share character storage of the  over‐
52       lapping  area (each window maintains its own pointers, cursor location,
53       and other items). This means that characters and attributes are identi‐
54       cal  in  overlapping  areas  regardless  of which window characters are
55       written to.
56
57
58       When using subwindows, it is often necessary to call touchwin(3XCURSES)
59       before wrefresh(3XCURSES) to maintain proper screen contents.
60

PARAMETERS

62       orig       Is a pointer to the parent window for the newly created sub‐
63                  window.
64
65
66       nlines     Is the number of lines in the subwindow.
67
68
69       ncols      Is the number of columns in the subwindow.
70
71
72       begin_y    Is the y (row) coordinate of the upper left  corner  of  the
73                  subwindow, relative  to the parent window.
74
75
76       begin_x    Is the x (column) coordinate of the upper left corner of the
77                  subwindow, relative to the parent window.
78
79

RETURN VALUES

81       On success, these functions return a pointer to the newly-created  win‐
82       dow. Otherwise, they return ERR.
83

ERRORS

85       None.
86

ATTRIBUTES

88       See attributes(5) for descriptions of the following attributes:
89
90
91
92
93       ┌─────────────────────────────┬─────────────────────────────┐
94       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
95       ├─────────────────────────────┼─────────────────────────────┤
96       │Interface Stability          │Standard                     │
97       ├─────────────────────────────┼─────────────────────────────┤
98       │MT-Level                     │Unsafe                       │
99       └─────────────────────────────┴─────────────────────────────┘
100

SEE ALSO

102       doupdate(3XCURSES),    is_linetouched(3XCURSES),   libcurses(3XCURSES),
103       attributes(5), standards(5)
104
105
106
107SunOS 5.11                        5 Jun 2002                  derwin(3XCURSES)
Impressum