複製鏈接
請複製以下鏈接發送給好友

subwin

鎖定
subwin的函數原型WINDOW *subwin(WINDOW *orig, int nlines, int ncols, int begin_y, int begin_x)。
外文名
subwin
頭文件
#include
類    型
函數
用    途
計算

目錄

subwin頭文件

#include <curses.h>

subwin説明

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 wrefresh() on the subwindow.
Routines that return an integer return the integer ERR upon failure and OK (SVr4 only specifies "an integer value other than ERR") upon successful completion.

subwin範例

#include <ocurses.h>
main()
{
WINDOW *sub;
initscr();
box(stdscr,'w','w');
/* See the curses(3ocurses) manual page for box */
mvwaddstr(stdscr,7,10,"------- this is 10,10");
mvwaddch(stdscr,8,10,'|');
mvwaddch(stdscr,9,10,'v');
sub = subwin(stdscr,10,20,10,10);
box(sub,'s','s');
wnoutrefresh(stdscr);
wrefresh(sub);
endwin();
}