Difference between revisions of "Dabo.ui.getFile"
(Created page with "== Signature: == <syntaxhighlight lang="python"> dabo.ui.getFile(*args, **kwargs) </syntaxhighlight> Additionally, you can pass Keyword args: * '''message=''' Text string to...")
Latest revision as of 20:33, 13 May 2020
Additionally, you can pass Keyword args:
- message= Text string to use as the prompt (title of the dialog window).
- defaultPath= Directory to use as the starting place for file dialog.
- multiple=True Allows the selection of multiple files.
Displays the file selection dialog for the platform.
Returns the path to the selected file, or
None if no selection was made.
The reason that
getFile() has the unspecified parameter list is that it is extremely flexible in how you specify the file types you want the dialog to display. It can take a single named parameter
wildcard, or you can pass in as many file extensions as you like. If the file extensions are among the types that Dabo understands, you will get a full descriptive name along with the extension. If you pass multiple extensions, the dialog's file type selector will contain an entry for each type you pass.
Understood File Extensions:
- * (All files)
- py (Python files)
- cnxml (Dabo Connection files)
- rfxml (Dabo Report Designer files)
- cdxml (Dabo Class Designer files)
- fsxml (Dabo FieldSpec files)
- html (HTML files)
- xml (XML files)
- txt (Text files)
- jpg (JPEG files)
- gif (GIF files)
- png (PNG files)
- ico (Icon files)
- bmp (Bitmap files)
dabo.ui.getFile("*", defaultPath=".") # Displays all files in current directory. dabo.ui.getFile("py", "*") # Displays either just Python scripts, or all files. dabo.ui.getFile("png", "jpg", "gif") #Allows the user to select from any of these three graphic formats.