From 022c0ee2cdab9b8ac9802788e14e440966efc05d Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 5 Jan 2004 19:54:39 +0000 Subject: [PATCH] Ensure that the dirdialog is destroyed after use git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@25069 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/wxPython/lib/filebrowsebutton.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/wxPython/wxPython/lib/filebrowsebutton.py b/wxPython/wxPython/lib/filebrowsebutton.py index e9481d5daa..11e92310a2 100644 --- a/wxPython/wxPython/lib/filebrowsebutton.py +++ b/wxPython/wxPython/lib/filebrowsebutton.py @@ -334,19 +334,17 @@ class DirBrowseButton(FileBrowseButton): labelText, buttonText, toolTip, dialogTitle, startDirectory, changeCallback = changeCallback) - # - self._dirDialog = dialogClass(self, - message = dialogTitle, - defaultPath = startDirectory) + self.dialogClass = dialogClass # + def OnBrowse(self, ev = None): - dialog = self._dirDialog - if dialog.ShowModal() == wxID_OK: + dialog = self.dialogClass(self, + message = self.dialogTitle, + defaultPath = self.startDirectory) + if dialog.ShowModal() == wx.ID_OK: self.SetValue(dialog.GetPath()) + dialog.Destroy() # - def __del__(self): - if self.__dict__.has_key('_dirDialog'): - self._dirDialog.Destroy() #----------------------------------------------------------------------