Menu items don't show when I press on a menu. Menubar is added into layout. Is this expected behaviour or bug? If it's first case - how to fix?
MCVE:
#include <TGUI/TGUI.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "TGUI window");
tgui::Gui gui(window);
auto topLayout = tgui::VerticalLayout::create();
topLayout->setSize("100%", "10%");
tgui::MenuBar::Ptr menuBar = tgui::MenuBar::create();
menuBar->addMenu("File");
menuBar->addMenuItem("File", "New");
topLayout->add(menuBar);
topLayout->add(tgui::Button::create("Button"));
gui.add(topLayout);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
gui.handleEvent(event); // Pass the event to the widgets
}
window.clear();
gui.draw(); // Draw all widgets
window.display();
}
}