Python Forum

Full Version: Append string to StaticText
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I have a StaticText where i can set the label with
mystaticText.setLabel("Hello")
However, when i use SetLabel, the string showed in the textBox disappeares and is replaced by the new one.
I need to append the new string to the old one, not replacing it, so i can see all the strings, not only the last one.

I tried with
mystaticText.AppendText("hello_2")
but is does not work.

Is there an easy way to do this (i.e. a method) or the only way is to play with strings (i.e. i can append the new string to the last one and then call the SetLabel method)?


Thanks
mystaticText.SetLabel(mystaticText.GetLabel() + " hello 2")