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