Skip to main content
Hosting
Associate III
May 30, 2019
Solved

Error when using custom widget.

  • May 30, 2019
  • 1 reply
  • 747 views

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.
Best answer by Martin KJELDSEN

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
June 3, 2019

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