Thanks for reporting. The fix has been made in the latest version that you can download from github.
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 MenuQuoteis there a way to make all tabs the same, fixed width, regardless of the text width?It is planned before the final release of v0.7, but you shoudn't expect it soon: https://github.com/texus/TGUI/issues/42
QuoteHow do I retrieve a pointer to a listbox (or any other widget) using get?You could cast the returned value yourself with std::static_pointer_cast or std::dynamic_pointer_cast, but there is a templated get function which will do the static cast for you:
tgui::ListBox::Ptr list_box_ptr = gui->get<tgui::ListBox>("List Box");QuoteAnother thing, how do I work with tabs? There's nothing about them in the tutorial.
tgui::Tab::Ptr tab = std::make_shared<tgui::Tab>();
tab->add("First");
tab->add("Second");
tab->add("Third");
gui.add(tab);QuoteIs there some sample code anywhere, with basic usage of each widget? That would ease the use of the library a lot.I simply do not have enough time to write tutorials or example codes for everything. The only thing you can do to learn how a widget works right now is to check its functions in the documentation. (e.g. for Tab: https://tgui.eu/documentation/v0.7/classtgui_1_1Tab.html#pub-methods)
tgui::Picture::Ptr pic1 = std::make_shared<tgui::Picture>("Image.png");
tgui::Picture::Ptr pic2 = tgui::Picture::copy(pic1);Size: ("0.5 * parent.width", 50)

). tgui::Layout2d parseLayout(std::string str)
{
if (str.empty())
throw tgui::Exception{"Failed to parse layout. String was empty."};
// Check if the layout is an (x, y) vector or a quoted string
if ((str.front() == '(') && (str.back() == ')'))
{
str = str.substr(1, str.length() - 2);
auto commaPos = str.find(',');
if (commaPos == std::string::npos)
throw tgui::Exception{"Failed to parse layout '" + str + "'. Expected numbers separated with a comma."};
if (str.find(',', commaPos + 1) != std::string::npos)
throw tgui::Exception{"Failed to parse layout '" + str + "'. Expected only one comma."};
return {tgui::stof(str.substr(0, commaPos)), tgui::stof(str.substr(commaPos + 1))};
}
else if ((str.front() == '"') && (str.back() == '"'))
{
str = str.substr(1, str.length() - 2);
return {str};
}
else
throw tgui::Exception{"Failed to parse layout '" + str + "'. Expected (x,y) or a quoted layout string."};
}