]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/DirDialog.py
SetStringSelection and etc. fixes
[wxWidgets.git] / wxPython / demo / DirDialog.py
CommitLineData
cf694132 1
8fa876ca 2import wx
cf694132
RD
3
4#---------------------------------------------------------------------------
5
6def runTest(frame, nb, log):
8fa876ca
RD
7
8 # In this case we include a "New directory" button.
9 dlg = wx.DirDialog(frame, "Choose a directory:",
10 style=wx.DD_DEFAULT_STYLE|wx.DD_NEW_DIR_BUTTON)
11
12 # If the user selects OK, then we process the dialog's data.
13 # This is done by getting the path data from the dialog - BEFORE
14 # we destroy it.
15 if dlg.ShowModal() == wx.ID_OK:
cf694132 16 log.WriteText('You selected: %s\n' % dlg.GetPath())
8fa876ca
RD
17
18 # Only destroy a dialog after you're done with it.
cf694132
RD
19 dlg.Destroy()
20
21#---------------------------------------------------------------------------
22
23
24
cf694132 25overview = """\
8fa876ca
RD
26This class represents the directory chooser dialog. It is used when all you
27need from the user is the name of a directory. Data is retrieved via utility
28methods; see the <code>DirDialog</code> documentation for specifics.
fe953afb 29"""
cf694132 30
cf694132 31
fe953afb
RD
32if __name__ == '__main__':
33 import sys,os
34 import run
8eca4fef 35 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
cf694132 36