Skip to content

Instantly share code, notes, and snippets.

@pcostesi
Created May 21, 2012 03:16
Show Gist options
  • Select an option

  • Save pcostesi/2760417 to your computer and use it in GitHub Desktop.

Select an option

Save pcostesi/2760417 to your computer and use it in GitHub Desktop.
Drop interaction in wx
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