Element: window.drop_files { }

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, e.g. by dragging one or more file names from Windows Explorer and releasing the mouse onto a Fire window.

Parameters

<window>.drop_files(<window>,<strings>)

Examples

For example, if <window> is an alpha window and a dropped file has an extension .txt, we could display it in the window. This could be achieved by the following:

window mywin = walpha
mywin.drop_files = {
   args w=window, ss=string[]
# Although multiple files can be dropped, we will
# only process the first .txt file
   for i=1,ss.alength {
      if (fext(ss[i]) == '.txt') {
         w.file = ss[i]
         return
      }
      else tell <'Unhandled drag file:',ss[i]>
   }
}

If <window> has no .drop_files callback defined, but <window> is a sub-window, then the .drop_files callback of its parent window will be invoked. If none of its parent windows have a .drop_files callback, then the general system callback drop_files is invoked.