2021-02-23 07:26 PM
I have a layout that uses multiple nested custom containers.
View -> MenuCustomContainer -> ListLayout
The list layout is populated with:
MenuItemCustomContainer -> (3 x EditableCustomContainer + Lines and Shapes)
Part of my visual layout includes a few Line objects and Shape objects to create formatting, menu item separation, and indicators.
No matter how I do it, if there is a visible Line or Shape in either MenuItemCustomContainer or EditableCustomContainer inside that ListLayout my application crashes when touchgfx attempts to draw the screen.
Things I've tried so far:
View -> MenuCustomContainer -> MenuItemCustomContainer -> Line/Shape
This works fine. AND, all the MenuItemCustomContainer still inside the ListLayout now work properly! But only as long as I have that extra MenuItemCustomContainer.
I feel like I'm missing something like an invalidate linked to the ListLayout or something. But I haven't been able to pin it down yet.
Any ideas would be appreciated.
2021-02-23 07:27 PM
Here's the stack trace if its helpful:
__assert_func() at 0x8088e9c
touchgfx::Canvas::Canvas() at 0x8085d3a
touchgfx::Line::drawCanvasWidget(touchgfx::Rect const&) const at 0x8078608
touchgfx::CanvasWidget::draw(touchgfx::Rect const&) const at 0x807815a
touchgfx::Screen::JSMOC() at 0x807bd74
2021-02-24 09:56 PM
Hello Dfarr.1,
Maybe your canvas buffer is too small.
Could you try increasing its size ?
/Alexandre
2021-02-25 06:32 AM
Did you set canvas buffer? The line is a canvas widget. Users need to set proper canvas buffer to make it work.
In the simulator, canvas buffer is set in main.cpp.
touchgfx::CanvasWidgetRenderer::setupBuffer(canvasBuffer, CANVAS_BUFFER_SIZE);
2021-03-01 09:56 AM
That's going to be the problem. I didn't even realize there were different categories of widgets. Sounds like I've got some more reading to do.
Why does dropping a copy of the MenuItemCustomContainer directly into MenuCustomContainer cause all the menu item instances inside the listLayout to draw correctly? This workaround actually works even if the dummy copy of the menu item has its visibility set to false.