diff options
author | Daniel Francis <francis@sugarlabs.org> | 2012-06-19 17:10:04 (GMT) |
---|---|---|
committer | Rafael Ortiz <rafael@activitycentral.com> | 2012-06-19 21:14:31 (GMT) |
commit | bfe14a3fe310a8e68f9da172021dc1977f1d29c9 (patch) | |
tree | aae6795c1819063f8026308a57927df9382512ab | |
parent | a0a949459f3659d2de3d07231d511118fd01c4ec (diff) |
Drag And Drop from Clipboard / Uncomment some lines from Gtk3 Port
The port to GTK3 is finished with this patch.
Solved the drag and drop clipboard utility.
-rw-r--r-- | terminal.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/terminal.py b/terminal.py index 3dc1640..3a5bba5 100644 --- a/terminal.py +++ b/terminal.py @@ -305,7 +305,7 @@ class TerminalActivity(activity.Activity): def __drag_data_received_cb(self, widget, context, x, y, selection, target, time): - widget.feed_child(selection.data) + widget.feed_child(selection.get_text(), -1) context.finish(True, False, time) return True @@ -315,13 +315,14 @@ class TerminalActivity(activity.Activity): vt.connect("window-title-changed", self.__tab_title_changed_cb) # FIXME have to resend motion events to parent, see #1402 - #vt.connect('motion-notify-event', self.__motion_notify_cb) + vt.connect('motion-notify-event', self.__motion_notify_cb) - #vt.drag_dest_set(Gtk.DestDefaults.MOTION | Gtk.DestDefaults.DROP, - # [('text/plain', 0, 0), ('STRING', 0, 1)], - # Gdk.DragAction.DEFAULT | - # Gdk.DragAction.COPY) - #vt.connect('drag_data_received', self.__drag_data_received_cb) + vt.drag_dest_set(Gtk.DestDefaults.MOTION | Gtk.DestDefaults.DROP, + [Gtk.TargetEntry.new('text/plain', 0, 0), + Gtk.TargetEntry.new('STRING', 0, 1)], + Gdk.DragAction.DEFAULT | Gdk.DragAction.COPY) + vt.drag_dest_add_text_targets() + vt.connect('drag_data_received', self.__drag_data_received_cb) self._configure_vt(vt) @@ -396,8 +397,8 @@ class TerminalActivity(activity.Activity): return index -# def __motion_notify_cb(self, widget, event): -# self.emit('motion-notify-event', event) + def __motion_notify_cb(self, widget, event): + self.emit('motion-notify-event', Gdk.Event(event)) def __become_root_cb(self, button): vt = self._notebook.get_nth_page(self._notebook.get_current_page()).vt |