ncurses programming howto 书中源代码
来源:互联网 发布:php学徒 编辑:程序博客网 时间:2024/06/03 20:57
/* * ===================================================================================== * * Filename: 10_1.c * * Description: color * * Version: 1.0 * Created: 2010年9月
* Revision: none * Compiler: gcc * * Author: cdutyangshaokun@163.com * Company: College of Information Engineering of CDUT * * ===================================================================================== */
#include<ncurses.h>
#include<string.h>
#include<stdlib.h>
void print_in_middle(WINDOW *win,int starty,int startx,int width,char *string);
int main(int argc,char *argv[])
{
initscr();
if(has_colors()==FALSE)
{
endwin();
printf("you terminal does not support color/n");
exit(1);
}
start_color();
init_pair(1,COLOR_RED,COLOR_BLACK);
attron(COLOR_PAIR(1));
print_in_middle(stdscr,LINES/2,0,0,"YSKCG,yskcg...");
attroff(COLOR_PAIR(1));
getch();
endwin();
}
void print_in_middle(WINDOW *win,int starty,int startx,int width,char*string)
{
int length,x,y;
float temp;
if(win==NULL)
win=stdscr;
getyx(win,y,x);
if(startx!=0)
x=startx;
if(starty!=0)
y=starty;
if(width==0)
width=80;
length=strlen(string);
temp=(width-length)/2;
x=startx+(int)temp;
mvwprintw(win,y,x,"%s",string);
refresh();
}
- ncurses programming howto 书中源代码
- ncurses programming howto 书中源代码-1
- ncurses programming howto 书中源代码-3
- ncurses programming howto 书中源代码-2
- ncurses programming howto 书中源代码-4
- ncurses programming howto 书中源代码-5
- ncurses programming howto 书中源代码-6
- ncurses programming howto 书中源代码-6
- 第二章:从Hello World 程序开始——(NCURSES Programming HOWTO中文版
- Serial Programming HOWTO
- Serial Programming HOWTO
- Serial Programming HOWTO(串口编程HOWTO)
- Serial Programming HOWTO——Linux 串口编程HOWTO
- Linux Serial Programming HOWTO - 串口通讯编程
- Linux Serial Programming HOWTO - 串口通讯编
- linux 中ncurses 中文乱码
- Linux中交叉编译ncurses
- Cygwin中使用ncurses库
- 垂直二级导航菜单用div+CSS架构实例
- Android 自定义控件 单页翻书控件
- 有些事
- linux 下生成动态链接库
- 修改IIS连接数
- ncurses programming howto 书中源代码
- SQLServer的注册表项使用技巧六则
- ncurses programming howto 书中源代码-1
- 技术总监谈好的程序员如何写代码
- ncurses programming howto 书中源代码-3
- ncurses programming howto 书中源代码-2
- ncurses programming howto 书中源代码-4
- 初识PHP的MVC架构
- ncurses programming howto 书中源代码-5