Skip to main content
Hosting
Associate III
May 30, 2019 9:37 PM UTC
Solved

Error when using custom widget.

Hey.

I'm trying to use a custom widget. Error:

---------------------------

Microsoft Visual C++ Runtime Library

---------------------------

Assertion failed!

Program: ...mulator\msvs\..\..\build\Debug\bin\Application.exe

File: ..\..\..\..\framework\source\touchgf...\CanvasWidget.cpp

Line: 40

Expression: canvasPainter != 0 && "No painter set"

For information on how your program can cause an assertion

failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)

---------------------------

PS: Problem solved. Was my inattention

This topic has been closed for replies.
Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
Jun 3, 2019 8:49 AM UTC

Hi @Hosting​,

Glad you solved it. For everyone else, the problem was that no "Painter" was defined for the CanvasWidget. The Painter knows how to render to various depths of framebuffers. e.g. the PainterRGB565 class can render to 16-bit framebuffers in the RGB565 format.

/Martin

1 reply

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
Jun 3, 2019 8:49 AM UTC

Hi @Hosting​,

Glad you solved it. For everyone else, the problem was that no "Painter" was defined for the CanvasWidget. The Painter knows how to render to various depths of framebuffers. e.g. the PainterRGB565 class can render to 16-bit framebuffers in the RGB565 format.

/Martin