I've checked the new API docs for DirDialog and FileDialog and ensured
that I'm calling them correctly. But, the function is still not working.
The latest changes:
def openFile(self, event):
wd = wx.DirDialog(None, "Choose a default directory:", defaultPath=".",
style=wx.DD_DEFAULT_STYLE)
result = wd.ShowModal()
if result == wx.ID_CANCEL:
wd.Destroy()
if result == wx.ID_OK:
self.appData.dirname = wd.GetPath()
wd.Destroy()
wildcard = 'Project databases (*.db)|*.db|'
dlg = wx.FileDialog(None, "Choose a project", self.appData.dirname,
wildcard=wildcard, style=wx.FD_OPEN|wx.FD_CHANGE_DIR)
result = dlg.ShowModal()
if result == wx.ID_CANCEL:
dlg.Destroy()
if result == wx.ID_OK:
self.appData.projname=dlg.GetFilename()
self.appData.dirname=dlg.GetDirectory()
self.appData.dbFileName=dlg.GetFilename()
titleStr = self.appData.projname[:-4]
self.SetTitle(('FuzzyEI-Assessor: - %s') % self.appData.projname)
dlg.Destroy()
Now, as soon as the function is called, the console displays this message:
(python:9274): Gtk-CRITICAL **: gtk_file_system_unix_get_folder:
assertion `g_path_is_absolute (filename)' failed
Pressing the "OK" button does nothing. Pressing the "Cancel" button closes
the dialog box and brings up the FileDialog. That seems backward to me.
Regardless, when I then double-click on a file name, rather than
displaying that name in the appropriate widget and loading other data from
the database tables, the same error message as before is displayed; that is,
Traceback (most recent call last):
File "/data1/eikos/modelPage.py", line 201, in OnOpenMod
pName = functions.openFile(self, event)
File "/data1/eikos/functions.py", line 51, in openFile
self.SetTitle(('FuzzyEI-Assessor: - %s') % self.appData.projname) AttributeError: 'modModel' object has no attribute 'SetTitle'
As I wrote yesterday, this all worked just fine before all the upgrades.
I'd _really_ appreciate learning what I need to change so I can get this
working once again and get on to the rest of the application GUI.
TIA,
Rich
···
On Thu, 18 Jan 2007, Rich Shepard wrote:
What I now have is this:
--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc. | Accelerator(TM)
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863