ChinaUnix.net
相关文章推荐:

curses 颜色

简介:在有颜色机制的终端中,可以利用curses库中提供的几个关于颜色的例程编写有彩色的用户界面,而不必每天对着黑底白字。 一、包含curses库及编译时连接curses库 在源程序中应含有下列语句: # include <curses.h>; 在编译时,命令行中至少应有下列连接: # cc -ofile file.c -lcurses 这样在编译时就不会提示找不到定义或说明了。 二、下面就介绍几个curses库中关于彩色机制的库例程 操纵彩色字符终端颜色的例...

by unixsystem - C/C++ - 2015-10-06 14:23:07 阅读(2303) 回复(3)

相关讨论

那位前辈用过,谢了

by hiwork - Perl - 2012-04-17 21:39:47 阅读(1107) 回复(0)

联机文档中没有查到有哪个函数能设置窗口的背景颜色,请问有那位高手知道的吗?不胜感激

by iamyu10 - Linux环境编程 - 2008-06-02 17:42:13 阅读(2327) 回复(0)

[code] #include <curses.h>; main() { initscr(); refresh(); /*start_color();*/ init_pair(100,COLOR_WHITE,COLOR_BLUE); attron(COLOR_PAIR(100)); mvprintw(10,20,"This is a test"); attroff(COLOR_PAIR(100)); refresh(); /*getch();*/ endwin(); } [/code] 去掉程序中的注释也无法显示颜色,望高手指教,redhat8.0

by lnux - C/C++ - 2003-08-02 15:42:48 阅读(727) 回复(1)

相信您在网路上一定用过如 tin,elm 等工具, 这些软体有项共同的特色, 即他们能利用上下左右等方向键来控制游标的位置. 除此之外, 这些程式 的画面也较为美观. 对 Programming 有兴趣的朋友一定对此感到好奇, 也 许他能在 PC 上用 Turbo C 轻易地写出类似的程式, 然而, 但当他将相同 的程式一字不变地移到工作站上来编译时, 却出现一堆抓也抓不完的错误. 其实, 原因很简单, 他使用的函式库可能在 UNIX ...

by w1_xiao - SCO文档中心 - 2009-08-15 16:58:05 阅读(1805) 回复(0)

curses的菜单中 ,可以驱动enter键吗,有关于enter键的驱动吗?(使它像在windows中那样工作)

by cinuxer - 其他UNIX - 2005-10-21 17:33:05 阅读(1381) 回复(1)

curses是什么东西阿?

by linpeng - C/C++ - 2004-03-29 20:42:51 阅读(800) 回复(2)

#include <curses.h>; WINDOW *msgbox; struct pop_struc { char *name; char *msg; int (*fun)(); int select_id; }; int submenu(int y, int x); int pop_up(struct pop_struc pop_menu[],int y, int x); main() { struct pop_struc pop_menu[6]={ /* *name *msg (*fun)() select_id */ " 排 序 ", " 按照一定方式排序! ", submenu, 0,...

by null - 其他UNIX - 2003-03-27 23:23:37 阅读(841) 回复(3)

suse linux在用curses 和menu 编制菜单时,菜单项只能用英文不能用中文,不知是何因,是不是MENU不支持中文? 在纯英文菜单下光标能在"Choice1", "Choice2", "Choice3", "Choice4", "Exit",之间移动, 而将"Choice3"改为“选择3”则只能在"Choice1", "Choice2",也不显示后面的菜单(能在第8行显示“退出”)。原代码如下 : #include <curses.h> #include #include #include #define ARRAY_SIZE(a...

by tian365365 - Linux环境编程 - 2014-10-06 10:46:31 阅读(658) 回复(0)

windows上没有这个模块 file模块的功能可以替带他吧? 我没看过curses不过不知道他有哪些功能。

by zhenglxd - Python - 2009-03-09 09:39:33 阅读(1323) 回复(0)

#include #include #include <curses.h> void algorithm(void) { system("./b"); } int main(void) { char *name; initscr(); move(5, 15); printw("%s", "Algorithm:"); /* system("./b");*/ move(6,15); getstr(name); if (*name == 'a') algorithm(); else printw("%s","algorithm error"); refresh(); sleep(2); endwin(); exit(EXIT_SUCCESS); } error: Segmenta...

by bsd_lite - C/C++ - 2008-12-21 22:20:08 阅读(1317) 回复(4)