diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/tkinter/ttk.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py index 9cd0c20..2a3e1ce 100644 --- a/Lib/tkinter/ttk.py +++ b/Lib/tkinter/ttk.py @@ -1543,11 +1543,12 @@ class LabeledScale(Frame): try: self._variable.trace_vdelete('w', self.__tracecb) except AttributeError: - # widget has been destroyed already pass else: del self._variable - Frame.destroy(self) + super().destroy() + self.label = None + self.scale = None def _adjust(self, *args): @@ -1647,5 +1648,8 @@ class OptionMenu(Menubutton): def destroy(self): """Destroy this widget and its associated variable.""" - del self._variable - Menubutton.destroy(self) + try: + del self._variable + except AttributeError: + pass + super().destroy() |