免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1247 | 回复: 0
打印 上一主题 下一主题

curses中的panel [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-02-27 22:04 |只看该作者 |倒序浏览
为什么隐藏面板的时候,其中的多个窗体只能隐藏其中一个?很郁闷,代码如下:
#include <curses.h>
#include <panel.h>
#include <stdio.h>
#include <stdlib.h>

main()
{

    WINDOW *wins[5];
    PANEL  *panels[2];
    PANEL  *top;
    int ch;

    initscr();//初始化curses库
    noecho();
    keypad(stdscr,TRUE);
    box(stdscr,'┃','━');
    refresh();

    wins[0] = newwin(3,76,2,2);
    wins[1] = newwin(17,32,5,2);
    wins[2] = newwin(17,35,5,37);
    wins[3] = newwin(10,40,8,20);
    wins[4] = newwin(10,10,2,2);
    box(wins[0],'┃','━');
    box(wins[1],'┃','━');
    box(wins[2],'┃','━');
    box(wins[3],'!','#');
    box(wins[4],'!','#');



    panels[0] = new_panel(wins[0]);
    panels[0] = new_panel(wins[1]);
    panels[1] = new_panel(wins[3]);
    top = panels[0];
    top_panel(top);
    update_panels();
    doupdate();

   while (ch = getch())
    {
        switch(ch)
        {
            case KEY_LEFT:
               top = panels[1];
               top_panel(panels[1]);
               //hide_panel(panels[0]);
               break;
        }

        update_panels();
        doupdate();
    }
   endwin();
}

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP