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
_______________________________________________
vala-list mailing list
vala...@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list
> 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);
> }
>
Unlike in C, in Vala Gdk.Event is a class and Gdk.EventMotion is a struct.
You might check this thread for a user who had a similar issue:
http://www.mail-archive.com/vala...@gnome.org/msg08105.html
- Eric
private bool on_motion_notify (Gdk.EventMotion evt) {
Gdk.Event* real_e = (Gdk.Event*)(&evt);
Gtk.drag_begin (this,
target_list,
Gdk.DragAction.COPY
| Gdk.DragAction.MOVE
| Gdk.DragAction.LINK,
1,
(Gdk.Event) evt);
}
I tried all sort of things, like Gdk.Event? event = (Gdk.Event*) evt;
but none worked.
Thanks again. :-)