getValue() returns current value when program loads. When i move the thumb of the slider i dont get new values. I will code only for slider in 1-2 mins
Here is minimal code:
#include <TGUI/TGUI.hpp>
int main()
{
// Create the main window
sf::RenderWindow app(sf::VideoMode(400, 400), "slider test");
tgui::Gui gui(app);
tgui::Slider::Ptr slider(gui);
slider->load("Black.conf");
slider->setVerticalScroll(false);
slider->setPosition(10, 10);
slider->setSize(300, 25);
slider->setMinimum(0);
slider->setMaximum(100);
std::cout << "Value is: " << slider->getValue() << std::endl;
// Start the game loop
while (app.isOpen())
{
// Process events
sf::Event event;
while (app.pollEvent(event))
{
// Close window : exit
if (event.type == sf::Event::Closed)
app.close();
gui.handleEvent(event);
}
tgui::Callback callback;
while (gui.pollCallback(callback))
{
}
// Clear screen
app.clear();
// Draw the sprite
gui.draw();
// Update the window
app.display();
}
return EXIT_SUCCESS;
}