SEP
6
2003
|
KJSEmbed support for event handlingKJSEmbed can now handle events. At the moment only mouse events, but the rest will come soon. The example below shows how this can be used in practice. Note that I haven't committed this code yet, so it'll be a couple of days before you can use it. var scribble = new QWidget(); scribble.line=false; scribble.x=0; scribble.y=0; scribble.mousePressEvent = function(ev) { if ( ev.button == 2 ) { this.drawText(ev.x,ev.y,'KJSEmbed!'); } else { x = ev.x; y = ev.y; line=true; } } scribble.mouseReleaseEvent = function(ev) { if ( line ) this.drawLine(x,y,ev.x,ev.y); line = false; } scribble.show();
|
![]() |
Comments
Now in CVS
This code is now in CVS, There are two example files in kjsembed/docs/examples/eventhandling/