w = New Window( "Mouse Messages", // modified from scripting index setClick
Border Box( Left( 20 ), Right( 20 ), top( 20 ), bottom( 20 ),
MouseBox( /* <<<<<<<< handler for mouse events */
window:tb = Text Box( "click me!", <<setFontSize( 48 ), <<setwrap( 999 ) ), /* <<<<<< child box does not receive the mouse events */
<<setClickEnable( 1 ),
<<setClick( /* button-down, move, button-release handler */
// the Ticked event happens frequently, and makes it hard to see the Pressed event, so ignore it...
Function( {this, clickpt, event}, /*Is Alt Key(),Is Control Key(),Is Shift Key() should be captured on "Pressed" */
If( event != "Ticked",
window:tb << settext( event || Char( clickpt ) );
)
)
)
)
);
);
You might want to ignore Moved as well as Ticked.
MouseBox<<setClick example in the scripting index is one of the Three JSL Easter Eggs
Craige