This control allows the user to select a directory.
The generic implementation is a button which brings up a DirDialog when clicked. Native implementation may differ but this is usually a (small) widget which give access to the dir-chooser dialog. It is only available if USE_DIRPICKERCTRL is set to 1 (the default).
This class supports the following styles:
Handlers bound for the following event types will receive a FileDirPickerEvent parameter.
See also
__init__ | |
Create | Creates the widgets with the given parameters. |
GetPath | Returns the absolute path of the currently selected directory. |
SetInitialDirectory | Set the directory to show when starting to browse for directories. |
SetPath | Sets the absolute path of (the default converter uses current locale’s charset)the currently selected directory. |
This control allows the user to select a directory.
Possible constructors:
DirPickerCtrl()
DirPickerCtrl(parent, id=ID_ANY, path='',
message=DirSelectorPromptStr, pos=DefaultPosition, size=DefaultSize,
style=DIRP_DEFAULT_STYLE, validator=DefaultValidator,
name=DirPickerCtrlNameStr)
Overloaded Implementations:
__init__ (self)
__init__ (self, parent, id=ID_ANY, path=’‘, message=DirSelectorPromptStr, pos=DefaultPosition, size=DefaultSize, style=DIRP_DEFAULT_STYLE, validator=DefaultValidator, name=DirPickerCtrlNameStr)
Initializes the object and calls Create with all the parameters.
Parameters: |
---|
Creates the widgets with the given parameters.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | True if the control was successfully created or False if creation failed. |
Returns the absolute path of the currently selected directory.
Return type: | string |
---|
Set the directory to show when starting to browse for directories.
This function is mostly useful for the directory picker controls which have no selection initially to configure the directory that should be shown if the user starts browsing for directories as otherwise the initially selected directory is used, which is usually the desired behaviour and so the directory specified by this function is ignored in this case.
Parameters: | dir (string) – |
---|
New in version 2.9.4.
Sets the absolute path of (the default converter uses current locale’s charset)the currently selected directory.
This must be a valid directory if DIRP_DIR_MUST_EXIST style was given.
Parameters: | dirname (string) – |
---|