Check if variable is a certain integer?

You’re creating a new widget so you need to add said widget to the viewport. Also the current setup will add a new widget each time it’s called, but you will only remove the last one you created.