Clearing Static Text

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
rtr_18
Posts: 60
Joined: Thu Jun 10, 2010 8:35 am
Location: Programmer

Clearing Static Text

Post by rtr_18 »

Hi!
I've added Static Text to a Tab. If I click one button from one of the 11 buttons, I'm displaying some text to this Static Text. If I click another button, I'm displaying some other text to this Static Text. The problem is:
Whenever I click the buttons, the text is over lapped to the Static Text. How to clear the already existing text?
Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Post by Ion Dune »

If you have a pointer to it, call either "staticText1->remove()" if you're done with it or "staticText1->setVisible(false)" if you want to use it again.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

/* I almost sure that i get your question wrong, bu i will try */

You can clear text in IGUIStaticText just like you setting it.
For example:

Code: Select all

staticText->setText(L"");
P.S.: please show a screenshot of your problem and give some source code how you do this.
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

probably he calls addStaticText every time the button is pressed.
i'd suggest u to make one static text at initializing, set its text to L""
then when button is pressed, just change the text, dont create a new one
Image
Image
Post Reply