Re: drag'n'drop
"Labhard, Michael E" <[email protected]>
| Newsgroups | gmane.comp.python.pythoncard |
|---|---|
| Message-ID | <DD4012F549801A4B9984F212F964B469015140C9@fmsmsx411.amr.corp.intel.com> |
This is how we do it:
class HHSResponseImageDropTarget(wx.FileDropTarget):
def __init__(self, window, responses):
wx.FileDropTarget.__init__(self)
self.window = window
self.responses = responses
def OnDropFiles(self, x, y, filenames):
global IMAGE_EXT, MEDIA_DIR
assert(1==len(filenames))
for file in filenames:
if os.path.isfile(file):
if _isFile(file, IMAGE_EXT):
media_file = getImageFile(self.responses, file)
self.window._setFile( media_file )
else:
dialog.alertDialog(None, (FILE_ERROR %
(str(IMAGE_EXT), file)))
The class is initialized with an image viewer window.
-- Michael
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Pythoncard-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pythoncard-users