Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to approach Drag and Drop? #82

Closed
geofmureithi-zz opened this issue Nov 28, 2019 · 4 comments
Closed

How to approach Drag and Drop? #82

geofmureithi-zz opened this issue Nov 28, 2019 · 4 comments
Labels
feature New feature or request question Further information is requested

Comments

@geofmureithi-zz
Copy link

geofmureithi-zz commented Nov 28, 2019

I want to create drag and drop similar to this one Codepen
According to #61, I can't use gtk and I am wondering where to start.

@hecrj hecrj added feature New feature or request question Further information is requested labels Nov 28, 2019
@hecrj
Copy link
Member

hecrj commented Nov 29, 2019

I think this should be achievable with a custom widget accepting a draggable set of items and containing a drop zone.

Once one of the items is clicked, you would draw it at the cursor position until it is dropped. If it is dropped in the drop zone, you could produce a Message containing the index of the dropped item.

The main limitation of this approach is that both draggable and drop zone will be part of the same widget and flexibility when it comes to styling/layout may be difficult. Right now, this is necessary in order to control drawing properly, as layers are not supported yet (see #30).

@geofmureithi-zz
Copy link
Author

geofmureithi-zz commented Dec 3, 2019

Interesting, let me see if I can get something done. Thanks.

@hecrj
Copy link
Member

hecrj commented Mar 20, 2020

The new PaneGrid widget (see #224) implements drag and drop with the approach I described in my previous comment.

@geofmureithi-zz
Copy link
Author

geofmureithi-zz commented Mar 21, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants