summaryrefslogtreecommitdiffstats
path: root/kjsembed/docs/examples/eventhandling/mousetrack.js
blob: 0bf427c823622db4cd4b05f179e1e926395d6169 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env kjscmd

//
// The standard 'scribble' application coded using kjsembed
//


var mousetrack = new TQWidget(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();