FileDialog

So I've read through what documentation I could find, but I can't seem to get wx.FileDialog to work. Can anyone point me to a working example? Thanks.

Mark Kegel

Did you take a look at the demo (Demo -> Common Dialogs -> File Dialog) ?

Harald Stürzebecher

···

2005/6/8, Mark Kegel <mark_kegel@hmc.edu>:

So I've read through what documentation I could find, but I can't
seem to get wx.FileDialog to work. Can anyone point me to a working
example? Thanks.

Ok I found the demo stuff and I think I've got more problems than just trying to open a simple FileDialog. I tried the demo program (FileDialog.py) and got the following error dialog when I clicked the button to create an OPEN FileDialog:

../src/common/string.cpp(1060): assert "nLen != (size_t)-1" failed.
Do you want to stop the program?
You can also choose [Cancel] to suppress further warnings.

So now I'm a little bit confused on how to proceed. Has anyone else encountered this error before? I'm guessing it might have something to do with the difference between ANSI and unicode.

Just to help out the demo version was written for wxPython 2.6.1.0 and the python version I have installed is 2.4.1. The wxPython version I have installed is 2.5.3.1, although I don't really think that this should be an issue.

Mark Kegel

···

On Jun 7, 2005, at 6:45 PM, Harald Stürzebecher wrote:

2005/6/8, Mark Kegel <mark_kegel@hmc.edu>:

So I've read through what documentation I could find, but I can't
seem to get wx.FileDialog to work. Can anyone point me to a working
example? Thanks.

Did you take a look at the demo (Demo -> Common Dialogs -> File Dialog) ?

Harald Stürzebecher

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

def MenuFileOpen(self, event):
            wildcard = "Project file (*.afp)|*.afp|" \
                        "All files (*.*)|*.*"
               dlg = wx.wxFileDialog(self, "Choose a file", os.getcwd(), "", wildcard,
                        wx.wxOPEN | wx.wxMULTIPLE | wx.wxCHANGE_DIR)
            if dlg.ShowModal() == wx.wxID_OK:
                paths = dlg.GetPaths()

Best Regards
Leonid

Mark Kegel wrote:

···

Ok I found the demo stuff and I think I've got more problems than just trying to open a simple FileDialog. I tried the demo program (FileDialog.py) and got the following error dialog when I clicked the button to create an OPEN FileDialog:

../src/common/string.cpp(1060): assert "nLen != (size_t)-1" failed.
Do you want to stop the program?
You can also choose [Cancel] to suppress further warnings.

So now I'm a little bit confused on how to proceed. Has anyone else encountered this error before? I'm guessing it might have something to do with the difference between ANSI and unicode.

Just to help out the demo version was written for wxPython 2.6.1.0 and the python version I have installed is 2.4.1. The wxPython version I have installed is 2.5.3.1, although I don't really think that this should be an issue.

Mark Kegel

On Jun 7, 2005, at 6:45 PM, Harald Stürzebecher wrote:

2005/6/8, Mark Kegel <mark_kegel@hmc.edu>:

So I've read through what documentation I could find, but I can't
seem to get wx.FileDialog to work. Can anyone point me to a working
example? Thanks.

Did you take a look at the demo (Demo -> Common Dialogs -> File Dialog) ?

Harald Stürzebecher

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users- help@lists.wxwidgets.org

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Mark Kegel wrote:

Ok I found the demo stuff and I think I've got more problems than just trying to open a simple FileDialog. I tried the demo program (FileDialog.py) and got the following error dialog when I clicked the button to create an OPEN FileDialog:

../src/common/string.cpp(1060): assert "nLen != (size_t)-1" failed.
Do you want to stop the program?
You can also choose [Cancel] to suppress further warnings.

So now I'm a little bit confused on how to proceed. Has anyone else encountered this error before? I'm guessing it might have something to do with the difference between ANSI and unicode.

Just to help out the demo version was written for wxPython 2.6.1.0 and the python version I have installed is 2.4.1. The wxPython version I have installed is 2.5.3.1, although I don't really think that this should be an issue.

Please try with a newer wxPython just to be sure. There was a bug in unicode/ansi conversion at one time that would result in this assertion.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!