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



Thanks a lot, it works just fine :-)

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. :-)



On 28/03/2012 23:51, Eric Gregory wrote:

On Wed, Mar 28, 2012 at 2:38 PM, Axel FILMORE <axel filmore gmail com <mailto:axel filmore gmail com>> wrote:

    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-list gnome org/msg08105.html

 - Eric


--
Axel FILMORE




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