You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdebindings/kjsembed/docs/examples/eventhandling/mousetrack.js

22 lines
314 B

#!/usr/bin/env kjscmd
//
// The standard 'scribble' application coded using kjsembed
//
var mousetrack = new QWidget(this);
mousetrack.setMouseTracking(true);
x=0;
y=0;
mousetrack.mouseMoveEvent = function(ev)
{
this.drawLine(x,y,ev.x,ev.y);
x = ev.x;
y = ev.y;
}
mousetrack.show();
application.exec();