You should create a minimal example code that shows this problem. I can't help much by only seeing a small part of the code or if you have too much code.
This might be what you already fixed, but the code in Sidebar::homeButton seems very wrong. You create the App instance inside it which creates the tgui::Gui instance to which you add the widget. But when you return from that homeButton function the App and Gui are destroyed as they go out of scope.
This might be what you already fixed, but the code in Sidebar::homeButton seems very wrong. You create the App instance inside it which creates the tgui::Gui instance to which you add the widget. But when you return from that homeButton function the App and Gui are destroyed as they go out of scope.