I am calling a function I have in a separate lua file that creates the user interface on screen. When you call the method a second time, if any of the UI items already exist it is supposed to remove it and replace it with a new UI. This works great for vector objects and text, but doesn’t appear to work for buttons. Running this code:
[lua]if (titleText:removeSelf()) then print (“title text removed”); end[/lua]
returns true just fine, but this code:
[lua]if (backButton:removeSelf()) then print(“back button removed”); end[/lua]
returns false. I’ve tried removing the button individually, as well as removing the display group it is in to no avail. I’ve tried instantiating the button via:
[lua]backButton = widget.newButton { options }[/lua]
[lua]local backButton = widget.newButton { options }[/lua]
Any insight would be greatly appreciated!
Sean