X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0122b7e3fcfd78f879470053c91a60e3c66537a3..bfdc04a9bb95e6865570d59192718052b6229221:/wxPython/demo/wxFileDialog.py?ds=inline diff --git a/wxPython/demo/wxFileDialog.py b/wxPython/demo/wxFileDialog.py index eda3e882d1..a87dc17194 100644 --- a/wxPython/demo/wxFileDialog.py +++ b/wxPython/demo/wxFileDialog.py @@ -1,13 +1,26 @@ from wxPython.wx import * +import os #--------------------------------------------------------------------------- +wildcard = "Python source (*.py)|*.py|" \ + "Compiled Python (*.pyc)|*.pyc|" \ + "All files (*.*)|*.*" + def runTest(frame, nb, log): - dlg = wxFileDialog(frame, "Choose a file", ".", "", "*.*", wxOPEN|wxMULTIPLE) + log.WriteText("CWD: %s\n" % os.getcwd()) + dlg = wxFileDialog(frame, "Choose a file", os.getcwd(), "", wildcard, + wxOPEN + | wxMULTIPLE + #| wxCHANGE_DIR + ) if dlg.ShowModal() == wxID_OK: - for path in dlg.GetPaths(): - log.WriteText('You selected: %s\n' % path) + paths = dlg.GetPaths() + log.WriteText('You selected %d files:' % len(paths)) + for path in paths: + log.WriteText(' %s\n' % path) + log.WriteText("CWD: %s\n" % os.getcwd()) dlg.Destroy() #--------------------------------------------------------------------------- @@ -18,14 +31,14 @@ def runTest(frame, nb, log): +overview = """\ +This class provides the file chooser dialog. +""" +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])]) - - - -overview = """\ -This class represents the file chooser dialog. - -"""