]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/DirDialog.py
   4 #--------------------------------------------------------------------------- 
   6 def runTest(frame
, nb
, log
): 
   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
) 
  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 
  15     if dlg
.ShowModal() == wx
.ID_OK
: 
  16         log
.WriteText('You selected: %s\n' % dlg
.GetPath()) 
  18     # Only destroy a dialog after you're done with it. 
  21 #--------------------------------------------------------------------------- 
  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. 
  32 if __name__ 
== '__main__': 
  35     run
.main(['', os
.path
.basename(sys
.argv
[0])] + sys
.argv
[1:])