Chinaunix首页 | 论坛 | 博客
  • 博客访问: 108271
  • 博文数量: 74
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 757
  • 用 户 组: 普通用户
  • 注册时间: 2013-10-20 22:42
个人简介

相信生命中的无限潜能

文章分类

全部博文(74)

文章存档

2016年(1)

2015年(30)

2014年(30)

2013年(13)

我的朋友

分类: C/C++

2014-02-17 15:27:07


  1. #include <curses.h>

  1. int main()
  1. {
  1.     initscr();
  1.     if(has_colors()==TRUE)
  1.     {
  1.         start_color();
  1.         init_pair(1,COLOR_RED,COLOR_WHITE);//前景色 背景色
  1.         init_pair(2,COLOR_YELLOW,COLOR_BLUE);
  1.         bkgd(COLOR_PAIR(1));//终端背景色
  1.     }
  1.     box(stdscr,0,0);//边框

  1.     attron(COLOR_PAIR(1));//开启属性
  1.     mvaddstr(5,10,"I LOVE YOU");
  1.     attroff(COLOR_PAIR(1));//关闭属性

  1.     attron(COLOR_PAIR(2));
  1.     mvaddstr(10,15,"HELLO WORLD");
  1.     attroff(COLOR_PAIR(2));

  1.     mvprintw(15,8,"行:%d,列:%d");

  1.     getch();
  1.     endwin();
  1.     return 0;
  1. }


阅读(574) | 评论(0) | 转发(0) |
0

上一篇:curses

下一篇:输出时间

给主人留下些什么吧!~~