[Vala] cannot convert to a pointer type error when passing Gdk.MotionEvent



Hi there,

I can't get the following code to compile with Vala :

private bool on_motion_notify (Gdk.EventMotion evt) {
                    Gtk.drag_begin (this,
                                    target_list,
                                    Gdk.DragAction.COPY
                                    | Gdk.DragAction.MOVE
                                    | Gdk.DragAction.LINK,
                                    1,
                                    (Gdk.Event) evt);
}

I get the error "cannot convert to a pointer type"

Here's the generated code :

static gboolean desktop_window_on_motion_notify (DesktopWindow* self, GdkEventMotion* evt) {
            GdkEventMotion _tmp19_;
            _tmp19_ = *evt;
gtk_drag_begin ((GtkWidget*) self, _tmp18_, (GDK_ACTION_COPY | GDK_ACTION_MOVE) | GDK_ACTION_LINK, 1, (GdkEvent*) _tmp19_);
}

I should get something like this :
static gboolean desktop_window_on_motion_notify (DesktopWindow* self, GdkEventMotion* evt) {
            GdkEventMotion* _tmp19_;
            _tmp19_ = evt;
gtk_drag_begin ((GtkWidget*) self, _tmp18_, (GDK_ACTION_COPY | GDK_ACTION_MOVE) | GDK_ACTION_LINK, 1, (GdkEvent*) _tmp19_);
}

That seems to be the same issue than reported here :
https://mail.gnome.org/archives/vala-list/2009-August/msg00007.html

Is it something wrong I'm doing ?
Does anybody know a workaround ?

Regards.


--
Axel FILMORE




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]