---
name: "wxColourPickerCtrl"
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/wxColourPickerCtrl"
---

# wxColourPickerCtrl(3erl)

Functions for wxColourPickerCtrl class

## NAME

wxColourPickerCtrl - Functions for wxColourPickerCtrl class

## DESCRIPTION

This control allows the user to select a colour. The generic implementation is a button which brings up a *wxColourDialog* when clicked. Native implementation may differ but this is usually a (small) widget which give access to the colour-chooser dialog. It is only available if *wxUSE\_COLOURPICKERCTRL* is set to 1 (the default).

Styles

This class supports the following styles:

See: *wxColourDialog*, *wxColourPickerEvent*

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

wxWidgets docs: wxColourPickerCtrl

## EVENTS

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

## DATA TYPES

```
wxColourPickerCtrl() = wx:wx_object()
```

## EXPORTS

```
new() -> wxColourPickerCtrl()
```

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

Types:

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

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

Types:

Parent = wxWindow:wxWindow()\
 Id = integer()\
 Option = \
\
     {col, wx:wx\_colour()} \|\
\
     {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 = wxColourPickerCtrl()\
 Parent = wxWindow:wxWindow()\
 Id = integer()\

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

Types:

This = wxColourPickerCtrl()\
 Parent = wxWindow:wxWindow()\
 Id = integer()\
 Option = \
\
     {col, wx:wx\_colour()} \|\
\
     {pos, {X :: integer(), Y :: integer()}} \|\
\
     {size, {W :: integer(), H :: integer()}} \|\
\
     {style, integer()} \|\
\
     {validator, wx:wx\_object()}\

Creates a colour picker with the given arguments.

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

```
getColour(This) -> wx:wx_colour4()
```

Types:

This = wxColourPickerCtrl()\

Returns the currently selected colour.

```
setColour(This, Colname) -> ok
```

```
setColour(This, Col) -> ok
```

Types:

This = wxColourPickerCtrl()\
 Col = wx:wx\_colour()\

Sets the currently selected colour.

See *wxColour::Set()* (not implemented in wx).

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

Destroys the object.
