From 52cea4309776acc91ff63dd1892ba95d0415e84f Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 23 Jan 1991 13:43:16 +0000 Subject: Added _reset and destroy methods. --- Lib/lib-stdwin/WindowParent.py | 13 ++++++++++--- Lib/stdwin/WindowParent.py | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Lib/lib-stdwin/WindowParent.py b/Lib/lib-stdwin/WindowParent.py index c9f2df4..5c72984 100644 --- a/Lib/lib-stdwin/WindowParent.py +++ b/Lib/lib-stdwin/WindowParent.py @@ -14,12 +14,19 @@ class WindowParent() = ManageOneChild(): def create(self, (title, size)): self.title = title self.size = size # (width, height) - self.child = 0 # i.e., no child yet - self.win = 0 # i.e., no window yet + self._reset() + return self + # + def _reset(self): + self.child = 0 + self.win = 0 self.itimer = 0 self.do_mouse = 0 self.do_timer = 0 - return self + # + def destroy(self): + if self.child: self.child.destroy() + self._reset() # def need_mouse(self, child): self.do_mouse = 1 def no_mouse(self, child): self.do_mouse = 0 diff --git a/Lib/stdwin/WindowParent.py b/Lib/stdwin/WindowParent.py index c9f2df4..5c72984 100755 --- a/Lib/stdwin/WindowParent.py +++ b/Lib/stdwin/WindowParent.py @@ -14,12 +14,19 @@ class WindowParent() = ManageOneChild(): def create(self, (title, size)): self.title = title self.size = size # (width, height) - self.child = 0 # i.e., no child yet - self.win = 0 # i.e., no window yet + self._reset() + return self + # + def _reset(self): + self.child = 0 + self.win = 0 self.itimer = 0 self.do_mouse = 0 self.do_timer = 0 - return self + # + def destroy(self): + if self.child: self.child.destroy() + self._reset() # def need_mouse(self, child): self.do_mouse = 1 def no_mouse(self, child): self.do_mouse = 0 -- cgit v0.12