Could you provide a minimal and complete code that does not work for you?
The callback seems to work fine here.
The callback seems to work fine here.
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 MenuQuoteBTW: Render is in another thread.That complicates things a lot of course.
Quotei don't use 0.7 because every single resource has to be loaded directly from disk instead of giving reference as in 0.6.6Its perfectly ok to still use v0.6, the new version still has its limitations. But I didn't understand that line, 0.7 should be better in any way regarding loading widgets (it just doesn't support loading widgets from a text file yet like 0.6 does).
m_button = tgui::Button::Ptr(*fw::g_gui);
m_button->load(THEME_CONFIG_FILE);
m_button->...By doing so, the widget is fully initialized before you call any functions on it.fw::g_gui->setGlobalFont(Assets::Data::getFont("font"));That would also have solved this problem.
Quotei cant use function tgui::Gui::removeAllWidgets() because certain things must be still visible (it sucks when your game screen blinks)Your screen is only updated when drawing. If you call removeAllWidgets and then add the needed widgets before you update your screen then nothing will blink. Of course recreating widgets takes time and it is slightly more efficient to keep the ones that you need, but I just though I should mention it.
Quoteonly third solution work for me ( gcc 4.7.2 with mingw on win7 )Interesting. I though gcc 4.7 was the minimum compiler that my code supported. So either the MinGW port just isn't as good as it should be, or the minimum support is gcc 4.8. I guess I will have to look into that.
QuoteThe examples are poor for the potential of this lib.Feel free to write your own examples and send them to me
void my_func(sf::String param); // param == "Quitter", param could also be an std::string if wanted
menu->connect("MenuItemClicked", my_func);
void my_func2(std::vector<sf::String> param); // param[0] = "Fichier", param[1] = "Quitter"
menu->connect("MenuItemClicked", my_func2);
void my_func(const tgui::Callback& c); // c.text == "Quitter"
menu->connectEx("MenuItemClicked", my_func2);
Quotethe question is if you would write them manually in the first placeThat is indeed an interesting question which I haven't thought about much. They will most likely have to be edited manually, but that only requires some small changes and most of the files could indeed be generated.
QuoteAnd file size shouldn't be a concern.Neither file size or speed is a concern for me. It is just the readability that bothers me with xml.
Quotesimply because libconfig uses ascii for strings which is undesirable if you do ButtonText = "MinButtøn".This is a valid concern, but also one that should be made for json. The jsoncons library that I was looking at also works with stings by default. I would have to read the file myself and pass the stream to jsoncons, but I even wonder if std::ifstream supports unicode.
<TextSize>5</TextSize>
"TextSize" : 5
TextSize = 5
QuoteThe lib folder actually contains two sub-directories "Debug" and "Release".That's wrong. Copy the contents of these folders directly into the lib folder. That will solve the problem.
QuoteI'm not sure how the external libraries popped up on CMake the first timeMy cmake script detects them automatically if all goes right. But usually if it finds the external libs it also finds the sfml libs, that's why I was asking about it.
tgui::ChildWindow::Ptr child(gui);
child->load("Black.conf");
tgui::ChatBox::Ptr chatBox(*child);
chatBox->load("Black.conf");auto child = tgui::ChildWindow::create("Black.conf");
gui.add(child);
auto chatBox = tgui::ChatBox::create("Black.conf");
child->add(chatBox);
.QuoteThen on some elements, I change properties via getRenderer() because I didn't want an extra theme.conf for a single ButtonThe Theme class would simply contain the same contents as the .conf files. So you would just have to make a changeProperty call on the theme before you pass it to the widget instead of needing an entirely different file where only one line has changed. The renderer could perhaps be kept internally and no longer needed directly. But it's too early to think about that.
QuoteWhat would happen if I create an element with a theme object and later I want to change a property on this element only?If you change the theme then it changes on all widgets. But currently the plan is to duplicate the theme on a getRenderer call. So when you do "button->getRenderer()->setXyz(xyz);" then the theme is cloned and the change is made in the theme of that one button. Any changes to the original theme will no longer affect the button.
QuoteThe bug is really minorNevertheless, it has to be fixed.
.
Quoteyou should maybe compile a list for new usersIts all in the documentation, just split over multiple pages.
.QuoteI found a little bugI'll look into it.
.