"Fossies" - the Fresh Open Source Software archive

Member "jacl1.4.1/docs/TclJava/JavaEventParameters.html" (25 Jan 2000, 986 Bytes) of archive /linux/misc/jacl1.4.1.tar.gz:

Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. Alternatively you can here view or download the uninterpreted source code. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.

Java Event Parameters


An event callback script can query the event parameters using the java::event command. Usually, there is only one event parameter -- the event object, which stores various information about the event as its properties. For example, when the mouseClicked event occurs inside an AWT Button, the x and y properties of the event object contains the location of the mouse cursor. The following script prints out the location of the mouse cursor:


package require java

set f [java::new java.awt.Frame]
$f setSize 100 100
$f show

java::bind $f mouseClicked {
    puts "mouse click at ([java::event x],[java::event y])"

Copyright © 1997-1998 Sun Microsystems, Inc.