2026-04-13 1:17 AM - edited 2026-04-15 1:52 AM
For our product we use sliders to set parameters in our software. Some parameters effect the range of others at runtime. Sometimes the allowable range of the values is limited to a single value. In such a case min equals max. This leads to an assert error in the simulator and undocumented behavior on the target.
We would like to see support for min=max. One way to implement it is to show the Indicator Image in the center (or left), disable sliding, and set the value=min=max. This would simplify our firmware since we wouldn't need to handle it as a special case.
I also added the tag bug-report since undefined behavior on the target is unacceptable.
2026-04-14 6:55 AM
I workaround would be to have 3 values with the one in the middle the value you want and have the slider disabled.
2026-04-14 8:27 AM
@nico23 wrote:I workaround would be to have 3 values with the one in the middle the value you want and have the slider disabled.
Yes. But that requires code.
2026-04-14 11:35 PM - edited 2026-04-14 11:35 PM
well, of course... That’s how embedded works
You can even expand the slider class and have your own class that supports the min=max
That's the beauty of coding
2026-04-15 1:41 AM
Yes coding is beautiful, but it costs time and therefore money. The code is no longer needed when the bug is fixed
2026-04-17 2:47 AM
Hello @unsigned_char_array.
I have passed on your request. However, I cannot guarantee that it will be changed in the future.
On the other hand, I also think this is a case where it is quite easy to create a custom implementation.
I have attached an example in which I copied the Slider.cpp file - found in touchgfx\framework\source\touchgfx\containers after generating code with TouchGFX - to the gui\src\common folder. By doing this, your copy will be used instead of the original framework instance. I made a few relatively simple modifications to support the case where the min and max values are the same, and I also implemented a small test example. Please note that I have not tested it very thoroughly.
Best regards,
Johan