drop_files( <window>,<strings>)
<window>
The receiving Fire
window, or null if it was dropped on a system window (e.g. the monitor
or error log).
<strings>
An array of file
names.
callback
A callback to process files passed to Fire from the windowing system file drag and drop mechanism. This facility is currently available on Windows systems only, by dragging one or more file names from Windows Explorer and releasing the mouse onto a Fire window.
If a dropped file has an extension .jpg (a JPEG image file), we could display it in its own new window. This could be achieved by the following:
drop_files = { args w=window, ss=string[] for i=1,ss.alength { if (fext(ss[i]) == '.jpg') wdisplay ss[i] else tell <'Unhandled drag file:',ss[i]> } }
In addition to this system callback, each individual user window can have its own window.drop_files callback, which will be invoked in preference to the system callback. Only when the drop window is a system window or when the drop window has no window.drop_files callback defined will this system callback be invoked.