Commit 57807efe authored by Guido van Rossum's avatar Guido van Rossum

Added _reset and destroy methods.

parent 61952e45
...@@ -14,12 +14,19 @@ class WindowParent() = ManageOneChild(): ...@@ -14,12 +14,19 @@ class WindowParent() = ManageOneChild():
def create(self, (title, size)): def create(self, (title, size)):
self.title = title self.title = title
self.size = size # (width, height) self.size = size # (width, height)
self.child = 0 # i.e., no child yet self._reset()
self.win = 0 # i.e., no window yet return self
#
def _reset(self):
self.child = 0
self.win = 0
self.itimer = 0 self.itimer = 0
self.do_mouse = 0 self.do_mouse = 0
self.do_timer = 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 need_mouse(self, child): self.do_mouse = 1
def no_mouse(self, child): self.do_mouse = 0 def no_mouse(self, child): self.do_mouse = 0
......
...@@ -14,12 +14,19 @@ class WindowParent() = ManageOneChild(): ...@@ -14,12 +14,19 @@ class WindowParent() = ManageOneChild():
def create(self, (title, size)): def create(self, (title, size)):
self.title = title self.title = title
self.size = size # (width, height) self.size = size # (width, height)
self.child = 0 # i.e., no child yet self._reset()
self.win = 0 # i.e., no window yet return self
#
def _reset(self):
self.child = 0
self.win = 0
self.itimer = 0 self.itimer = 0
self.do_mouse = 0 self.do_mouse = 0
self.do_timer = 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 need_mouse(self, child): self.do_mouse = 1
def no_mouse(self, child): self.do_mouse = 0 def no_mouse(self, child): self.do_mouse = 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment