It actually works, but I didn't find a way to create a drag in 'Link' mode using Nautilus. For 'Copy' mode, just drag it,
for 'Move' mode drag it with 'Shift' key pushed. Can someone give it a try ?
Code: Select all
; Drag a file to one of the gadets and you will receive the file path
;
If OpenWindow(0, 0, 0, 500, 200, "Drop File Here", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(0, 10, 10, 500 - 20, 30, "")
EditorGadget(1, 10, 50, 500 - 20, 140)
EnableGadgetDrop(0, #PB_Drop_Files, #PB_Drag_Link) ; Link mode
EnableGadgetDrop(1, #PB_Drop_Files, #PB_Drag_Copy)
Repeat
Select WaitWindowEvent()
Case #PB_Event_GadgetDrop
Select EventGadget()
Case 0 ; gadgets that received a file/folder drag and drop event
If Not FindString(EventDropFiles(), Chr(10))
SetGadgetText(0, EventDropFiles())
EndIf
Case 1
SetGadgetText(1, EventDropFiles())
EndSelect
Case #PB_Event_CloseWindow
CloseWindow(0)
End
EndSelect
ForEver
EndIf