wxEraseEvent(3)

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

πŸ’… wxEraseEvent

okay so bestie, this is the Erlang module definition for wxEraseEvent, straight outta the wx world ✨


🌸 NAME 🌸

wxEraseEvent β€” an erase event gets sent when a window's background needs to be repainted. that's it, that's the vibe 🎨


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, and it's important tea: on some platforms β€” GTK+ being the main character here πŸ‘‘ β€” this event is simulated. like, it's just generated right before the paint event, and it may cause flicker 😭

so the recommendation is: set the text background colour explicitly to prevent that flicker. no cap. also, the default background colour under GTK+ is grey. remember that. 🩢

to intercept this event, use the EVT_ERASE_BACKGROUND macro in an event table definition. periodt.

⚠️ read this twice, bestie: you must use the device context returned by getDC/1 to draw on. do not create a wxPaintDC in the event handler. like, don't. i'm serious. πŸ’€

see: Overview events

this class is derived from β€” and can use functions from β€” this absolute legend:

  • wxEvent 🫢

wxWidgets docs: wxEraseEvent

✨ Events ✨

use wxEvtHandler:connect/3 with wxEraseEventType to subscribe to events of this type. slay, you're subscribed πŸ’–


πŸŽ€ DATA TYPES πŸŽ€

  • wxErase() :: #wxErase{}.
  • wxEraseEvent() :: wx:wx_object().
  • wxEraseEventType() :: erase_background.

πŸ’œ FUNCTIONS πŸ’œ

  • getDC(This) -> wxDC:wxDC() when This :: wxEraseEvent(). β€” returns the device context associated with the erase event, so you can draw on it. πŸ–ŒοΈ

the returned pointer is never NULL. iconic behaviour, honestly. ✨


Ericsson AB Β· wx 2.6 β€” mwah, that's the whole page bestie, go forth and erase those backgrounds responsibly πŸ¦‹πŸ’…πŸŒˆ

πŸ“¦ where this page comes from