]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added _reset and destroy methods.
authorGuido van Rossum <guido@python.org>
Wed, 23 Jan 1991 13:43:16 +0000 (13:43 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 23 Jan 1991 13:43:16 +0000 (13:43 +0000)
Lib/lib-stdwin/WindowParent.py
Lib/stdwin/WindowParent.py

index c9f2df4d04b9ff6cc3a32a37289a36e2a2538158..5c72984cc0237e2114f960b95b05ceb32adfd849 100644 (file)
@@ -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
index c9f2df4d04b9ff6cc3a32a37289a36e2a2538158..5c72984cc0237e2114f960b95b05ceb32adfd849 100755 (executable)
@@ -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