]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxFileDialog_Save.py
wxPython Merge #2 of 2.4 branch --> HEAD (branch tag: wxPy_2_4_merge_2)
[wxWidgets.git] / wxPython / demo / wxFileDialog_Save.py
1
2 from wxPython.wx import *
3 import os
4
5 #---------------------------------------------------------------------------
6
7 wildcard = "Python source (*.py)|*.py|" \
8 "Compiled Python (*.pyc)|*.pyc|" \
9 "SPAM files (*.spam)|*.spam|" \
10 "Egg file (*.egg)|*.egg|" \
11 "All files (*.*)|*.*"
12
13 def runTest(frame, nb, log):
14 log.WriteText("CWD: %s\n" % os.getcwd())
15 dlg = wxFileDialog(frame, "Save file as...", os.getcwd(), "", wildcard,
16 wxSAVE
17 #| wxCHANGE_DIR
18 )
19 dlg.SetFilterIndex(2)
20 if dlg.ShowModal() == wxID_OK:
21 path = dlg.GetPath()
22 log.WriteText('You selected "%s"' % path)
23 log.WriteText("CWD: %s\n" % os.getcwd())
24 dlg.Destroy()
25
26 #---------------------------------------------------------------------------
27
28
29
30
31
32
33
34 overview = """\
35 This class provides the file chooser dialog.
36
37 """
38
39
40 if __name__ == '__main__':
41 import sys,os
42 import run
43 run.main(['', os.path.basename(sys.argv[0])])
44