Scilab Reference Manual |
---|
seteventhandler — set an event handler for the current graphic window
seteventhandler(sfun_name) seteventhandler('')
sfun_name | : a character string. The name of the Scilab function which is intended to handle the events |
The function allows the user to set a particular event handler for the current graphic window. seteventhandler('') removes the handler.
The event handler is defined by a Scilab function whose calling sequence must be function sfun_name(win,x,y,ibut), where
win represents the number of the window where the event had occured. | |||||||||||||||||||||
x,y are the coordinates of the pointer (in pixels), when the event has occured | |||||||||||||||||||||
ibutis the event type:
|
function my_eventhandler(win,x,y,ibut) if ibut==-1 then [x,y]=xchange(x,y,'i2f') xinfo('Mouse position is ('+string(x)+','+string(y)+')') end endfunction plot2d() seteventhandler('my_eventhandler') //now move the mouse over the graphic window/ seteventhandler('') //suppress the event handler
<< keyboard | setmenu >> |