Text box reveal directory path?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Text box reveal directory path?

jason watkins
Is it possible to create a text box that will reveal the full path of a folder/file when that folder/file is dragged and dropped onto the text box?  I want it to function like terminal does on a Mac.  Thanks for any help, Jason

_______________________________________________
Tkinter-discuss mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/tkinter-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Text box reveal directory path?

Michael Lange
Hi Jason,

Thus spoketh jason watkins <[hidden email]>
unto us on Thu, 1 Mar 2012 21:35:55 +0000:

>
> Is it possible to create a text box that will reveal the full path of a
> folder/file when that folder/file is dragged and dropped onto the text
> box?  I want it to function like terminal does on a Mac.  Thanks for
> any help, Jason

Drag and drop with Tkinter is a little tricky. If you only need to handle
DnD within your application you can try the Tkdnd module from Python's
standard library.

However, te above sounds like you want to drag from an external program,
like a file manager?
In this case you need the tkdnd extension to Tk from
http://sourceforge.net/projects/tkdnd/ and the Python wrapper from
http://klappnase.bubble.org/TkinterDnD2/index.html .

With these your mileage may vary, on windows systems drags as well as
drops have been reported to work, on unix systems only drops are
supported and I myself have never managed to get it decently working at
all, however some people reported success on linux and OSX too.

Regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

        "Life and death are seldom logical."
        "But attaining a desired goal always is."
                -- McCoy and Spock, "The Galileo Seven", stardate 2821.7
_______________________________________________
Tkinter-discuss mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/tkinter-discuss