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

# wxScrollEvent(3erl)

Functions for wxScrollEvent class

## NAME

wxScrollEvent - Functions for wxScrollEvent class

## DESCRIPTION

A scroll event holds information about events sent from stand-alone scrollbars (see *wxScrollBar*) and sliders (see *wxSlider*).

Note that scrolled windows send the *wxScrollWinEvent* which does not derive from *wxCommandEvent*, but from *wxEvent* directly - don't confuse these two kinds of events and use the event table macros mentioned below only for the scrollbar-like controls.

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.

Remark: Note that unless specifying a scroll control identifier, you will need to test for scrollbar orientation with *getOrientation/1*, since horizontal and vertical scroll events are processed using the same event handler.

See: *wxScrollBar*, *wxSlider*, *wxSpinButton*, *wxScrollWinEvent*, Overview events

This class is derived (and can use functions) from: *wxCommandEvent* *wxEvent*

wxWidgets docs: wxScrollEvent

## EVENTS

Use *wxEvtHandler:connect/3* with *wxScrollEventType* to subscribe to events of this type.

## DATA TYPES

```
wxScrollEvent() = wx:wx_object()
```

```
wxScroll() =
    #wxScroll{type = wxScrollEvent:wxScrollEventType(),
              commandInt = integer(),
              extraLong = integer()}
```

```
wxScrollEventType() =
    scroll_top | scroll_bottom | scroll_lineup | scroll_linedown |
    scroll_pageup | scroll_pagedown | scroll_thumbtrack |
    scroll_thumbrelease | scroll_changed
```

## EXPORTS

```
getOrientation(This) -> integer()
```

Types:

This = wxScrollEvent()\

Returns wxHORIZONTAL or wxVERTICAL, depending on the orientation of the scrollbar.

```
getPosition(This) -> integer()
```

Types:

This = wxScrollEvent()\

Returns the position of the scrollbar.
