I guess i'll recalculate all that manually or maybe do the calculation inside a class to capture the layout width change. thanks again Texus for all your time !
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
auto panel = tgui::Panel::create(); // Changed to Panel
auto layout = tgui::HorizontalWrap::create();
panel->add(layout);
auto wgt1 = tgui::Label::create("Some words");
...
auto wgt2 = tgui::Label::create("Another things");
...
layout->add(wgt1);
layout->add(wgt2);
panel->setSize(bindWidth(layout),bindHeight(layout));
gui.add(panel);
auto childWindow = tgui::ChildWindow::create();
auto layout = tgui::HorizontalWrap::create();
childWindow->add(layout);
auto wgt1 = tgui::Label::create("Some words");
wgt1->getRenderer()->setBackgroundColor({250,0,0});
wgt1->getRenderer()->setTextColor({0,0,0});
wgt1->setVerticalAlignment(tgui::Label::VerticalAlignment::Center);
auto wgt2 = tgui::Label::create("Another things");
wgt2->getRenderer()->setBackgroundColor({0,0,255});
wgt2->getRenderer()->setTextColor({0,0,0});
wgt2->setVerticalAlignment(tgui::Label::VerticalAlignment::Center);
layout->add(wgt1);
layout->add(wgt2);
//HERE - How to make the parent's size automatically fit its children's size ?
gui.add(childWindow);
auto label = tgui::Label::create("Test");
label->setHorizontalAlignment(tgui::Label::HorizontalAlignment::Center);
label->setVerticalAlignment(tgui::Label::VerticalAlignment::Center);