When creating a canvas widget, if setSize is called after the canvas is added to it's parent the canvas will not display.
This version works
When we switch the order of canvas->setSize and gui.add, the canvas no longer displays.
It doesn't matter if the parent is gui or another widget (such as panel)
I haven't observed this behavior with any other widgets.
TGUI 0.8.1
Visual C++ 2017 15.8.8
This version works
Code Select
tgui::Canvas::Ptr canvas = tgui::Canvas::create();
canvas->setPosition(50,50);
canvas->setSize(100,100);
gui.add(canvas);
canvas->clear("100,100,100");
canvas->display();
When we switch the order of canvas->setSize and gui.add, the canvas no longer displays.
Code Select
tgui::Canvas::Ptr canvas = tgui::Canvas::create();
canvas->setPosition(50,50);
gui.add(canvas); // moved before setSize
canvas->setSize(100,100);
canvas->clear("100,100,100");
canvas->display();
It doesn't matter if the parent is gui or another widget (such as panel)
I haven't observed this behavior with any other widgets.
TGUI 0.8.1
Visual C++ 2017 15.8.8