def fdir_dialogue(self, event):
fdir = "" # Use folder as a flag
currentdir = self.dirchooser.textctrl.GetValue()
dlg = wx.DirDialog(self, defaultPath = currentdir)
if dlg.ShowModal() == wx.ID_OK:
fdir = dlg.GetPath() + "/"
dlg.SetPath(fdir)
dlg.Destroy() # best to do this sooner than later
if fdir:
self.dirchooser.textctrl.SetValue(fdir)
event = wx.PyCommandEvent(wx.EVT_TEXT_ENTER.typeId,
self.dirchooser.textctrl.GetId())
self.GetEventHandler().ProcessEvent(event)
self.fdir = fdir
评论列表
文章目录