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

# wxSlider(3erl)

Functions for wxSlider class

## NAME

wxSlider - Functions for wxSlider class

## DESCRIPTION

A slider is a control with a handle which can be pulled back and forth to change the value.

On Windows, the track bar control is used.

On GTK+, tick marks are only available for version 2.16 and later.

Slider generates the same events as *wxScrollBar* but in practice the most convenient way to process *wxSlider* updates is by handling the slider-specific *wxEVT\_SLIDER* event which carries *wxCommandEvent* containing just the latest slider position.

Styles

This class supports the following styles:

The difference between EVT\_SCROLL\_THUMBRELEASE and EVT\_SCROLL\_CHANGED

The EVT\_SCROLL\_THUMBRELEASE event is only emitted when actually dragging the thumb using the mouse and releasing it (This EVT\_SCROLL\_THUMBRELEASE event is also followed by an EVT\_SCROLL\_CHANGED event).

The EVT\_SCROLL\_CHANGED event also occurs when using the keyboard to change the thumb position, and when clicking next to the thumb (In all these cases the EVT\_SCROLL\_THUMBRELEASE event does not happen). In short, the EVT\_SCROLL\_CHANGED event is triggered when scrolling/ moving has finished independently of the way it had started. Please see the page\_samples\_widgets ("Slider" page) to see the difference between EVT\_SCROLL\_THUMBRELEASE and EVT\_SCROLL\_CHANGED in action.

See: Overview events, *wxScrollBar*

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

wxWidgets docs: wxSlider

## EVENTS

Event types emitted from this class: *scroll\_top*, *scroll\_bottom*, *scroll\_lineup*, *scroll\_linedown*, *scroll\_pageup*, *scroll\_pagedown*, *scroll\_thumbtrack*, *scroll\_thumbrelease*, *scroll\_changed*, *scroll\_top*, *scroll\_bottom*, *scroll\_lineup*, *scroll\_linedown*, *scroll\_pageup*, *scroll\_pagedown*, *scroll\_thumbtrack*, *scroll\_thumbrelease*, *scroll\_changed*, *command\_slider\_updated*

## DATA TYPES

```
wxSlider() = wx:wx_object()
```

## EXPORTS

```
new() -> wxSlider()
```

Default constructor.

```
new(Parent, Id, Value, MinValue, MaxValue) -> wxSlider()
```

Types:

Parent = wxWindow:wxWindow()\
 Id = Value = MinValue = MaxValue = integer()\

```
new(Parent, Id, Value, MinValue, MaxValue, Options :: [Option]) ->
       wxSlider()
```

Types:

Parent = wxWindow:wxWindow()\
 Id = Value = MinValue = MaxValue = integer()\
 Option = \
\
     {pos, {X :: integer(), Y :: integer()}} \|\
\
     {size, {W :: integer(), H :: integer()}} \|\
\
     {style, integer()} \|\
\
     {validator, wx:wx\_object()}\

Constructor, creating and showing a slider.

See: *create/7*, *wxValidator* (not implemented in wx)

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

Destructor, destroying the slider.

```
create(This, Parent, Id, Value, MinValue, MaxValue) -> boolean()
```

Types:

This = wxSlider()\
 Parent = wxWindow:wxWindow()\
 Id = Value = MinValue = MaxValue = integer()\

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

Types:

This = wxSlider()\
 Parent = wxWindow:wxWindow()\
 Id = Value = MinValue = MaxValue = integer()\
 Option = \
\
     {pos, {X :: integer(), Y :: integer()}} \|\
\
     {size, {W :: integer(), H :: integer()}} \|\
\
     {style, integer()} \|\
\
     {validator, wx:wx\_object()}\

Used for two-step slider construction.

See *new/6* for further details.

```
getLineSize(This) -> integer()
```

Types:

This = wxSlider()\

Returns the line size.

See: *setLineSize/2*

```
getMax(This) -> integer()
```

Types:

This = wxSlider()\

Gets the maximum slider value.

See: *getMin/1*, *setRange/3*

```
getMin(This) -> integer()
```

Types:

This = wxSlider()\

Gets the minimum slider value.

See: *getMin/1*, *setRange/3*

```
getPageSize(This) -> integer()
```

Types:

This = wxSlider()\

Returns the page size.

See: *setPageSize/2*

```
getThumbLength(This) -> integer()
```

Types:

This = wxSlider()\

Returns the thumb length.

Only for:wxmsw

See: *setThumbLength/2*

```
getValue(This) -> integer()
```

Types:

This = wxSlider()\

Gets the current slider value.

See: *getMin/1*, *getMax/1*, *setValue/2*

```
setLineSize(This, LineSize) -> ok
```

Types:

This = wxSlider()\
 LineSize = integer()\

Sets the line size for the slider.

See: *getLineSize/1*

```
setPageSize(This, PageSize) -> ok
```

Types:

This = wxSlider()\
 PageSize = integer()\

Sets the page size for the slider.

See: *getPageSize/1*

```
setRange(This, MinValue, MaxValue) -> ok
```

Types:

This = wxSlider()\
 MinValue = MaxValue = integer()\

Sets the minimum and maximum slider values.

See: *getMin/1*, *getMax/1*

```
setThumbLength(This, Len) -> ok
```

Types:

This = wxSlider()\
 Len = integer()\

Sets the slider thumb length.

Only for:wxmsw

See: *getThumbLength/1*

```
setValue(This, Value) -> ok
```

Types:

This = wxSlider()\
 Value = integer()\

Sets the slider position.
