---
name: "wxDirPickerCtrl"
section: "3erl"
platform: "linux"
package: "erlang-manpages"
version: "1:25.2.3+dfsg-1+deb12u4"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/wxDirPickerCtrl"
---

# wxDirPickerCtrl(3erl)

Functions for wxDirPickerCtrl class

## NAME

wxDirPickerCtrl - Functions for wxDirPickerCtrl class

## DESCRIPTION

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

Styles

This class supports the following styles:

See: *wxDirDialog*, *wxFileDirPickerEvent*

This class is derived (and can use functions) from: *wxPickerBase* *wxControl* *wxWindow* *wxEvtHandler*

wxWidgets docs: wxDirPickerCtrl

## EVENTS

Event types emitted from this class: *command\_dirpicker\_changed*

## DATA TYPES

```
wxDirPickerCtrl() = wx:wx_object()
```

## EXPORTS

```
new() -> wxDirPickerCtrl()
```

```
new(Parent, Id) -> wxDirPickerCtrl()
```

Types:

Parent = wxWindow:wxWindow()\
 Id = integer()\

```
new(Parent, Id, Options :: [Option]) -> wxDirPickerCtrl()
```

Types:

Parent = wxWindow:wxWindow()\
 Id = integer()\
 Option = \
\
     {path, unicode:chardata()} \|\
\
     {message, unicode:chardata()} \|\
\
     {pos, {X :: integer(), Y :: integer()}} \|\
\
     {size, {W :: integer(), H :: integer()}} \|\
\
     {style, integer()} \|\
\
     {validator, wx:wx\_object()}\

Initializes the object and calls *create/4* with all the parameters.

```
create(This, Parent, Id) -> boolean()
```

Types:

This = wxDirPickerCtrl()\
 Parent = wxWindow:wxWindow()\
 Id = integer()\

```
create(This, Parent, Id, Options :: [Option]) -> boolean()
```

Types:

This = wxDirPickerCtrl()\
 Parent = wxWindow:wxWindow()\
 Id = integer()\
 Option = \
\
     {path, unicode:chardata()} \|\
\
     {message, unicode:chardata()} \|\
\
     {pos, {X :: integer(), Y :: integer()}} \|\
\
     {size, {W :: integer(), H :: integer()}} \|\
\
     {style, integer()} \|\
\
     {validator, wx:wx\_object()}\

Creates the widgets with the given parameters.

Return: true if the control was successfully created or false if creation failed.

```
getPath(This) -> unicode:charlist()
```

Types:

This = wxDirPickerCtrl()\

Returns the absolute path of the currently selected directory.

```
setPath(This, Dirname) -> ok
```

Types:

This = wxDirPickerCtrl()\
 Dirname = unicode:chardata()\

Sets the absolute path of the currently selected directory.

If the control uses *wxDIRP\_DIR\_MUST\_EXIST* and does not use *wxDIRP\_USE\_TEXTCTRL* style, the *dirname* must be a name of an existing directory and will be simply ignored by the native wxGTK implementation if this is not the case.

```
destroy(This :: wxDirPickerCtrl()) -> ok
```

Destroys the object.
