Fltk how to modify slider title when slider changed?

⚓ Rust    📅 2025-07-30    👤 surdeus    👁️ 10      

surdeus

Warning

This post was published 126 days ago. The information described in this article may have changed.

Hello,
I wanna show the VALUE of the slider in the title.
But did not have success.

Sorry I am noob!

let mut slider = Slider::new(30, 110, 20, 50, "WPM: ");
slider.set_range(5.0, 40.0);
slider.set_value(25.0);
slider.set_tooltip("adjust WPM (Words per minute)");

if slider.changed() {
slider.set_label(&format!("WPM: {}", slider.value() as i32));
}

How to do it right ?

1 post - 1 participant

Read full topic

🏷️ Rust_feed