the widget was already added to the screen


Short: My problem is that the widget was already added to the screen.


More: I want to make back buttons but isn’t working fully, I made three user interface:



  1. Mainmenu (user interface)
  2. Play (user interface)
  3. Host Game (user interface)

When I click the PLAY button (image 1) than the BACK button (image 2) is go back to the main menu (image 1) and it’s working and I can do this continuously.


When i click the PLAY button (image 1) than the Host Game button (image 2) and than the BACK button (image 3)and i click again to the BACK button (image 2) is go back to the main menu (image 1) but when i click to he PLAY button the widget is hidden and write this to the screen: the widget is already added to the screen.


What should I do?

For image 2 and 3 name your buttons, very hard to decipher what is going on with things like “button 101” and “button 92”.

have you tried just toggling the visibility. it seems like you never destroy a widget unless the back button is pushed so you are probable creating multiples of the same widget without realizing it. unless im mistaken what your currently doing is on press play create play widget, on press host create host widget & hide play widget, on press back destroy host widget & create play widget. at this point you have two of the same widget created, one visible and one set to hidden.