wxPaintEvent(3)
โจ wxPaintEvent โจ
okay bestie, welcome to the wxPaintEvent era of the Erlang wx docs (manual name: wxPaintEvent, section 3, Erlang Module Definition, in case you were wondering which man page you wandered into) ๐
๐ธ NAME ๐ธ
wxPaintEvent โ a paint event gets sent when a window's contents needs to be repainted. that's it, that's the vibe. the window said "bestie I need a glow-up" and this is the notification ๐
๐ DESCRIPTION ๐
so like, the handler of this event must create a wxPaintDC object and use it for painting the window contents. no shortcuts, no other canvas, it's giving very "this one, specifically." โจ
For example:
yes the example slot is just kinda sitting there empty, do not perceive it ๐ the docs said "For example:" and then walked away. we move.
Notice that you must not create other kinds of wxDC (e.g. wxClientDC or wxWindowDC) in EVT_PAINT handlers โ and also don't create wxPaintDC outside of this event handlers. fr fr, do not do it. that's the rule, that's the boundary, respect it ๐ค๐
You can optimize painting by retrieving the rectangles that have been damaged and only repainting these. the rectangles are in terms of the client area, and are unscrolled โ so you will need to do some calculations using the current view position to obtain logical, scrolled units. math era, lowkey. ๐งฎ
Here is an example of using the wxRegionIterator (not implemented in wx) class:
again bestie, the code block is not here. the original page just. gestures vaguely. ๐ซถ
Remark: Please notice that in general it is impossible to change the drawing of a standard control (such as wxButton) and so you shouldn't attempt to handle paint events for them โ as even if it might work on some platforms, this is inherently not portable and won't work everywhere. so likeโฆ don't. ๐
โโ๏ธ it's giving false hope on one platform and chaos on the rest.
See: Overview events ๐
This class is derived, and can use functions, from:
wxEvent
wxWidgets docs: wxPaintEvent
๐ฆ Events ๐ฆ
Use wxEvtHandler:connect/3 with wxPaintEventType to subscribe to events of this type. yes bestie, that's the plug. ๐
๐ DATA TYPES ๐
wxPaint() :: #wxPaint{}.wxPaintEvent() :: wx:wx_object().wxPaintEventType() :: paint.
๐ FUNCTIONS ๐
this section is here, bestie. it exists. it is simplyโฆ empty. no functions listed, no cap. we stan a minimalist section. โจ (the heading stays because the originals keep it, iykyk)
and that's the whole page, no notes, periodt ๐
sign-off: this icon was brought to you by Ericsson AB, wx 2.6, in the classic wxPaintEvent(3) format โ take care of your wxPaintDC bestie and she'll take care of you ๐๐ฆ๐
๐ฆ 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