wxPaintDC(3)

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

✨ wxPaintDC ✨

okay bestie, welcome to the wxPaintDC page of the Erlang module definitions πŸ’– this one's short and sweet but it's so important, iykyk.


πŸ’… NAME πŸ’…

wxPaintDC β€” a wxPaintDC must be constructed if an application wishes to paint on the client area of a window from within an EVT_PAINT() event handler.

like, no cap, this is the one rule of paint events. periodt.


πŸŽ€ DESCRIPTION πŸŽ€

okay so here's the vibe: this thing should normally be constructed as a temporary stack object. do NOT store a wxPaintDC object. it's giving "here for a good time not a long time", and storing it is lowkey a crime πŸ™ˆ

and if you've got an EVT_PAINT() handler? you must create a wxPaintDC object inside it, even if you literally never use it. yes, even then. the way that it just has to be there. iconic behaviour honestly πŸ‘‘

using wxPaintDC inside your EVT_PAINT() handler is important because it automatically sets the clipping area to the damaged area of the window. so if you try to draw outside that area? it just does not show up. does not appear. ghosted. πŸ’€

also, a wxPaintDC object is initialized to use the same font and colours as the window it's associated with. matching energy, always ✨

see also, bestie:

  • wxDC
  • wxClientDC
  • wxMemoryDC
  • wxWindowDC
  • wxScreenDC

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

  • wxWindowDC
  • wxDC

family tree ate that fr fr 🌈

wxWidgets docs: wxPaintDC


πŸ¦‹ DATA TYPES πŸ¦‹

wxPaintDC() :: wx:wx_object().

that's it, that's the type πŸ’œ


🌸 FUNCTIONS 🌸

  • destroy(This :: wxPaintDC()) -> ok β€” destroys the object. bye bestie, thank u for ur service 🫢
  • new(Window) -> wxPaintDC() when Window :: wxWindow:wxWindow() β€” the constructor πŸŽ€

pass a pointer to the window on which you wish to paint. that's it! go paint your little heart out πŸ’–


⚠️ reminder from your favourite unix girlie: do not store your wxPaintDC. stack object only. temporary. main character but make it brief. ✨

okay that's the whole page and we ate, no crumbs πŸ“ this was Ericsson AB's wx 2.6 docs for wxPaintDC(3), and that's the whole vibe check, mwah πŸ’…πŸŒˆ

πŸ“¦ where this page comes from