summaryrefslogtreecommitdiffstats
path: root/Lib/lib-stdwin/WindowParent.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-01-23 13:43:16 (GMT)
committerGuido van Rossum <guido@python.org>1991-01-23 13:43:16 (GMT)
commit52cea4309776acc91ff63dd1892ba95d0415e84f (patch)
tree7bf2bcb43ec5f8a231f012ca0b59bce88bc8d1d7 /Lib/lib-stdwin/WindowParent.py
parent52acae65d7aebba9afa99ec32e2c6a8ed3ca23ce (diff)
downloadcpython-52cea4309776acc91ff63dd1892ba95d0415e84f.zip
cpython-52cea4309776acc91ff63dd1892ba95d0415e84f.tar.gz
cpython-52cea4309776acc91ff63dd1892ba95d0415e84f.tar.bz2
Added _reset and destroy methods.
Diffstat (limited to 'Lib/lib-stdwin/WindowParent.py')
-rw-r--r--Lib/lib-stdwin/WindowParent.py13
1 files changed, 10 insertions, 3 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