I currently have a working app using wx.TextCtrl, where I open a select
folder dialogue box. I would like to add drag and drop so I could just drag
and drop a folder to get the folder path, so I could have both options
available to the user. Here is a section of my current code:
self.pathindir = wx.TextCtrl(panel, -1, pos=(35, 380), size=(300, 25))
self.buttonin = wx.Button(panel, -1, "Open", pos=(350, 378))
self.buttonin.Bind(wx.EVT_BUTTON, self.openindir)
def openindir(self, event):
dlg = wx.DirDialog(self, "Choose your input lookup directory:",
style=wx.DD_DEFAULT_STYLE | wx.DD_NEW_DIR_BUTTON)
if dlg.ShowModal() == wx.ID_OK:
global pathindir
pathindir = dlg.GetPath()
self.SetStatusText("Your selected input lookup directory is: %s" %
pathindir)
self.pathindir.Clear()
self.pathindir.WriteText(pathindir)
dlg.Destroy()
···
--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/wx-TextCtrl-use-drag-and-drop-folder-to-get-file-path-tp5718060.html
Sent from the wxPython-users mailing list archive at Nabble.com.