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()