]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/demo/wxFileDialog.py
fix text scrolling in GTK2 (patch 703988)
[wxWidgets.git] / wxPython / demo / wxFileDialog.py
... / ...
CommitLineData
1
2from wxPython.wx import *
3import os
4
5#---------------------------------------------------------------------------
6
7wildcard = "Python source (*.py)|*.py|" \
8 "Compiled Python (*.pyc)|*.pyc|" \
9 "All files (*.*)|*.*"
10
11def runTest(frame, nb, log):
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 )
18 if dlg.ShowModal() == wxID_OK:
19 paths = dlg.GetPaths()
20 log.WriteText('You selected %d files:' % len(paths))
21 for path in paths:
22 log.WriteText(' %s\n' % path)
23 log.WriteText("CWD: %s\n" % os.getcwd())
24 dlg.Destroy()
25
26#---------------------------------------------------------------------------
27
28
29
30
31
32
33
34overview = """\
35This class provides the file chooser dialog.
36
37"""
38
39
40if __name__ == '__main__':
41 import sys,os
42 import run
43 run.main(['', os.path.basename(sys.argv[0])])
44