wx.DirPickerCtrl

Inheritance diagram for wx.DirPickerCtrl:



Description

This control allows the user to select a directory. The generic implementation is a button which brings up a wx.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 wx.USE_DIRPICKERCTRL is set to 1 (the default).

Window Styles

Window Style Description
wx.DIRP_DEFAULT_STYLE The default style: includes wx.DIRP_DIR_MUST_EXIST and, under wxMSW only, wx.DIRP_USE_TEXTCTRL.
wx.DIRP_USE_TEXTCTRL Creates a text control to the left of the picker button which is completely managed by the wx.DirPickerCtrl and which can be used by the user to specify a path (see SetPath). The text control is automatically synchronized with button’s value.
wx.DIRP_DIR_MUST_EXIST Creates a picker which allows to select only existing directories. wxGTK control always adds this flag internally as it does not support its absence.
wx.DIRP_CHANGE_DIR Change current working directory on each user directory selection change.

Event Handling

Event Name Description
wx.EVT_DIRPICKER_CHANGED(id, func) The user changed the directory selected in the control either using the button or using text control (see wx.DIRP_USE_TEXTCTRL; note that in this case the event is fired only if the user’s input is valid, e.g. an existing directory path).

Control Appearance


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


Properties Summary

Class API

Methods

__init__(parent, id=-1, path="", message=wx.DirSelectorPromptStr, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DIRP_DEFAULT_STYLE, validator=wx.DefaultValidator, name=wx.DirPickerCtrlNameStr)

Constructor.

Parameters:


Returns:

wx.DirPickerCtrl


CheckPath(path)

Parameters:

  • path (string)

Returns:

bool


GetPath()

Returns the absolute path of the currently selected directory.


Returns:

string


GetTextCtrlValue()
No docstrings available for this method.

SetPath(dirname)

Sets the absolute path of the currently selected directory. This must be a valid directory if wx.DIRP_DIR_MUST_EXIST style was given.

Parameters:

  • dirname (string)

Properties

Path
See GetPath and SetPath
TextCtrlValue
See GetTextCtrlValue