wxClipboardTextEvent(3)

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

πŸ’– wxClipboardTextEvent πŸ’–

okay bestie, this is the Erlang side of wxClipboardTextEvent β€” yes, the clipboard drama module. get comfy 🫢


✨ NAME ✨

wxClipboardTextEvent β€” the class that reps the events a control throws when its content gets copied or cut to, or pasted from, the clipboard. normally it's a wxTextCtrl doing this, but other windows can generate these events too, so don't come for them πŸ’…


🌸 DESCRIPTION 🌸

so there are three types of these events, and they are:

  • wxEVT_TEXT_COPY
  • wxEVT_TEXT_CUT
  • wxEVT_TEXT_PASTE

here's the tea πŸ“: if an event handler processes one of these (and doesn't skip it), then the corresponding operation just doesn't happen. lowkey iconic, because that means you can stop text from ever being copied from or pasted to a control. gatekeeping the clipboard, fr fr.

and the PASTE event handler is where it gets fun β€” you can actually peek at the clipboard contents there and transform them however you want before they're inserted into the control. changing its case? removing invalid characters? slay. do your thing.

also, important detail for the girlies who hate doing extra work: a CUT event is always preceded by the COPY event. so if you genuinely do not care whether the text was copied or cut, you can just handle COPY and call it a day. efficiency queen πŸ‘‘

note: these events are currently only generated by wxTextCtrl in wxGTK and wxOSX, but they're also generated by wxComboBox without the wxCB_READONLY style in wxMSW. check your platform, bestie.

see: wxClipboard

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

  • wxCommandEvent
  • wxEvent

wxWidgets docs: wxClipboardTextEvent

πŸ¦‹ Events πŸ¦‹

use wxEvtHandler:connect/3 with wxClipboardTextEventType to subscribe to events of this type. that's the whole vibe check πŸ’œ


πŸŽ€ DATA TYPES πŸŽ€

  • wxClipboardText() :: #wxClipboardText{}.
  • wxClipboardTextEvent() :: wx:wx_object().
  • wxClipboardTextEventType() :: command_text_copy | command_text_cut | command_text_paste.

⭐ FUNCTIONS ⭐

(nothing listed here, bestie β€” this section is giving empty plate at the function buffet 😭)


and that's the whole page, no cap. brought to you by Ericsson AB, version wx 2.6 β€” thanks for coming to my ted talk, mwah πŸ’‹βœ¨πŸ‘‘

πŸ“¦ where this page comes from