After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 680640 - Inconsistent drag and drop API Treeview versus Widget
Inconsistent drag and drop API Treeview versus Widget
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gobject
3.3.x
Other Linux
: Normal normal
: GNOME 3.8
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2012-07-26 09:51 UTC by Benny Malengier
Modified: 2013-02-19 11:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
overrides: Fix inconsistencies with drag and drop target list API (5.47 KB, patch)
2013-02-18 09:51 UTC, Simon Feltman
committed Details | Review

Description Benny Malengier 2012-07-26 09:51:18 UTC
For widgets, one must pass TargetEntry for drag and drop, while for TreeView, there is an override, so one needs to pass lists of tuple (string, flag, info).

This is inconsistent.
See http://git.gnome.org/browse/pygobject/tree/gi/overrides/Gtk.py 
where TreeView has:

    def enable_model_drag_source(self, start_button_mask, targets, actions):
        target_entries = self._construct_target_list(targets)

requiring here that targets are lists of tuples.

Suggestion: allow in _construct_target_list that TargetEntry's are passed, only convert is list for backward compat.
Comment 1 Simon Feltman 2013-02-18 09:51:02 UTC
Created attachment 236569 [details] [review]
overrides: Fix inconsistencies with drag and drop target list API

Add support to Gtk.Widget.drag_dest_set_target_list and
Gtk.Widget.drag_source_set_target_list to accept iterables containing
mixed TargetEntry or a tuple of (target, flags, info).
Add support to Gtk.TreeView.enable_model_drag_source and
Gtk.TreeView.enable_model_drag_dest to accept a list of Gtk.TargetEntry
items.
Comment 2 Martin Pitt 2013-02-19 11:07:27 UTC
Comment on attachment 236569 [details] [review]
overrides: Fix inconsistencies with drag and drop target list API

Looks good, please push.
Comment 3 Simon Feltman 2013-02-19 11:09:35 UTC
Attachment 236569 [details] pushed as 840c871 - overrides: Fix inconsistencies with drag and drop target list API