Python Forum
[WxPython] Append string to StaticText
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[WxPython] Append string to StaticText
#1
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
Reply
#2
mystaticText.SetLabel(mystaticText.GetLabel() + " hello 2")
99 percent of computer problems exists between chair and keyboard.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [WxPython] make StaticText limit Number royer14 4 4,124 Nov-27-2017, 02:44 PM
Last Post: royer14

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020