Features/GTK3/Porting/InfoSlicer: Difference between revisions

Humitos (talk | contribs)
Humitos (talk | contribs)
No edit summary
Line 119: Line 119:
  activity.add_alert(alert)
  activity.add_alert(alert)
  alert.show()
  alert.show()
== Gtk.Widget.drag_source_set() ==
* Python docs: http://python-gtk-3-tutorial.readthedocs.org/en/latest/drag_and_drop.html
* C docs: http://developer.gnome.org/gtk3/3.5/gtk3-Drag-and-Drop.html
In Gtk3 the way to call this function is a bit different. Instead of passing a tuple we should pass a list of Gtk.TargetEntry's. So, we should replace this:
self.imagebox = Gtk.EventBox()
self.imagebox.drag_source_set(Gdk.ModifierType.BUTTON1_MASK, ("text/plain", Gtk.TargetFlags.SAME_APP, 80), Gdk.DragAction.COPY)
by this:
self.imagebox = Gtk.EventBox()
self.imagebox.drag_source_set(
        Gdk.ModifierType.BUTTON1_MASK,
        [Gtk.TargetEntry.new('text/plain', Gtk.TargetFlags.SAME_APP, 80)],
        Gdk.DragAction.COPY)


= Gdk.atom_intern =
= Gdk.atom_intern =
Line 146: Line 164:
* Drag and Drop Images from the Edit View is not working. Line #52 (''infoslicer/widgets/Gallery_View.py'')
* Drag and Drop Images from the Edit View is not working. Line #52 (''infoslicer/widgets/Gallery_View.py'')
** Example about how to use the drag-n-drop http://git.gnome.org/browse/pygobject/tree/demos/gtk-demo/demos/clipboard.py#n96
** Example about how to use the drag-n-drop http://git.gnome.org/browse/pygobject/tree/demos/gtk-demo/demos/clipboard.py#n96
# FIXME
# http://developer.gnome.org/gtk3/3.5/gtk3-Drag-and-Drop.html#gtk-drag-source-set
# self.imagebox.drag_source_set(Gdk.ModifierType.BUTTON1_MASK, ("text/plain", Gtk.TargetFlags.SAME_APP, 80), Gdk.DragAction.COPY)
* After drag-n-drop an arrow is added inside the article (right side) that is being edited. This is not working due: https://bugzilla.gnome.org/show_bug.cgi?id=651962
* After drag-n-drop an arrow is added inside the article (right side) that is being edited. This is not working due: https://bugzilla.gnome.org/show_bug.cgi?id=651962
** Line #641 (''infoslicer/processing/Article.py'')
** Line #641 (''infoslicer/processing/Article.py'')