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

# wxListView(3erl)

Functions for wxListView class

## NAME

wxListView - Functions for wxListView class

## DESCRIPTION

This class currently simply presents a simpler to use interface for the *wxListCtrl* - it can be thought of as a *façade* for that complicated class.

Using it is preferable to using *wxListCtrl* directly whenever possible because in the future some ports might implement *wxListView* but not the full set of *wxListCtrl* features.

Other than different interface, this class is identical to *wxListCtrl*. In particular, it uses the same events, same window styles and so on.

See: *setColumnImage/3*

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

wxWidgets docs: wxListView

## DATA TYPES

```
wxListView() = wx:wx_object()
```

## EXPORTS

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

Types:

This = wxListView()\
 Col = integer()\

Resets the column image - after calling this function, no image will be shown.

See: *setColumnImage/3*

```
focus(This, Index) -> ok
```

Types:

This = wxListView()\
 Index = integer()\

Sets focus to the item with the given *index*.

```
getFirstSelected(This) -> integer()
```

Types:

This = wxListView()\

Returns the first selected item in a (presumably) multiple selection control.

Together with *getNextSelected/2* it can be used to iterate over all selected items in the control.

Return: The first selected item, if any, -1 otherwise.

```
getFocusedItem(This) -> integer()
```

Types:

This = wxListView()\

Returns the currently focused item or -1 if none.

See: *isSelected/2*, *focus/2*

```
getNextSelected(This, Item) -> integer()
```

Types:

This = wxListView()\
 Item = integer()\

Used together with *getFirstSelected/1* to iterate over all selected items in the control.

Return: Returns the next selected item or -1 if there are no more of them.

```
isSelected(This, Index) -> boolean()
```

Types:

This = wxListView()\
 Index = integer()\

Returns true if the item with the given *index* is selected, false otherwise.

See: *getFirstSelected/1*, *getNextSelected/2*

```
select(This, N) -> ok
```

Types:

This = wxListView()\
 N = integer()\

```
select(This, N, Options :: [Option]) -> ok
```

Types:

This = wxListView()\
 N = integer()\
 Option = {on, boolean()}\

Selects or unselects the given item.

Notice that this method inherits the unusual behaviour of *wxListCtrl:setItemState/4* which sends a wxEVT\_LIST\_ITEM\_SELECTED event when it is used to select an item, contrary to the usual rule that only the user actions result in selection.

```
setColumnImage(This, Col, Image) -> ok
```

Types:

This = wxListView()\
 Col = Image = integer()\

Sets the column image for the specified column.

To use the column images, the control must have a valid image list with at least one image.
