mirror of https://github.com/chriskiehl/Gooey.git
Chris
4 years ago
5 changed files with 41 additions and 17 deletions
Split View
Diff Options
-
2gooey/gui/application.py
-
2gooey/gui/components/mouse.py
-
29gooey/gui/components/widgets/core/chooser.py
-
4gooey/gui/components/widgets/core/text_input.py
-
21gooey/gui/util/filedrop.py
@ -1,11 +1,16 @@ |
|||
import wx |
|||
|
|||
|
|||
class FileDrop(wx.FileDropTarget): |
|||
def __init__(self, window): |
|||
wx.FileDropTarget.__init__(self) |
|||
self.window = window |
|||
|
|||
def OnDropFiles(self, x, y, filenames): |
|||
for name in filenames: |
|||
self.window.WriteText(name) |
|||
return True |
|||
def __init__(self, window, dropStrategy=None): |
|||
wx.FileDropTarget.__init__(self) |
|||
self.window = window |
|||
self.dropHandler = dropStrategy or self._defaultStrategy |
|||
|
|||
def OnDropFiles(self, x, y, filenames): |
|||
return self.dropHandler(x, y, filenames) |
|||
|
|||
def _defaultStrategy(self, x, y, filenames): |
|||
for name in filenames: |
|||
self.window.WriteText(name) |
|||
return True |
Write
Preview
Loading…
Cancel
Save