Identifier: drop_files { }

Syntax

drop_files( <window>,<strings>)

Parameters

Type

callback

Description

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.

Example

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]>
    }
}

Notes

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.