]>
Commit | Line | Data |
---|---|---|
1 | ||
2 | import wx | |
3 | ||
4 | #--------------------------------------------------------------------------- | |
5 | ||
6 | def runTest(frame, nb, log): | |
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: | |
16 | log.WriteText('You selected: %s\n' % dlg.GetPath()) | |
17 | ||
18 | # Only destroy a dialog after you're done with it. | |
19 | dlg.Destroy() | |
20 | ||
21 | #--------------------------------------------------------------------------- | |
22 | ||
23 | ||
24 | ||
25 | overview = """\ | |
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. | |
29 | """ | |
30 | ||
31 | ||
32 | if __name__ == '__main__': | |
33 | import sys,os | |
34 | import run | |
35 | run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) | |
36 |