How to prevent a Gtk.SourceView from grabbing the URI of a file

Posted by laboleite on Ask Ubuntu See other posts from Ask Ubuntu or by laboleite
Published on 2011-11-19T23:10:24Z Indexed on 2011/11/20 2:17 UTC
Read the original article Hit count: 238

Filed under:

I'm making a text editor using GTK3 in Vala. I need to drag a file and, when I drop it into the application window, the application opens that file. I'm using a Gtk.Notebook that contains the Gtk.SourceView's. It works when I drop a file into an empty Gtk.Notebook, but when there is at least one Gtk.SourceView's appended on it, the SourceView grab the URI of the file, shows it and the window can't handle the opening of the file.

In this case, what can I do to prevent a Gtk.SourceView from grabbing the uri of a file when I drop a file into a Gtk.SourceView.

PS: I tried to use the drag_dest_unset() inside the SourceView derived class. It worked, the SourceView didn't grab the URI and the window could open the file, but the application showed a message like this, in runtime:

Gtk-WARNING **: Can't set a target list on a widget until you've called gtk_drag_dest_set() to make the widget into a drag destination

© Ask Ubuntu or respective owner

Related posts about gtk