https://github.com/virtuald/pygi-treeview-dnd
A library that allows using the high level drag and drop API in PyGObject
https://github.com/virtuald/pygi-treeview-dnd
Last synced: about 1 month ago
JSON representation
A library that allows using the high level drag and drop API in PyGObject
- Host: GitHub
- URL: https://github.com/virtuald/pygi-treeview-dnd
- Owner: virtuald
- License: lgpl-2.1
- Created: 2016-08-16T02:37:14.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-06-24T02:04:55.000Z (almost 8 years ago)
- Last Synced: 2025-09-21T21:01:13.827Z (9 months ago)
- Language: Python
- Size: 15.6 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
pygi-treeview-dnd
=================
GTK+ provides a `high-level DnD API `_
that makes implementing drag and drop on TreeView objects (lists, trees, etc)
significantly easier, and far less error prone. There are hundreds of lines of
code in GTK to implement this -- so
Unfortunately, there's a longstanding bug in PyGObject that prevents python
programs from using this API. `See the bug report for details `,
but basically the SelectionData in drag_data_get is a copy instead of the exact
same SelectionData object, and GTK expects you to modify the original object.
This is a workaround that uses some metaclass magic, GTK internals, and ctypes
to patch up custom TreeStore/ListStore objects. It seems to work, and I plan
on using it extensively in Exaile. If it doesn't work well or if there are
issues, then I'll post a note on github.
Ideally, one day PyGObject will have a fix for this issue, and this package
will no longer be necessary.
Installation
============
This project is easily installed via pip:
pip install pygi-treeview-dnd
Requirements
============
* GTK+ 3.x and PyGObject 3.x
* Currently only tested on Linux, GTK+ 3.20, and Python 2.7
Usage
=====
See `examples` on the github repo for simple examples.
Author
======
Dustin Spicuzza (dustin@virtualroadside.com)
License
=======
LGPL 2.1+ (Same as PyGI)