wxPaintDC(3)
β¨ 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:
wxDCwxClientDCwxMemoryDCwxWindowDCwxScreenDC
this class is derived, and can use functions, from:
wxWindowDCwxDC
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
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms