ncurses programming howto 书中源代码-4

/*
 * =====================================================================================
 *
 *       Filename:  16_2.c
 *
 *    Description:  panel
 *
 *        Version:  1.0
 *        Created:  2010骞?9鏈?7鏃?16鏃?7鍒?9绉? *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Yang Shao Kun (), cdutyangshaokun@163.com
 *        Company:  College of Information Engineering of CDUT
 *
 * =====================================================================================
 */

#include<panel.h>
int main()
{
    WINDOW *my_wins[3];
    PANEL *my_panels[3];
    int lines=10,cols=40,y=2,x=4,i;
   
    initscr();
    cbreak();
    noecho();
    my_wins[0]=newwin(lines,cols,y,x);
    my_wins[1]=newwin(lines,cols,y+1,x+5);
    my_wins[2]=newwin(lines,cols,y+2,x+10);

    for(i=0;i<3;++i)
        box(my_wins[i],0,0);

    my_panels[0]=new_panel(my_wins[0]);
    my_panels[1]=new_panel(my_wins[1]);
    my_panels[2]=new_panel(my_wins[2]);
    update_panels();
    doupdate();
    getch();
    endwin();
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值