Register a "drop hook" with the new trees object. A drop hook is triggered when a specific mime type is dropped into the Trees view. For example, to respond to files from the desktop being dropped, use mime type "text/uri-list".
<syntaxhighlight lang="python" enclose> def drop_hook(type, data):
print type, data