views:

305

answers:

2

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?

+3  A: 

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
A: 

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 )

suki