wxListView(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸ’– wxListView πŸ’–

okay bestie, so this is the wxListView(3) page β€” an Erlang module definition, and it's giving "the user-friendly bestie of a chaotic class" energy. Come sit with me, we're gonna go through it together 🫢


✨ NAME ✨

wxListView β€” 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. πŸ’…


🌸 DESCRIPTION 🌸

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. so like… future-proofing, bestie, it's the move ✨

Other than the different interface, this class is identical to wxListCtrl. In particular, it uses the same events, same window styles and so on. same vibe, different wrapping paper πŸŽ€

See: setColumnImage/3

This class is derived, and can use functions, from:

  • wxControl
  • wxWindow
  • wxEvtHandler

so it's got that whole ancestry thing going on, generational talent ngl πŸ‘‘

wxWidgets docs: wxListView


πŸ¦‹ DATA TYPES πŸ¦‹

  • wxListView() :: wx:wx_object().

that's it. one type. minimal. iconic. periodt πŸ’œ


πŸŽ€ FUNCTIONS πŸŽ€

clearColumnImage(This, Col) -> ok

clearColumnImage(This, Col) -> ok
                              when This :: wxListView(), Col :: integer().

Resets the column image β€” after calling this function, no image will be shown. it's the "and what" button bestie, poof, gone πŸ’€

See: setColumnImage/3


focus(This, Index) -> ok

focus(This, Index) -> ok
                 when This :: wxListView(), Index :: integer().

Sets focus to the item with the given index. giving that item main character energy, as it should πŸ‘‘


getFirstSelected(This) -> integer()

getFirstSelected(This) -> integer() when 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()

getFocusedItem(This) -> integer() when This :: wxListView().

Returns the currently focused item or -1 if none. lowkey rude that it can be none, but okay πŸ™ˆ

See:

  • isSelected/2
  • focus/2

getNextSelected(This, Item) -> integer()

getNextSelected(This, Item) -> integer()
                            when This :: wxListView(), Item :: integer().

Used together with getFirstSelected/1 to iterate over all selected items in the control. it's giving buddy system, and honestly? slay 🀝

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


isSelected(This, Index) -> boolean()

isSelected(This, Index) -> boolean()
                       when This :: wxListView(), Index :: integer().

Returns true if the item with the given index is selected, false otherwise. vibe check for a single row, exactly what it says on the tin βœ…

See:

  • getFirstSelected/1
  • getNextSelected/2

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

select(This, N, [Option]) -> ok
                when
                    This :: wxListView(),
                    N :: integer(),
                    Option :: {on, boolean()}.

Selects or unselects the given item.

the options situation:

  • {on, boolean()} β€” flips the item at index N selected (true) or unselected (false).
⚠️ NOTICE, BESTIE, PAY ATTENTION: 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. so like, you calling it programmatically still fires the event, no cap. the rules are different here 😭

setColumnImage(This, Col, Image) -> ok

setColumnImage(This, Col, Image) -> ok
                            when
                                This :: wxListView(),
                                Col :: integer(),
                                Image :: integer().

Sets the column image for the specified column. cute header decoration moment πŸŽ€

To use the column images, the control must have a valid image list with at least one image. no image list, no image, that's just how it is fr fr βœ‹

πŸ’‘ asides and cross-refs live in setColumnImage/3 β€” that's the one to poke at if you wanna know more about the column image shenanigans.

and that's the whole page, bestie, you ate it πŸ’…βœ¨

later, legend β€” this was Ericsson AB, from wx 2.6, on the wxListView(3) page πŸ«ΆπŸŒˆπŸ’–

πŸ“¦ where this page comes from