seteventhandler - set an event handler for the current graphic window
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
ibut is 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