[wxPython-users] Re: Four wx.FileDialog() Questions

Rich Shepard rshepard at appl-ecosys.com
Tue Nov 28 07:06:27 PST 2006


On Tue, 28 Nov 2006, Brian Smith wrote:

> Not sure about this one since I am limited to an older wxPython version at the
> moment.

Brian,

   I'm using 2.6.3.2 here.

> There are two problems here.  First, change wx.CANCEL to wx.ID_CANCEL in

   Sigh. How embarrassing! Thank you.

> or this, if you aren't doing anything if the user cancels:
>
>    if dlg.ShowModal() == wx.ID_OK:
>        config.projname=dlg.GetFilename()
>        config.dirname=dlg.GetDirectory()
>        self.SetTitle(('FuzzyEI-Assessor: - %s') % config.projname)
>    dlg.Destroy()

   Moving the dlg.Destroy() out of the 'if' was what I was missing.

> Just a guess here, but it looks like GTK wants an absolute path for
> something.  It may be choking on 'defaultFile="*.db"'.  This should be set to
> the default file you want selected, not to the type of file (see next
> question).  If this is not the problem and it actually wants an absolute path
> for the default path, you can use the abspath() function from os.path to
> convert self.dirname:
>
>     absdirname = os.path.abspath( self.dirname )
>
> Then use absdirname in the constructor instead of self.dirname.

   I want no file to be specified as the default, but even with that argument
deleted from the constructor the same complaint is presented. I'll look
further into this.

Many thanks,

Rich

-- 
Richard B. Shepard, Ph.D.               |    The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)    |            Accelerator
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863




More information about the wxpython-users mailing list