forked from jamesra/nornir-pyre
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestwxdrop.py
50 lines (30 loc) · 988 Bytes
/
testwxdrop.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import sys
import sys
import wx
if not hasattr(sys, 'frozen'):
import wxversion
print "Wx version: " + str(wxversion.getInstalled())
wxversion.select('2.8')
print "Python version: " + sys.version
class TestWxDrop(wx.Frame):
def __init__(self, parent):
'''
Constructor
'''
wx.Frame.__init__(self, parent, title="Test file drop window", size=(400, 200))
self.SetDropTarget(FileDrop(self))
self.Show()
class FileDrop (wx.FileDropTarget):
def __init__(self, window):
super(FileDrop, self).__init__()
self.window = window
def OnDragOver(self, *args, **kwargs):
print "DragOver"
return wx.FileDropTarget.OnDragOver(self, *args, **kwargs)
def OnDropFiles(self, x, y, filenames):
print "You dropped a file! " + str(filenames)
if __name__ == "__main__":
app = wx.App(False)
window = TestWxDrop(parent=None)
app.TopWindow = window
app.MainLoop()