How to add text to label


#1

This is the code I have below, it only changes the text when I change the slider value. How can it change the code so it changes the text when the program loads straight away.

	{
		double freq = text.removeCharacters("Hz").getDoubleValue();
		return (freq);
	};
	lpKnob->textFromValueFunction = [](double value)
	{
		double freq = (value);
		return juce::String(freq) + "Hz";
	};

thanks


#2

Maybe try to set the lambda before calling addAndMakeVisible…


#3

yep that worked well thanks, also needed to do the attachment after