toga icon indicating copy to clipboard operation
toga copied to clipboard

Drag and drop functionality

Open frankhuurman opened this issue 11 months ago • 3 comments

What is the problem or limitation you are having?

I've built a Streamlit webapp for my girlfriend's business about 3 years ago and would love to rebuild it with native UI components that Toga provides so that she doesn't have to launch a powershell script that launches the Python webapp in the browser.

But for this I do need a way to drag files into the application and be able to do something with the filenames/paths & contents.

Does Toga already support this in some way and if not, I would love to request this as a feature.

Describe the solution you'd like

Drag and drop functionality within a Toga application

Describe alternatives you've considered

Other frameworks, or using Tkinter as a fallback which doesn't look great.

Additional context

No response

frankhuurman avatar Jan 11 '25 16:01 frankhuurman

Completely agreed that DnD is a feature that Toga should support. That means there's 2 questions:

1. What does that API look like?

This needs someone to do research on how DnD is implemented on various platforms (most notably desktop). What feature set is plausible cross platform? What does the API for implementing that feature set look like?

My immediate guess is that there will be some sort of of on_drag_start and on_drop_complete handlers added to widgets that accept drag and drop events, with the existence of the handlers enabling that support. The drag handlers would providing some sort of generic representation of the content being dragged. However, I have no idea what that content format looks like, how DnD targeting is enabled on a per-widget/window/app basis, or how that manifests in a cross-platform way.

2. Who is going to implement it?

Right now, this isn't a high priority for me personally. We publish a roadmap every quarter indicating the areas where we're intending to focus. DnD isn't on our 2025 Q1 roadmap; if I had to guess right now based, it won't be on any 2025 roadmap, either.

That means either someone else needs to step up and volunteer to do the work for (1), or someone needs to bring money to pay someone to do the work required by (1). If someone has the financial resources, that could alter the official BeeWare roadmap - but we're also happy to review work from other contractors.

freakboy3742 avatar Jan 12 '25 01:01 freakboy3742

Hi, I want to work on this issue. Can you assign it to me?

dkarvan8 avatar Feb 01 '25 15:02 dkarvan8

We don't use the GitHub assignment feature – posting a comment is enough.

You've posted this comment on 5 issues today, but I recommend you only work on one at a time until you're more familiar with the project.

mhsmith avatar Feb 01 '25 15:02 mhsmith