新闻资讯
看你所看,想你所想

subwin

subwin

subwin的函式原型WINDOW *subwin(WINDOW *orig, int nlines, int ncols, int begin_y, int begin_x)。

基本介绍

  • 外文名:subwin
  • 头档案:#include <curses.h>
  • 类型:函式
  • 用途:计算

头档案

#include <curses.h>

说明

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.

範例

#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();
}

转载请注明出处海之美文 » subwin

相关推荐

    声明:此文信息来源于网络,登载此文只为提供信息参考,并不用于任何商业目的。如有侵权,请及时联系我们:ailianmeng11@163.com