**************** wx.DirPickerCtrl **************** Inheritance diagram for `wx.DirPickerCtrl`: | .. inheritance-diagram:: 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). .. seealso:: `wx.DirDialog `_, `wx.FileDirPickerEvent <../Events/wx.FileDirPickerEvent.html>`_ Derived From ^^^^^^^^^^^^^ * `wx.PickerBase `_ * `wx.Control `_ * `wx.Window `_ * `wx.EvtHandler `_ * `wx.Object `_ 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 <#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 ^^^^^^^^^^^^^^^^^^ | .. figure:: ../images/wxWidgets/wxmsw/dirpickerctrl.png :alt: wxMSW :figclass: floatleft **wxMSW** .. figure:: ../images/wxWidgets/wxmac/dirpickerctrl.png :alt: wxMAC :figclass: floatright **wxMAC** .. figure:: ../images/wxWidgets/wxgtk/dirpickerctrl.png :alt: wxGTK :figclass: floatcenter **wxGTK** | Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `CheckPath <#CheckPath>`_ * `GetPath <#GetPath>`_ * `GetTextCtrlValue <#GetTextCtrlValue>`_ * `SetPath <#SetPath>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Path <#Path>`_ * `TextCtrlValue <#TextCtrlValue>`_ Class API ========= Methods ^^^^^^^ .. method:: __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:** * `parent` (`wx.Window `_) * `id` (int) * `path` (string) * `message` (string) * `pos` (`wx.Point `_) * `size` (`wx.Size `_) * `style` (long) * `validator` (`wx.Validator `_) * `name` (string) | **Returns:** `wx.DirPickerCtrl `_ -------- .. method:: CheckPath(path) | **Parameters:** * `path` (string) | **Returns:** `bool` -------- .. method:: GetPath() Returns the absolute path of the currently selected directory. | **Returns:** `string` -------- .. method:: GetTextCtrlValue() `No docstrings available for this method.` -------- .. 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 ^^^^^^^^^^ .. attribute:: Path See `GetPath <#GetPath>`_ and `SetPath <#SetPath>`_ .. attribute:: TextCtrlValue See `GetTextCtrlValue <#GetTextCtrlValue>`_