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

Files drag & drop #101

Open
GVicent opened this Issue Feb 24, 2017 · 11 comments

Comments

Projects
None yet
3 participants
@GVicent

GVicent commented Feb 24, 2017

Hi jarvisteach,

I recently discover your api. It is so well made and simple to code with, I'm using it without moderation.

For my project, I wanted to "drag & drop" files into my application window (to add them in my database). From your doc, I didn't figure out how to manage this, so I am suggesting it as enhancement.

Cordialement. Regards

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Feb 24, 2017

Owner

Interesting request...

I've implemented a simple drag-and-drop functionality within a single appJar instance:

  • app.addDragFunction(wing, [drag, drop])

This allows you to register a widget to start a drag event and another widget to receive a drop event.

But, this won't work from other applications - as there's no way to register the drag side of the event - appJar won't know what's being dragged, only that something is being dropped...

A quick Google reveals tkDND - a library to implement this.

It looks like it could work, but will need a bunch of research/work - I'll have a look into it after the next release.

On a side note, I also found this, which may provide better drag-and-drop functionality than I've already implemented. Will look into this at the same time...

Owner

jarvisteach commented Feb 24, 2017

Interesting request...

I've implemented a simple drag-and-drop functionality within a single appJar instance:

  • app.addDragFunction(wing, [drag, drop])

This allows you to register a widget to start a drag event and another widget to receive a drop event.

But, this won't work from other applications - as there's no way to register the drag side of the event - appJar won't know what's being dragged, only that something is being dropped...

A quick Google reveals tkDND - a library to implement this.

It looks like it could work, but will need a bunch of research/work - I'll have a look into it after the next release.

On a side note, I also found this, which may provide better drag-and-drop functionality than I've already implemented. Will look into this at the same time...

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Feb 25, 2017

Owner

Just had a play with this - works seamlessly on Mac (from Finder to an Entry widget), will try it on the Pi/Windows later

Owner

jarvisteach commented Feb 25, 2017

Just had a play with this - works seamlessly on Mac (from Finder to an Entry widget), will try it on the Pi/Windows later

@jarvisteach jarvisteach modified the milestone: 0.06 Feb 25, 2017

@jarvisteach jarvisteach self-assigned this Feb 25, 2017

jarvisteach added a commit that referenced this issue Mar 12, 2017

