3 curses库窗口(WINDOW)处
短信预约 -IT技能 免费直播动态提醒
3 curses库窗口(WINDOW)处理
~~~~~~~~~~~~~~~~~~~~~~~~~~~
3.1 什么是窗口
===============
* 窗口是屏幕上的一块区域,在其上面可以进行各种输出及其操作.
* 窗口可以位于标准屏幕的任意位置,窗口之间可以相互重叠.
* 窗口可以同时包含与它们相关的子窗口,任何在父窗口与子窗口重叠区域的变化会同时影响到他们中的任何一个
3.2 窗口操作
=============
3.2.1 创建和删除窗口
---------------------
WINDOW* newwin(int lines,int cols,int begin_x,int begin_y);
int delwin(WINDOW* win);
WINDOW* subwin(WINDOW* win,int lines,int cols,int begin_x,int begin_y);
WINDOW* derwin(WINDOW* win,int lines,int cols,int begin_x,int begin_y);
3.2.2 在窗口进行输入和输出
---------------------------
int wmove(WINDOW* win,int x,int y);
int waddch(WINDOW* win,int ch);
int mvwaddch(WINDOW* win,x,y,ch);
int waddstr(WINDOW* win,char* str);
int mvwaddstr(WINDOW* win,int x,int y,char* str);
int wprintw(WINDOW* win,char* fmt[,arg...]);
int wgetch(WINDOW* win);
int mvwgetch(WINDOW* win,int x,int y);
int wgetstr(WINDOW* win);
int mvwgetstr(WINDOW* win,int x,int y,char* str);
int wscanw(WINDOW* win,char* fmt[,args...]);
int mvwscanw(WINDOW* win,int x,int y,char* fmt[,args...]);
int winsch(WINDOW* win,int ch);
int mvwinsch(WINDOW* win,int x,int y,int ch);
int winsertln(WINDOW* win,int x,int y);
int wdelch(WINDOW* win);
int mvwdelch(WINDOW* win,int x,int y);
int wdeleteln(WINDOW* win);
int wclear(WINDOW* win);
int werase(WINDOW* win);
int wclrtoeol(WINDOW* win);
int wclrtobot(WINDOW* win);
int wstandout(WINDOW* win);
int wstandend(WINDOW* win);
int wattrset(WINDOW* win,chtype atr);
int wattroff(WINDOW* win,chtype atr);
int wattron(WINDOW* win,chtype atr);
int overlay(WINDOW* class="lazy" data-srcwin,WINDOW* dstwin);
int overwrite(WINDOW* class="lazy" data-srcwin,WINDOW* dstwin);
int copywin(WINDOW* scrwin,WINDOW* dstwin,int class="lazy" data-srciminrow,int class="lazy" data-srcmincol,int dstminrow,int dstmincol,int dstmaxrow,int dstmaxcol,int overlayFlag);
3.2.3 窗口刷新
---------------
int wnoutrefresh(WINDOW* win);
int doupdate(WINDOW* win);
int wrefresh(WINDOW* win);
int redrawwin(WINDOW* win);
int wredrawln(WINDOW* win,int beg_line,int num_lines);
3.2.4 窗口其他属性操作
-----------------------
int mvwin(WINDOW* win,int x,inty);
void touchwin(WINDOW* win);
int box(WINDOW* win,chtype vert,chtype hort);
int border(WINDOW* win,chtype ls,chtype,rs,chtype ts,chtype bs,chtype tl,chtype tr,chtype bl,chtype br);
int hline(chtype ch,int n);
int vline(chtype ch,int n);
int whline(WINDOW* win,chtype ch,int n);
int wvline(WINDOW* win,chtype ch,int n);
void leaveok(WINDOW* win,bool state);
void scrollok(WINDOW* win,bool state);
void clearok(WINDOW* win,bool state);
3.2.5 屏幕的转存
-----------------
int putwin(WINDOW* win,FILE* fp);
WINDOW* getwin(FILE* fp);
int scr_dump(const char* filename);
int class="lazy" data-src_restore(const char* filename);
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341