fyne
fyne copied to clipboard
Add drag and drop support
Add the events for these gestures.
Explore further what's required to integrate with system DnD
it would be useful to allow it or not programmatically.
Can you expand on that thought? Do you mean that widgets should have an API for controlling if DnD is enabled? Do you mean for creating custom widgets or for buitlin ones?
Sure. I would like to be able to decide if/when to allow clipboard & drag and drop. I mean it could be important for security reasons for example. I think having that kind of setting available "framework wide" & set at startup would be sufficient.
Would this (http://anton.maurovic.com/posts/win32-api-approach-to-windows-drag-and-drop/) help with the Windows side of this ?
Possibly relates to URI registry? How do we handle unknown or custom defined types etc
This needs some thought and planning on how to approach.
it`s work now?
it`s work now?
This has not been completed. The work has been moved out to the release after the one we are working on now.
it`s work now?
This has not been completed. The work has been moved out to the release after the one we are working on now.
Very much looking forward to
it`s work now?
This has not been completed. The work has been moved out to the release after the one we are working on now.
Look forward to drag and drop
Look forward to drag and drop
When will it be finished?
This does not have a completion date. It is temtatively placed in the release /after/ the one we are working on. This would suggest late 2021 - but nothing is committed yet.
Please find an idea how java's SWT (close to C) toolkit implemented Drag and Drop in Mac, GTK, Windows API:
https://github.com/eclipse/eclipse.platform.swt/tree/master/bundles/org.eclipse.swt/Eclipse%20SWT%20Drag%20and%20Drop
Please find an idea how java's SWT (close to C) toolkit implemented Drag and Drop in Mac, GTK, Windows API:
https://github.com/eclipse/eclipse.platform.swt/tree/master/bundles/org.eclipse.swt/Eclipse%20SWT%20Drag%20and%20Drop
Also the native part (C,C++) of java SWT https://github.com/eclipse/eclipse.platform.swt/tree/master/bundles/org.eclipse.swt/Eclipse%20SWT%20PI
In older versions they had also code for 32-bit implementations
Thanks for the links, However I don't think SWT is Java's main API - Swing or JavaFX are their main UI libraries...
True, SWT has a more C-like API, maybe easier for porting to Go.
Thank you for your wonderful work!
it`s work now?
This has not been completed. The work has been moved out to the release after the one we are working on now.
Look forward to drag and drop
I am agree
I want to ask, is this function completed now?
I want to ask, is this function completed now?
No. If it was complete you would see this issue closed. There is now a proposal being pulled together for the API design https://github.com/fyne-io/proposals/pull/5
it`s work now?
it`s work now?
Please avoid this type of comment. It’s getting very repetitive. You have the exact same question answered in the comment above. https://github.com/fyne-io/fyne/issues/142#issuecomment-887282008
Meanwhile this is a work in progress I've found a hacky workaround to get basic drag and drop support. It consists on modifying a single file by adding:
RunOnDraw(f func())
to the file window.go
at the end of the Window
interface.
Then after everything has been created and right before window.ShowAndRun
add this block of code:
window.RunOnDraw(func() {
glfw.GetCurrentContext().SetDropCallback(func(w *glfw.Window, names []string) {
// here goes you onDropFiles code
})
})
This is basic drag and drop support, meaning it doesn't inform you where the files are dropped, and if it was dropped on certain objects. (That functionality has to be implemented manually, although it is not too hard) Note: I would discourage this solution for any relatively big project, it would be much better to wait until this feature gets implemented correctly (which is scheduled for mid/late 2023)
Thanks for the hint. As you will have noticed from adding that code it is not technically challenging. The reason this is not yet complete is because defining the API is where the complex challenge lies.
Dropping a file in to a fyne app and detecting it would be dope
The dropping to window is a great start - but we need a full drag and drop API so items can source and receive items being dragged. This is a complex issue and will need to support multiple mime or some content negotiation. Plus some indication of the drag happening once initiated (i.e. attaching preview/name).
$500 is currently allocated for eligible contributors completing this work (see Contributing: Membership).