Page 1 of 1

Delete all buttons?

Posted: Fri Nov 28, 2008 8:13 pm
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.

Posted: Sat Nov 29, 2008 4:12 am
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

Posted: Sat Nov 29, 2008 4:44 am
by CuteAlien
Maybe you did grab the buttons somewhere? Then they will not be deleted, though I think they still should stop being drawn.

Posted: Sat Nov 29, 2008 9:45 pm
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

Posted: Sun Nov 30, 2008 3:01 am
by CameroKid
Yep. I forgot to clear the old button's data. Thanks