Generated Object

javafx.event.EventHandler

Attributes

onEvent either a Groovy closure or a javafx.event.EventHandler<MouseEvent>, see javafx.event.EventHandler and javafx.scene.input.MouseEvent. The closure takes a MouseEvent object as its argument.

Content

None

Usage

Used to pass mouse clicked events to a javafx node.

Examples

circle ( centerX: 50, centerY: 50, radius: 25,
                fill: rgb(0,0,255), onMousePressed: {println 'mouse clicked event'})



circle (centerX: 100, centerY: 50, radius: 25, fill: red) {
    onMousePressed(onEvent: { println 'mouse clicked event'})
}



rectangle(x:50,y:50,width:200,height:200) {
    onMouseClicked() {
      println 'mouse clicked event'
    }
}
 
!Update on 05/05/2012
!Usage for latest groovyfx checkout:
rectangle(x:50,y:50,width:200,height:200) {
    onMouseClicked() {
      println 'mouse clicked event'
    }
}