wPaintDC

A wPaintDC object must be constructed if an application wishes to paint on the client area of a window from within a wEvent_Paint event handler. To draw on a window from outside your wEvent_Paint event handler, construct a wClientDC object. To draw on the whole window including decorations, construct a wWindowDC object. A wPaintDC object is initialized to use the same font and colors as the window it is associated with.

Like other DC object, wPaintDC need nim's destructors to release the resource.

Superclass:wDC

Procs

proc PaintDC(canvas: wWindow): wPaintDC {...}{.raises: [wNilAccess, IndexDefect, wFontError,
    wPenError, wBrushError], tags: [RootEffect].}
Constructor. In wEvent_Paint event handler the wWindow object usually is event.window. For example:
frame.connect(wEvent_Paint) do (event: wEvent):
  var dc = PaintDC(event.window)
proc getPaintRect(self: wPaintDC): wRect {...}{.raises: [], tags: [].}
Gets the rectangle in which the painting is requested.
proc delete(self: var wPaintDC) {...}{.raises: [], tags: [].}
Nim's destructors will delete this object by default. However, sometimes you maybe want to do that by yourself. (Nim's destructors don't work in some version?)

Methods

method getSize(self: wPaintDC): wSize {...}{.raises: [Exception], tags: [RootEffect].}
Gets the size of the device context.