Hello, I want to start working with this awesome library but I don't know how to use the callback function. For example, what is the event name for when the slider updates like for the button it is "pressed"
This is the current code I have for my slider:
auto slider = tgui::Slider::create()
slider->setRenderer(theme.getRenderer("Slider"));
slider->setPosition(10, 560);
slider->setSize(200, 18);
slider->setValue(4);
slider->connect("OnValueChange", [&]() {std::cout << "Slider value: " << gui.get<tgui::Slider>("Slider")->getValue() << std::endl; } );
gui.add(slider,"Slider");
But when I run it I get an exception like "the signal OnValueChange does not exist" so I wonder what is the event name called and how can I see all the events name for all the widgets?
I found the solution and it is "ValueChanged" but I found it when I looked through the source code and I'm sure there is a much better way.
This is the current code I have for my slider:
auto slider = tgui::Slider::create()
slider->setRenderer(theme.getRenderer("Slider"));
slider->setPosition(10, 560);
slider->setSize(200, 18);
slider->setValue(4);
slider->connect("OnValueChange", [&]() {std::cout << "Slider value: " << gui.get<tgui::Slider>("Slider")->getValue() << std::endl; } );
gui.add(slider,"Slider");
But when I run it I get an exception like "the signal OnValueChange does not exist" so I wonder what is the event name called and how can I see all the events name for all the widgets?
I found the solution and it is "ValueChanged" but I found it when I looked through the source code and I'm sure there is a much better way.