MMpy.GUI.load_dialog
Syntax
MMpy.GUI.load_dialog(title='', default='', filter='')
Description
Creates a load file dialog, and returns the chosen path.
Parameters
Name |
Type |
Description |
---|---|---|
title |
str (optional) | The title of the file browser dialog. |
default |
str (optional) | Default path and/or file. |
filter | str (optional) | File browser filter. |
Returns
Type |
Description |
---|---|
str | Returns the user's selection. |
See Also
MMpy.GUI.save_dialog()
Notes
The filter parameter needs to follow a format. Each item in the filter parameter corresponds to a file type filter within the selection dialog. The overall string has to end with a 2 pipe characters.
Each item contains 2 sub-items, the description and the extension, which are separated by the pipe character.
To add multiple items, separate each of them with a pipe.
To have more than one extension per item, separate each extension with a semicolon.
For example, to allow the user to select specific types of Micromine files, or all files: Micromine Files|*.DAT;*.STR;*.SVY|All Files|*.*||"
A blank filter will cause the dialog to use the all files filter.
If the dialog was closed without selecting a file, the default path will be returned. By default this is a blank string.
This is a static class method.
Examples
path = MMpy.GUI.load_dialog(title='Open block model', filter="Micromine Files|*.DAT||")
Resource ID
IDPH_GUI_FILELOAD