Results 1 to 4 of 4

Thread: Drag file onto program to load (Vala/GTK)

  1. #1
    Join Date
    Apr 2008
    Beans
    317
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Drag file onto program to load (Vala/GTK)

    I have the following code:
    Code:
    this.connect("drag_motion", this.motionDrag);
    this.connect("drag_drop", this.dropDrag);
    this.connect("drag_data_received", this.gotDrag);
    It gives me the following run-time errors:
    Code:
    (reader:9573): GLib-GObject-WARNING **: IA__g_object_connect: invalid signal spec "Gdk.drag_motion"
    
    (reader:9573): GLib-GObject-WARNING **: IA__g_object_connect: invalid signal spec "Gdk.drag_drop"
    
    (reader:9573): GLib-GObject-WARNING **: IA__g_object_connect: invalid signal spec "Gdk.drag_data_received"
    What are the real names for such as "drag_drop" in Vala? I got the names from Gtk in Python, but apparently they don't work. I couldn't find the Vala equivalents.

  2. #2
    Join Date
    May 2007
    Location
    Toronto, Canada
    Beans
    4,508
    Distro
    Ubuntu

  3. #3
    Join Date
    Apr 2008
    Beans
    317
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Re: Drag file onto program to load (Vala/GTK)

    Quote Originally Posted by Vadi View Post
    Hm, it is there: http://references.valadoc.org/gtk+-2...drag_drop.html

    Try using "drag-drop" as a name.
    Using hyphens doesn't seem to work. I don't know why, but it has to be a string, too (so I don't think I can reference a widget to get the value). Is there another method that would work without a string there? Is there a way to find the exact value names it's looking for?
    Last edited by kumoshk; December 1st, 2009 at 08:30 PM.

  4. #4
    Join Date
    Apr 2008
    Beans
    317
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Re: Drag file onto program to load (Vala/GTK)

    If there's another solution to what I want to do, feel free to let me know.

    All I need to happen is have my program load a file (from Nautilus or whatever) if it's dragged into it (while open—it would be nice if I could get it to do it while not open, as well: as it stands it'll only do it from the command-line).

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •