]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxFileDialog.py
2 from wxPython
.wx
import *
5 #---------------------------------------------------------------------------
7 wildcard
= "Python source (*.py)|*.py|" \
8 "Compiled Python (*.pyc)|*.pyc|" \
11 def runTest(frame
, nb
, log
):
12 log
.WriteText("CWD: %s\n" % os
.getcwd())
13 dlg
= wxFileDialog(frame
, "Choose a file", os
.getcwd(), "", wildcard
,
18 if dlg
.ShowModal() == wxID_OK
:
19 paths
= dlg
.GetPaths()
20 log
.WriteText('You selected %d files:' % len(paths
))
22 log
.WriteText(' %s\n' % path
)
23 log
.WriteText("CWD: %s\n" % os
.getcwd())
26 #---------------------------------------------------------------------------
35 This class provides the file chooser dialog.
40 if __name__
== '__main__':
43 run
.main(['', os
.path
.basename(sys
.argv
[0])])