wxClientDC(3)
π wxClientDC π
okay bestie, so this is the wxClientDC page from the Erlang module docs (yes we're in wx, the Erlang wxWidgets bindings, come with me π«Ά).
β¨ NAME β¨
wxClientDC β bestie, this class is primarily useful for obtaining information about the window from outside the EVT_PAINT() handler. that's its whole moment. that's the gig. π
πΈ DESCRIPTION πΈ
so the typical use of this class is to grab the extent of some text string so you can allocate enough size for a window, e.g.
β οΈ Note, and this one MATTERS: whilewxClientDCmay also be used for drawing on the client area of a window from outside anEVT_PAINT()handler in some ports, this does NOT work on all platforms. neither wxOSX nor wxGTK with the GTK 3 Wayland backend support this, so drawing usingwxClientDCsimply doesn't have any effect there π. the only portable way of drawing is viawxPaintDC. to redraw a small part of the window, usewxWindow:refreshRect/3to invalidate just this part, and checkwxWindow:getUpdateRegion/1in the paint event handler to redraw this part only. iykyk π
wxClientDC objects should normally be constructed as temporary stack objects, i.e. don't store a wxClientDC object. periodt. don't do it. it's giving temporary. π
a wxClientDC object is initialized to use the same font and colours as the window it is associated with. no need to fight it, it already matches. β¨
See, like, go look at:
wxDCwxMemoryDCwxPaintDCwxWindowDCwxScreenDC
this class is derived, and can use functions, from:
wxWindowDCwxDC
wxWidgets docs: wxClientDC
π¦ DATA TYPES π¦
wxClientDC() :: wx:wx_object().
π FUNCTIONS π
destroy(This :: wxClientDC()) -> okβ destroys the object π that's it, that's the function.new(Window) -> wxClientDC()whenWindow :: wxWindow:wxWindow()β the constructor, bestie π«Ά. pass a pointer to the window on which you wish to paint. that's the whole vibe.
and that's the page, no cap π this fine manual came to you from Ericsson AB, and it's the wx 2.6 era of the docs, filed under wxClientDC(3). go forth and get that text extent, queen πππ¦
π¦ 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