From: Erik Terpstra Date: 2004-04-22T01:09:06+09:00 Subject: Re: Drag an URL from mozilla location bar, drop on a Ruby program? Cool, thanks a lot! Masao Mutoh wrote: > Here is a sample for Ruby/GTK2. > > ---------------- > require 'gtk2' > > Gtk.init > > label = Gtk::Label.new("Drop Here") > Gtk::Drag.dest_set(label, Gtk::Drag::DEST_DEFAULT_ALL, > [["text/plain", 0, 0]], > Gdk::DragContext::ACTION_COPY| Gdk::DragContext::ACTION_MOVE) > > label.signal_connect("drag_data_received") do |w, context, x, y, data, info, time| > p data.data #You can get the URL from mozilla. > Gtk::Drag.finish(context, true, false, 0) > end > > Gtk::Window.new.add(label).set_default_size(100, 100).show_all > > Gtk.main > ---------------- >