]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/wxFileDialog.py
regenerated after adding DEBUG_ options
[wxWidgets.git] / wxPython / demo / wxFileDialog.py
CommitLineData
cf694132
RD
1
2from wxPython.wx import *
1fded56b 3import os
cf694132
RD
4
5#---------------------------------------------------------------------------
6
eb0f373c
RD
7wildcard = "Python source (*.py)|*.py|" \
8 "Compiled Python (*.pyc)|*.pyc|" \
9 "All files (*.*)|*.*"
10
cf694132 11def runTest(frame, nb, log):
1fded56b
RD
12 log.WriteText("CWD: %s\n" % os.getcwd())
13 dlg = wxFileDialog(frame, "Choose a file", os.getcwd(), "", wildcard,
14 wxOPEN
15 | wxMULTIPLE
16 #| wxCHANGE_DIR
17 )
cf694132 18 if dlg.ShowModal() == wxID_OK:
1e4a197e
RD
19 paths = dlg.GetPaths()
20 log.WriteText('You selected %d files:' % len(paths))
21 for path in paths:
22 log.WriteText(' %s\n' % path)
1fded56b 23 log.WriteText("CWD: %s\n" % os.getcwd())
cf694132
RD
24 dlg.Destroy()
25
26#---------------------------------------------------------------------------
27
28
29
30
31
32
33
1fded56b
RD
34overview = """\
35This class provides the file chooser dialog.
cf694132 36
1fded56b 37"""
cf694132
RD
38
39
1fded56b
RD
40if __name__ == '__main__':
41 import sys,os
42 import run
43 run.main(['', os.path.basename(sys.argv[0])])
cf694132 44