Topic was automatically imported from the old Question2Answer platform.
Asked By
ondesic
In the ConfirmationDialog node there is a function to AddButton() which creates a custom button. However, there is no easy way to remove the button. I have tried looping through the children but there are bugs with this.
Is there an easy way to remove the button added with AddButton()?
When you create the button, you should be handed a reference to the new button. As long as you hang on to that, you can remove or hide the button later via any of:
(It looks like you may be using C#, so you’ll need to convert the above gdscript references)
Thank you. The problem is, when I remove the button the horizontal box container that the button was in still saves the place for it. The space just gets bigger and bigger each time I add a button and take it away.
ondesic | 2020-11-18 03:05
I can’t test this ATM, but what happens if you reset the container’s rect_min_size to 0,0 after you remove a button? Does that cause it to resize appropriately?