Widget "remove from parent" function doesn't work

show the code for more accurate answers