jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
615 stars 67 forks source link

LabelEntry doesn't completly removes with the .removesEntry method and can cause duplicate error #643

Open MatMatty opened 2 years ago

MatMatty commented 2 years ago

Bug Report


Context


Managing LabelEntry widget (removing) then adding another LabelEntry widget with the same name as the one deleted

Expected Behaviour


Nothing special

Actual Behaviour


Duplicate Error

Any error messages produced by appJar


Duplicate widget

Sample code, demonstrating the issue


app = gui() app.addLabelEntry("test") app.removeEntry("test") app.addLabelEntry("test") app.go()

Remark


I've been able to make it work anyway by deleting "manually" the widget in the WidgetManager's dictionary with 'app.widgetManager.remove(2, "test")' (2 being the Entry widget's ID)

jarvisteach commented 2 years ago

This looks to be a genuine bug, and across all labelled widgets. It seems the container & label are removed but not the actual main widget. It also looks like there's no testing of removing labelled widgets in the test scripts.

Adding the mentioned line of code to the removeWidgetType() function would resolve this. But I think it should be a call to cleanseWidgets() instead.