Custom Label attached to Custom Slider

The Label has no idea about values and ranges. But you can connect two sliders, using one as Slider (LinearBar, TextBoxBelow) and the other Slider (Rotary, NoTextBox). The LinearBar will display the text on top of a slider-like rectangle. If you don’t want the bar in the background, you can set the colours to be the same as the background.

To connect them, either connect them to the same parameter, or use the getValueObject() to connect them:

Slider s1 (LinearBar, TextBoxBelow);
Slider s2 (Rotary, NoTextBox);
s2.getValueObject().referTo (s1.getValueObject());

Hope that helps

N.B. the attachToComponent is meant to set a position relative to the component you attach the label to. It does nothing about the displayed content.

1 Like