Cannot hide Label


#1

Hi All

I've an issue to hide a label. I have added some labels to my UI using introjucer.
Each label has its ID set in gthe constructor (labelxx).
 My code is as follow:

void MyClass::updateUnsavedLabelForIndex(int idx)
{
   Label *tmpLabel = (Label *) findChildWithID(String::formatted("label%d", idx));

   if(tmpLabel)
   {
      tmpLabel->setText("Test", dontSendNotification);
      tmpLabel->setVisible(false);
   }
}

 

I can see the label text updated to "test", meaning the label is found using findChildWithID(), but the label is still visible.

Any tip would be greatly appreciated!
Thanks


 


#2

Found the issue, my label text was set with a non ASCII string, and I did not use CharPointer_UTF8() to set it, causing the issue ...