Drag and drop file
Drag and drop of files into R3 windows now supported.
Here's a quick example, written at the lowest level (defining its own graphic objects and event handler -- soon enough this will be supported at a higher layer):
REBOL [Title: "Drop File Test"]
win: make gob! [text: "Test Window" offset: 100x100 size: 600x200]
append win gt: make gob! [
size: win/size
text: [bold "Drop a file on me, s'il vous plaƮt."]
]
system/view/event-port: ep: open [scheme: 'event]
ep/awake: func [event] [
print ["EVENT:" event/type event/offset]
switch event/type [
close [quit]
drop-file [
repend gt/text ['newline form event/data]
show gt
]
]
tail? system/view/screen-gob
]
view win
Thanks to Richard Smolak (Cyphre) for research and example of the Win32 API functions.
9 Comments
|