Created
May 21, 2012 03:16
-
-
Save pcostesi/2760417 to your computer and use it in GitHub Desktop.
Drop interaction in wx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FileDropTarget(wx.FileDropTarget): | |
def __init__(self, window): | |
wx.FileDropTarget.__init__(self) | |
self.window = window | |
def OnDropFiles(self, x, y, filenames): | |
for name in filenames: | |
pass | |
class MainWindow(wx.Frame): | |
def __init__(self, parent, id, title): | |
wx.Frame.__init__(self, parent, id, title, size=(450, 400)) | |
dt = FileDropTarget(self) | |
self.SetDropTarget(dt) | |
self.Centre() | |
self.Show(True) | |
app = wx.App() | |
MainWindow(None, -1, '<title goes here>') | |
app.MainLoop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment