I have a pygame window that I want to know when a file has been dragged and dropped onto it. I only need to be able to fetch the name of the file. How can this be accomplished?
Asked
Active
Viewed 1,532 times
4

Toni Ruža
- 7,462
- 2
- 28
- 31

directedition
- 11,145
- 18
- 58
- 79
-
Did you succeed? Because I am trying the exact same thing, and it doesn't work... (Using pythoncom) – CodenameLambda Jun 06 '16 at 14:47
2 Answers
3
Here's a forum thread that might be what you're looking for.
And another forum.
And a link to the msdn page. You'll probably want the pythoncom library.

tgray
- 8,826
- 5
- 36
- 41
0
one option for a similar effect is is to use pygame's scrap module so you can copy-paste into the window, your program would just need to look for ctr-V events.
On this XFCE desktop I'm using If I hit ctrl-C with a file selected, the file name shows up when I type
pygame.scrap.init()
types= pygame.scrap.get_types()
print dict(
[type,pygame.scrap.get(type)]
for type intypes
)

Martijn Pieters
- 1,048,767
- 296
- 4,058
- 3,343

suki
- 11