Is it possible to drag files from my application to another on the mac?
I am looking at DragDrop.pb from the help file and only the Image can be dragged.
Is this correct behaviour?
CD
Dragfiles On MAC
-
- Addict
- Posts: 1309
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Dragfiles On MAC
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
-
- Addict
- Posts: 1309
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Dragfiles On MAC
I cannot find anything about it but have a maybe workaround.
After creating a folder and the file I want the user to drag I open Finder with just that file they can then use finders drag and drop.
Not perfect but seems to work. Code adapted from another post.
Would be better if we could start the drag operation with a script.
CD
After creating a folder and the file I want the user to drag I open Finder with just that file they can then use finders drag and drop.
Not perfect but seems to work. Code adapted from another post.
Code: Select all
Dest$ = GetUserDirectory(#PB_Directory_Documents) + "My Exports/St Pierre.csv"
RunProgram("open", "-R " + Chr(34) + Dest$ + Chr(34), "")
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
-
- Addict
- Posts: 1309
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Dragfiles On MAC
Just tried it and it works.
Start users web browser to display upload page
Wait a couple of seconds.
Start Finder to display file on top of web browser
User can drag file to upload box.
Just need to do the same for windows now.
Start users web browser to display upload page
Wait a couple of seconds.
Start Finder to display file on top of web browser
User can drag file to upload box.
Just need to do the same for windows now.
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: Dragfiles On MAC
Is it possible to drag files from my application to another on the mac?
I don't have a Mac, but I don't see what the difficulty is for Windows (or I didn't understand the question ?)Just need to do the same for windows now.
Drag a file from a PB application (ie: ExplorerListGadget) to any other Windows appli or folder is easy:
Code: Select all
RunProgram(GetUserDirectory(#PB_Directory_Documents))
OpenWindow(0, 0, 0, 400, 200, "")
ExplorerListGadget(1, 10, 10, 380, 180, "*.*")
Repeat
If WaitWindowEvent() = #PB_Event_Gadget And
EventType() = #PB_EventType_DragStart And
EventGadget() = 1
DragFiles(GetGadgetText(1) + GetGadgetItemText(1, GetGadgetState(1)))
EndIf
Until WaitWindowEvent() = #PB_Event_CloseWindow
Re: Dragfiles On MAC
Something was changed on the macOS system (from version High Sierra).
Since then, dragging lists (ListView, ListIcon, etc) no longer works.
Press left mouse button and move mouse is now multi-selection
Since then, dragging lists (ListView, ListIcon, etc) no longer works.
Press left mouse button and move mouse is now multi-selection
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Dragfiles On MAC
On MacOS drag 'n drop support is broken since PB 5.00 (with the change from the Carbon framework to the Cocoa framework). About 7 years ago fsw had posted this summary with links to bug postings concerning MacOS drag 'n drop. Fred posted this answer in that thread:Marc56us wrote:I don't have a Mac, but I don't see what the difficulty is for Windows (or I didn't understand the question ?)
Some features of drag 'n drop work in MacOS like drag 'n drop of images. For another broken feature exists an uncomfortable workaround like drag 'n drop for the ListIconGadget.Fred wrote:Cocoa drag'n'drop model is not fully compatiable with PB model, I don't know how to work around it (for now).
This simple example demonstrates how to drag files from Finder into an EditorGadget and display their paths and names.