六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 26|回复: 0

Event processing in SWT

[复制链接]

升级  58%

7

主题

7

主题

7

主题

童生

Rank: 1

积分
29
 楼主| 发表于 2013-1-28 19:17:47 | 显示全部楼层 |阅读模式
 
The SWT event-processing cycle is depicted in figure4.1. It begins with the operating system’s event queue, which records and lists actions taken by the user. Once an  SWT application begins running, its  Display class sorts through this queue using its readAndDispatch() method and msg field, which acts as a handle to the underlying OS message queue. If it finds anything relevant, it sends the event to its top-level  Shell object, which determines which widget should receive the event. The Shell then sends the event to the widget that the user acted on, whichtransfers this information to an associated interface called a listener. One of the listener’s methods performs the necessary processing or invokes another method to handle the user’s action, called an event handler.


<img alt="">


When making a widget responsive to events, the main tasks of the GUI designerare determining which events need to be acted on, creating and associating listeners to sense these events, and then building event handlers to perform the necessary processing.
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表