Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

DragDrop.AttachToWindow

Attaches a new drop area to the window.

Component Version macOS Windows Linux Server iOS SDK
DragDrop 11.0 ✅ Yes ✅ Yes ❌ No ❌ No ❌ No
MBS( "DragDrop.AttachToWindow"; WindowRef )   More

Parameters

Parameter Description Example
WindowRef Window Reference is the unique OS level window ID. You can obtain this by using the Window.FindByTitle or Window.FindByIndex functions. Pass zero to access the frontmost window. 0

Result

Returns OK or error.

Description

Attaches a new drop area to the window.
This disables FileMaker's drop handler and installs the plugin one to the window.
You can't assign a picture or change position on Windows.

On MacOS calls DragDrop.CreateWithWindow internally.
You may need to release via DragDrop.Release later, especially when switching layouts.

Examples

Attach to window of the FileMaker solution:

# SetupDrop attach in file DragTest drag

# let FileMaker build the layout
Pause/Resume Script [ Duration (seconds): ,1 ]
# now add our control
Set Variable [ $$dropview ; Value: MBS("DragDrop.AttachToWindow"; Get(WindowName) ) ]
Set Variable [ $result ; Value: MBS( "DragDrop.RegisterDropTypes"; $$dropview; "file") ]
Set Variable [ $result ; Value: MBS( "DragDrop.SetDragActionHandler"; $$dropview; Get ( FileName ); "DragAction") ]
Set Variable [ $result ; Value: MBS( "DragDrop.SetCursor"; $$dropview; 1) ]

See also

Release notes

Example Databases

Blog Entries

This function checks for a license.

Created 25th November 2020, last changed 19th January 2021


DocumentPicker.SetTrigger - DragDrop.ClearDragActionHandler