Delete all buttons?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
CameroKid
Posts: 71
Joined: Tue Jul 11, 2006 8:54 pm

Delete all buttons?

Post by CameroKid »

Is there a command to delete all buttons in the GUI? I tried env->clear() but it leaves many of my buttons where they were when I redraw new things. Please help.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

It sounds like you're doing something wrong. After you've called env->clear() all gui elements [not just the buttons] will be removed and no longer rendered. Remember that you have to draw the next frame for the changes to be displayed.

Travis
CuteAlien
Admin
Posts: 9720
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Maybe you did grab the buttons somewhere? Then they will not be deleted, though I think they still should stop being drawn.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Right. Any gui element that does not have the root element as an ancestor will not be automatically rendered by the gui->drawAll() call.

Travis
CameroKid
Posts: 71
Joined: Tue Jul 11, 2006 8:54 pm

Post by CameroKid »

Yep. I forgot to clear the old button's data. Thanks
Post Reply