wxTreeEvent(3)

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

πŸ’– wxTreeEvent β€” ok bestie, let's talk tree events πŸ’–

So this is the wxTreeEvent(3) page β€” the Erlang module definition for everything a tree control wants to yell at you about. Grab a boba, we're going in 🧚✨


🌸 NAME 🌸

wxTreeEvent β€” a tree event holds information about events associated with wxTreeCtrl objects. literally its whole job, no cap πŸ’…


✨ DESCRIPTION ✨

Okay so. To process input from a tree control, you use these event handler macros to direct input to member functions that take a wxTreeEvent argument. That's the whole vibe 🫢

See: wxTreeCtrl

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

  • wxNotifyEvent
  • wxCommandEvent
  • wxEvent

wxWidgets docs: wxTreeEvent

πŸŽ€ Events πŸŽ€

Use wxEvtHandler:connect/3 with wxTreeEventType to subscribe to events of this type. that's the plug, bestie πŸ”Œ


πŸ¦‹ DATA TYPES πŸ¦‹

wxTree() :: #wxTree{}.

wxTreeEvent() :: wx:wx_object().

wxTreeEventType() ::
          command_tree_begin_drag | command_tree_begin_rdrag |
          command_tree_begin_label_edit | command_tree_end_label_edit |
          command_tree_delete_item | command_tree_get_info |
          command_tree_set_info | command_tree_item_expanded |
          command_tree_item_expanding | command_tree_item_collapsed |
          command_tree_item_collapsing | command_tree_sel_changed |
          command_tree_sel_changing | command_tree_key_down |
          command_tree_item_activated | command_tree_item_right_click |
          command_tree_item_middle_click | command_tree_end_drag |
          command_tree_state_image_click |
          command_tree_item_gettooltip | command_tree_item_menu |
          dirctrl_selectionchanged | dirctrl_fileactivated.

like look at that list. it ate. it devoured. 🌈


πŸ‘‘ FUNCTIONS πŸ‘‘

getItem(This) -> integer() when This :: wxTreeEvent().

Returns the item β€” and this one is valid for all events. universal icon behavior fr πŸ’–

getKeyCode(This) -> integer() when This :: wxTreeEvent().

Returns the key code if the event is a key event. πŸ”‘

Use getKeyEvent/1 to get the values of the modifier keys for this event (i.e. Shift or Ctrl). don't sleep on the modifiers, they're the main character here.

getKeyEvent(This) -> wxKeyEvent:wxKeyEvent() when This :: wxTreeEvent().

Returns the key event for EVT_TREE_KEY_DOWN events. periodt.

getLabel(This) -> unicode:charlist() when This :: wxTreeEvent().

Returns the label, if the event is a begin or end edit label event. πŸŽ€

getOldItem(This) -> integer() when This :: wxTreeEvent().

Returns the old item index β€” valid for EVT_TREE_SEL_CHANGING and EVT_TREE_SEL_CHANGED events. the old one, bestie, not the new one, keep up πŸ’…

getPoint(This) -> {X :: integer(), Y :: integer()} when This :: wxTreeEvent().

Returns the position of the mouse pointer if the event is a drag or menu-context event. πŸ–±οΈ

In both cases the position is in client coordinates β€” i.e. relative to the wxTreeCtrl window (so that you can pass it directly to e.g. wxWindow:popupMenu/4). isn't that convenient? obsessed.

isEditCancelled(This) -> boolean() when This :: wxTreeEvent().

Returns true if the label edit was cancelled. 😭

This should be called from within an EVT_TREE_END_LABEL_EDIT handler.

⚠️ okay so for real though β€” call this from inside that EVT_TREE_END_LABEL_EDIT handler. that's the assignment. don't do it somewhere else and then act surprised.

setToolTip(This, Tooltip) -> ok when This :: wxTreeEvent(), Tooltip :: unicode:chardata().

Set the tooltip for the item β€” valid for EVT_TREE_ITEM_GETTOOLTIP events. πŸ’¬

🌸 Windows only. just so you know before you go hunting for bugs on your Mac, bestie πŸ™ˆ

and that's the whole page!! you understood it, I know you did, you're literally so smart 🫢✨

this little love letter was brought to you by Ericsson AB, wx 2.6, and the one and only wxTreeEvent(3) β€” mwah, go slay πŸ’…πŸ’–πŸŒˆ

πŸ“¦ where this page comes from