rendered paste bodyimport org.gnu.gdk.EventMask;
import org.gnu.gtk.Gtk;
import org.gnu.gtk.Window;
import org.gnu.gtk.WindowType;
import org.gnu.gtk.event.MouseMotionEvent;
import org.gnu.gtk.event.MouseMotionListener;
public class MouseMotionTest {
/**
* @param args
*/
public static void main(String[] args) {
Gtk.init(args);
Window win = new Window(WindowType.TOPLEVEL);
win.setMinimumSize(640,480);
// TextView view = new TextView();
// win.add(view);
win.addEvents(EventMask.POINTER_MOTION_MASK);
// view.addEvents(EventMask.POINTER_MOTION_MASK);
win.addListener(new MouseMotionListener() {
public boolean mouseMotionEvent(MouseMotionEvent arg0) {
System.out.println("Move-y! ("+arg0.getX()+","+arg0.getY()+")");
return false;
}
});
win.showAll();
Gtk.main();
}
}