Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Theodor

Pages: [1]
1
Help requests / How can i use the sliders callback functions?
« on: 15 August 2018, 12:56:49 »
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.

Pages: [1]