]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/DirDialog.py
doc tweaks, typo fixed, etc.
[wxWidgets.git] / wxPython / demo / DirDialog.py
1 # 11/17/2003 - Jeff Grimmett (grimmtooth@softhome.net)
2 #
3 # o Updated for wx namespace
4 #
5
6 import wx
7
8 #---------------------------------------------------------------------------
9
10 def runTest(frame, nb, log):
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:
20 log.WriteText('You selected: %s\n' % dlg.GetPath())
21
22 # Only destroy a dialog after you're done with it.
23 dlg.Destroy()
24
25 #---------------------------------------------------------------------------
26
27
28
29 overview = """\
30 This class represents the directory chooser dialog. It is used when all you
31 need from the user is the name of a directory. Data is retrieved via utility
32 methods; see the <code>DirDialog</code> documentation for specifics.
33 """
34
35
36 if __name__ == '__main__':
37 import sys,os
38 import run
39 run.main(['', os.path.basename(sys.argv[0])])
40