wxListEvent(3erl)
π wxListEvent (that's the Erlang module btw, bestie)
okay so this page is all about wxListEvent from the Erlang module definitions corner of the wx docs β like, it lives in wx 2.2.2.1 and it's brought to you by the wxWidgets team, but we'll get to that at the end π
β¨ NAME β¨
wxListEvent β literally just the functions for the wxListEvent class. that's it. that's the name section. iconic behavior honestly π
π¦ DESCRIPTION π¦
so a list event holds info about events that are associated with wxListCtrl objects. that's the whole vibe check β these are the little event packets that show up when stuff happens in a list control β¨
See: wxListCtrl
this class is derived (and can use functions) from: wxNotifyEvent, wxCommandEvent, wxEvent
wxWidgets docs: wxListEvent
πΈ EVENTS πΈ
bestie, listen β you use wxEvtHandler:connect/3 with wxListEventType to subscribe to events of this type. that's the move, no cap π«Ά
π DATA TYPES π
wxListEvent() = wx:wx_object()
wxList() =
#wxList{type = wxListEvent:wxListEventType(),
code = integer(),
oldItemIndex = integer(),
itemIndex = integer(),
col = integer(),
pointDrag = {X :: integer(), Y :: integer()}}
okay and here's the big one β the event type list, and yes i'm listing every single one of them because they all matter π
wxListEventType() =
command_list_begin_drag | command_list_begin_rdrag |
command_list_begin_label_edit | command_list_end_label_edit |
command_list_delete_item | command_list_delete_all_items |
command_list_key_down | command_list_insert_item |
command_list_col_click | command_list_col_right_click |
command_list_col_begin_drag | command_list_col_dragging |
command_list_col_end_drag | command_list_item_selected |
command_list_item_deselected | command_list_item_right_click |
command_list_item_middle_click | command_list_item_activated |
command_list_item_focused | command_list_cache_hint
π EXPORTS π
β getCacheFrom(This) -> integer()
Types:
This = wxListEvent()
for the EVT_LIST_CACHE_HINT event only, okay? it returns the first item which the list control advises us to cache. very "here's where you should start looking" energy π
β getCacheTo(This) -> integer()
Types:
This = wxListEvent()
again, EVT_LIST_CACHE_HINT event only β this one returns the last item (inclusive, don't forget that part!) which the list control advises us to cache π§
β getKeyCode(This) -> integer()
Types:
This = wxListEvent()
key code, but only if the event is a keypress event. if it's not, wellβ¦ it's not π
β getIndex(This) -> integer()
Types:
This = wxListEvent()
the item index. short and sweet, we love a low-effort icon β¨
β getColumn(This) -> integer()
Types:
This = wxListEvent()
the column position β and heads up, it is only used with COL events π
for the column dragging events, it's the column to the left of the divider being dragged. for the column click events it may be -1 if the user clicked in the list control header outside any column. yes, -1. that's the "you clicked in the void" number π
β getPoint(This) -> {X :: integer(), Y :: integer()}
Types:
This = wxListEvent()
the position of the mouse pointer, but only if the event is a drag event. very demure, very mouse-aware π
β getLabel(This) -> unicode:charlist()
Types:
This = wxListEvent()
the (new) item label β and this one's specifically for the EVT_LIST_END_LABEL_EDIT event π
β getText(This) -> unicode:charlist()
Types:
This = wxListEvent()
the text. that's it. that's the description. ngl i respect the brevity π
β getImage(This) -> integer()
Types:
This = wxListEvent()
the image π¦
β getData(This) -> integer()
Types:
This = wxListEvent()
the data β¨
β getMask(This) -> integer()
Types:
This = wxListEvent()
the mask π
β getItem(This) -> wxListItem:wxListItem()
Types:
This = wxListEvent()
an item object β used by some events. "some events" bestie, they really said figure it out π
See also wxListCtrl:setItem/5.
β isEditCancelled(This) -> boolean()
Types:
This = wxListEvent()
okay this one actually needs a whole paragraph, so listen up π
this method only makes sense for the EVT_LIST_END_LABEL_EDIT message, and it returns true if the label editing has been cancelled by the user.
and here's the little gotcha the docs are being shady about: getLabel/1 returns an empty string in this case, but it doesn't allow the application to distinguish between really cancelling the edit and the admittedly rare case when the user wants to rename it to an empty string. like β empty string could mean "they cancelled" OR "they genuinely wanted it blank" and getLabel/1 can't tell you which π that's why this function exists. use it. periodt π₯
fr fr, that's the whole page β nothing skipped, nothing merged, every option and type exactly where it belongs π«Ά
β¨ this has been wxListEvent(3erl) from the wx 2.2.2.1 docs, dated to the wx 2.2.2.1 release and signed off by the wxWidgets team β mwah, thanks for reading, ily, go cache some list items responsibly πππ¦
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms