]>
Commit | Line | Data |
---|---|---|
cf694132 | 1 | |
8fa876ca | 2 | import wx |
cf694132 RD |
3 | |
4 | #--------------------------------------------------------------------------- | |
5 | ||
6 | def 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 | 25 | overview = """\ |
8fa876ca RD |
26 | This class represents the directory chooser dialog. It is used when all you |
27 | need from the user is the name of a directory. Data is retrieved via utility | |
28 | methods; see the <code>DirDialog</code> documentation for specifics. | |
fe953afb | 29 | """ |
cf694132 | 30 | |
cf694132 | 31 | |
fe953afb RD |
32 | if __name__ == '__main__': |
33 | import sys,os | |
34 | import run | |
8eca4fef | 35 | run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) |
cf694132 | 36 |