
class ScrolledWindow : Gtk.ScrolledWindow {
    Gtk.DrawingArea canvas = new Gtk.DrawingArea();
    
    public ScrolledWindow(int height) {
        canvas.set_size_request(500, height);
        
        canvas.add_events(Gdk.EventMask.POINTER_MOTION_MASK 
            | Gdk.EventMask.POINTER_MOTION_HINT_MASK
            | Gdk.EventMask.BUTTON_MOTION_MASK 
            | Gdk.EventMask.BUTTON_PRESS_MASK
            | Gdk.EventMask.BUTTON_RELEASE_MASK);

        canvas.motion_notify_event += on_motion;
        
        add_with_viewport(canvas);
    }
    
    private bool on_motion(Gdk.EventMotion event) {
        debug("motion: hint=%d x=%lf (%X) y=%lf (%X)", (int) event.is_hint, event.x, (int) event.x, 
            event.y, (int) event.y);
        
        return false;
    }
}

void main(string[] args) {
    Gtk.init(ref args);
    
    Gtk.Window main_window = new Gtk.Window(Gtk.WindowType.TOPLEVEL);
    main_window.destroy += Gtk.main_quit;
    main_window.set_default_size(640, 480);
    main_window.add(new ScrolledWindow(0x7FFF));
    main_window.show_all();
    
    Gtk.main();
}

