接下来,在init方法中添加代码,将鼠标移动处理程序与事件关联起来,然后保存修改。
Next, add into the init method the code to link the mouse movement handler with the event and save all your changes. Your init method should look something like Listing 9.
只要一支手写笔,或者一只鼠标,用户就可以在画布上绘制图片,且这并不需要程序员来跟踪或处理任何事件。
Using a stylus, or alternately a mouse, users can draw on the canvas without the developer needing to directly deal with tracking events.
此事件的处理程序接收鼠标指针所在位置的列索引和行索引。
The handler for this event receives the column index and row index of the mouse pointer position.
打开代码编辑器,将鼠标指针定位到新创建的默认事件处理程序内。
The Code Editor opens and the mouse pointer is located inside the newly created default event handler.
下面的示例创建一个鼠标按钮事件处理程序,该处理程序用于更改引发事件的对象的颜色。
The following example creates a mouse button event handler that changes the color of the object that raised the event.
下面的示例创建一个鼠标按钮事件处理程序,该处理程序用于更改引发事件的对象的颜色。
The following example creates a mouse button event handler that changes the color of the object that raised the event.
应用推荐