Initial DnD support (#101)
Early days - only briefly tested on OSX

jarvisteach added a commit that referenced this issue Apr 11, 2017

@jarvisteach jarvisteach modified the milestones: 0.06, 0.061 Apr 14, 2017

jarvisteach added a commit that referenced this issue Apr 15, 2017

Updated to dnd (#101)
Added dll for windows. Updated docs, and included external functions
for snd
@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Apr 15, 2017

Owner

This may be a newer version of tkdnd: http://tkinterdnd.sourceforge.net/TkinterDnD.html

Owner

jarvisteach commented Apr 15, 2017

This may be a newer version of tkdnd: http://tkinterdnd.sourceforge.net/TkinterDnD.html

jarvisteach added a commit that referenced this issue Apr 15, 2017

jarvisteach pushed a commit that referenced this issue Apr 15, 2017

Richard Jarvis

jarvisteach added a commit that referenced this issue Apr 15, 2017

jarvisteach added a commit that referenced this issue Apr 16, 2017

and updates (#101)
Generalised dnd…

jarvisteach added a commit that referenced this issue Apr 16, 2017

jarvisteach added a commit that referenced this issue Apr 16, 2017

jarvisteach added a commit that referenced this issue Apr 16, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Apr 18, 2017

Owner

HI @GVicent - was wondering if you could have a play with this. The new release (0.06) support D'nD between apps on Windows & OSX, and the next_release branch now also has support for RaspberryPi.

Have a look at: http://appjar.info/pythonDnD/ for some help...

Owner

jarvisteach commented Apr 18, 2017

HI @GVicent - was wondering if you could have a play with this. The new release (0.06) support D'nD between apps on Windows & OSX, and the next_release branch now also has support for RaspberryPi.

Have a look at: http://appjar.info/pythonDnD/ for some help...

jarvisteach added a commit that referenced this issue Apr 18, 2017

jarvisteach added a commit that referenced this issue Apr 19, 2017

@jarvisteach jarvisteach modified the milestones: 0.061, 0.07 Apr 19, 2017

jarvisteach added a commit that referenced this issue May 26, 2017

fixed tcl issue between arm/x86 linux (#101)
tcl now checks platform machine when x11, and updates to pi, if it
starts with arm

jarvisteach added a commit that referenced this issue May 26, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach May 26, 2017

Owner

Hopefully, now can distinguish between arm/x86 linux and load the right library. Need x86 platform to test on, and still will be some issues between 32 & 64 bit...

Owner

jarvisteach commented May 26, 2017

Hopefully, now can distinguish between arm/x86 linux and load the right library. Need x86 platform to test on, and still will be some issues between 32 & 64 bit...

@jarvisteach jarvisteach modified the milestones: 0.08, 0.07 May 29, 2017

jarvisteach added a commit that referenced this issue Jun 11, 2017

DnD (#101)
Lots of new code, mostly to support Internal DnD (#102)
* New classes for a base canvas (CanvasDnD) to go under all widgets
* Both main window & subWindows now have a CanvasDnD
* New classes for a DraggableWidget & TrashBin widget
* New functions to register internal DnD
* Renaming to ExternalDnD import and wrappers

Implemented new after functions (#180)
* New functions to provide wrappers for after, etc

Fixed issue with containers in containers (#176)
* starting containers now use `getContainer()` instead of accessing
`containerStack` directly

Updated documentation for events & change-log

New test code for DnD

@jarvisteach jarvisteach modified the milestones: 0.09, 0.08 Aug 18, 2017

@WilfriedBl

This comment has been minimized.

Show comment
Hide comment
@WilfriedBl

WilfriedBl Nov 20, 2017

Since the documentation says "....- at the moment, this has been seen to work on Mac OSX 10.11, Raspberry Pi, and Windows 7 - let us know of success on other distributions!":
I can confirm dragging a file name from another application into an Entry field also works in Windows 10 64bit Pro Version 1703 and 1709.

WilfriedBl commented Nov 20, 2017

Since the documentation says "....- at the moment, this has been seen to work on Mac OSX 10.11, Raspberry Pi, and Windows 7 - let us know of success on other distributions!":
I can confirm dragging a file name from another application into an Entry field also works in Windows 10 64bit Pro Version 1703 and 1709.

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Nov 20, 2017

Owner
Owner

jarvisteach commented Nov 20, 2017

jarvisteach added a commit that referenced this issue Nov 21, 2017

@jarvisteach jarvisteach modified the milestones: 0.90, 1.0 Dec 10, 2017

@WilfriedBl

This comment has been minimized.

Show comment
Hide comment
@WilfriedBl

WilfriedBl Dec 13, 2017

I just realized, it does not work on Windows 10 32bit:
Traceback (most recent call last): File "d:\anzgeotags\anzgeotags.py", line 1396, in <module> build_GUI_panel() File "d:\anzgeotags\anzgeotags.py", line 1320, in build_GUI_panel if tr == '1': gui.setEntryDropTarget("Image" + tr, dropped_name_image1, replace=True) File "<string>", line 1, in setEntryDropTarget File "C:\Users\WBL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\appJar\appjar.py", line 2606, in configureWidgets self.configureWidget(kind, names, option, value) File "C:\Users\WBL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\appJar\appjar.py", line 2807, in configureWidget self.__registerExternalDropTarget(name, item, value[0], value[1]) File "C:\Users\WBL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\appJar\appjar.py", line 1133, in __registerExternalDropTarget raise Exception("External Drag'n Drop not available on this platform") Exception: External Drag'n Drop not available on this platform

WilfriedBl commented Dec 13, 2017

I just realized, it does not work on Windows 10 32bit:
Traceback (most recent call last): File "d:\anzgeotags\anzgeotags.py", line 1396, in <module> build_GUI_panel() File "d:\anzgeotags\anzgeotags.py", line 1320, in build_GUI_panel if tr == '1': gui.setEntryDropTarget("Image" + tr, dropped_name_image1, replace=True) File "<string>", line 1, in setEntryDropTarget File "C:\Users\WBL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\appJar\appjar.py", line 2606, in configureWidgets self.configureWidget(kind, names, option, value) File "C:\Users\WBL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\appJar\appjar.py", line 2807, in configureWidget self.__registerExternalDropTarget(name, item, value[0], value[1]) File "C:\Users\WBL\AppData\Local\Programs\Python\Python36-32\lib\site-packages\appJar\appjar.py", line 1133, in __registerExternalDropTarget raise Exception("External Drag'n Drop not available on this platform") Exception: External Drag'n Drop not available on this platform

jarvisteach added a commit that referenced this issue Dec 15, 2017

Updates to #235
Also, added support for drop on SelectableLabels (#101), and aligned
them centrally, to match other labels.
@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Dec 15, 2017

Owner

Thanks for the info @WilfriedBl - I will probably need to find a 32 bit compiled version of the library for dnd - I'll drop you a message to test it when I get one sorted.

Owner

jarvisteach commented Dec 15, 2017

Thanks for the info @WilfriedBl - I will probably need to find a 32 bit compiled version of the library for dnd - I'll drop you a message to test it when I get one sorted.

@WilfriedBl

This comment has been minimized.

Show comment
Hide comment
@WilfriedBl

WilfriedBl Dec 15, 2017

Not sure, how common 32bit Windows still is. It's just important to know, there is a restriction. For myself (just using an old PC for testing), I found the workaround in this way:
import platform
if platform.architecture()[0] == '64bit':
gui.setEntryDropTarget("Image" + tr, dropped_name_image, replace=True)
gui.setEntryTooltip("Image" + tr, "Drag any image file here")

WilfriedBl commented Dec 15, 2017

Not sure, how common 32bit Windows still is. It's just important to know, there is a restriction. For myself (just using an old PC for testing), I found the workaround in this way:
import platform
if platform.architecture()[0] == '64bit':
gui.setEntryDropTarget("Image" + tr, dropped_name_image, replace=True)
gui.setEntryTooltip("Image" + tr, "Drag any image file here")

@jarvisteach jarvisteach modified the milestones: 1.0, 1.1 Mar 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment