免费注册 查看新帖 |

Chinaunix

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

Xlib 按下关闭按钮后,程序走到哪里了??? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-10-17 13:27 |只看该作者 |倒序浏览
XSelectInput(display, win,
                        ExposureMask
                        | KeyPressMask
                        | KeyReleaseMask
                        | ButtonPressMask
                        | ButtonReleaseMask
                        | EnterWindowMask
                        | LeaveWindowMask
                        | FocusChangeMask
                        | PointerMotionMask
                        | ButtonMotionMask
                        | VisibilityChangeMask
                        | StructureNotifyMask);

                //显示窗口
                XMapWindow(display, win);

                //进入事件循环
                while (1)  {

                        //取得队列中的事件
                        XNextEvent(display, &report);
                        switch  (report.type) {

                        //曝光事件, 窗口应重绘
                        case Expose: printf("Expose event\n"; break;


                        //按钮事件
                        case ButtonPress:
                                printf("ButtonPress event\n";break;
                        case ButtonRelease:
                                printf("ButtonRelease event\n"; break;
                        case MotionNotify:
                                printf("MotionNotify event\n"; break;

                        //鼠标指针事件
                        case EnterNotify:
                                printf("EnterNotify event\n"; break;
                        case LeaveNotify:
                                printf("LeaveNotify event\n"; break;

                        //聚焦事件
                        case FocusIn:
                                printf("FocusIn event\n"; break;
                        case FocusOut:
                                printf("FocusOut event\n"; break;

                        //键盘按键事件
                        case KeyPress:
                                printf("KeyPress event\n"; break;
                        case KeyRelease:
                                printf("KeyRelease event\n"; break;


                        //窗口的尺寸改变, 位置移动, 窗口堆栈发生变化,
                        //或边界宽度发生变化
                        case CirculateNotify:
                                printf("CirculateNotify event\n"); break;
                        case ConfigureNotify:
                                printf("ConfigureNotify event\n"); break;

                        //键盘或鼠标的映射发生了变化
                        case MappingNotify:
                                printf("MappingNotify event\n"); break;


                        //选择(Selection)事件, 客户程序间通讯
                        case ClientMessage:
                                printf("ClientMessage event\n"); break;

                        //如果已经调用了XSetSelectionOwner(),可能获得
                        //该事
                        case SelectionClear:
                                printf("SelectionClear event\n"); break;

                        //如果调用了XConvertSelection(), 可能获得该事件
                        case SelectionNotify:
                                printf("SelectionNotify event\n"); break;

                        //如果调用了XSetSelectionOwner(), 可能获得该事件
                        case SelectionRequest:
                                printf("SelectionRequest event\n"); break;

                        //如果调用了XCopyArea()或者XCopyPlane(), 并且
                        //其中的GC的graphics_exposure设置为True, 则产生
                        //该事件
                        case GraphicsExpose:
                        case NoExpose:
                                printf("GraphicsExpose or NoExpose event\n");
                                break;
                        case DestroyNotify:
                                printf("DestroyNotify \n");
                                break;

                       default: printf("Other event\n"); break;

我的问题是:如果按下了窗口又上方的关闭按钮后,为什么没有产生DestroyNotify
事件? 是不是产生了其他什么事件?
我需要知道什么时候被按下了关闭按钮!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP