Hello, I'd like to ask you a few questions about tooltips, because my game can't stop crashing since I implemented these.
I have X buttons implemented automatically, and 1 childWindow that I want to appear as a tooltip. But of course for each button I want to update the informations in the childwindow.
So I created a childwindow named "child_game_city_construction_tooltip".
Then I put it as a tooltip in my buttons when I create them :
...
button->setToolTip(xgui.get<tgui::ChildWindow>("child_game_city_construction_tooltip"));
...
But first problem : If I put my childwindow on setVisible(false), the tooltip nevers shows up. If I put it on true, then the childwindow becomes visible outside its "tooltip mission", until I go on a button that uses it.
Then, I want to update its information :
if(signalName == "MouseEntered") {
...
// MAJ ToolTip
if(s.find("construct_bati") != std::string::npos) {
xgui.get<tgui::ChildWindow>("child_game_city_construction_tooltip")->setTitle(game.GetBatiFromType(cb).nom);
}
}
This code works the first Time I enter a button. But then when I go on another button, it crashes.
It seems that a widget couldn't work as a tooltip for several buttons, or something like that ?
Thank you very much for your help !