The function is called on any action, so you have to check it inside the callback function itself.
Which item you clicked is passed as optional argument to the function, so the callback function has to look like this:
Which item you clicked is passed as optional argument to the function, so the callback function has to look like this:
Code (cpp) Select
[&](const sf::String& item) {
if (item == "Exit")
mWindow.close();
}