6 from rox
.support
import get_local_path
11 def extract_uris(data
):
12 lines
= string
.split(data
, '\r\n')
19 def drag_data_received(widget
, context
, x
, y
, selection_data
, info
, time
, win
):
20 if info
== TARGET_RAW
:
21 win
.load_data(selection_data
.data
)
23 uris
= extract_uris(selection_data
.data
)
25 win
.error("Nothing to load!")
30 path
= get_local_path(uri
)
36 win
.error("Can't load remote files yet!")
38 # 'widget' is the GTK widget that will accept drops
39 # 'window' provides 'load_file' and 'load_data' methods.
40 def make_xds_loader(widget
, window
):
41 widget
.drag_dest_set(DEST_DEFAULT_ALL
,
42 [('text/uri-list', 0, TARGET_URILIST
),
43 ('text/plain', 0, TARGET_RAW
),
44 ('application/octet-stream', 0, TARGET_RAW
)
46 ACTION_COPY | ACTION_PRIVATE
)
48 widget
.connect('drag_data_received', drag_data_received
, window
)