diff options
author | Guido van Rossum <guido@python.org> | 1991-04-07 13:33:39 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1991-04-07 13:33:39 (GMT) |
commit | aa57a9d7334433912234a2625355ca6bf7698baa (patch) | |
tree | e9869758595162455f6652a32d9534973632dac9 /Lib/lib-stdwin | |
parent | 9ddba3e9ee3ee1e5688796486ff3f64fac019aec (diff) | |
download | cpython-aa57a9d7334433912234a2625355ca6bf7698baa.zip cpython-aa57a9d7334433912234a2625355ca6bf7698baa.tar.gz cpython-aa57a9d7334433912234a2625355ca6bf7698baa.tar.bz2 |
Added keyboard, alternate drawing, realize and getwindow interfaces.
Diffstat (limited to 'Lib/lib-stdwin')
-rw-r--r-- | Lib/lib-stdwin/Split.py | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/Lib/lib-stdwin/Split.py b/Lib/lib-stdwin/Split.py index 63f5d5f..ef0f2fc 100644 --- a/Lib/lib-stdwin/Split.py +++ b/Lib/lib-stdwin/Split.py @@ -18,7 +18,9 @@ class Split(): self.parent = parent self.children = [] self.mouse_interest = [] + self.keybd_interest = [] self.timer_interest = [] + self.altdraw_interest = [] self.mouse_focus = 0 return self # @@ -30,18 +32,28 @@ class Split(): child.destroy() del self.children[:] del self.mouse_interest[:] + del self.keybd_interest[:] del self.timer_interest[:] + del self.altdraw_interest[:] self.mouse_focus = None # - def minsize(self, m): return unimpl() + def minsize(self, m): return unimpl() # Should ask children def getbounds(self): return unimpl() - def setbounds(self, bounds): unimpl() + def setbounds(self, bounds): unimpl() # Should tell children + # + def realize(self): + for child in self.children: + child.realize() # def draw(self, d_detail): # (Could avoid calls to children outside the area) for child in self.children: child.draw(d_detail) # + def altdraw(self, detail): + for child in self.altdraw_interest: + child.altdraw(detail) + # # Downcalls only made after certain upcalls # def mouse_down(self, detail): @@ -60,6 +72,10 @@ class Split(): self.mouse_focus.mouse_up(detail) self.mouse_focus = 0 # + def keybd(self, type_detail): + for child in self.keybd_interest: + child.keybd(type_detail) + # def timer(self): for child in self.timer_interest: child.timer() @@ -76,8 +92,12 @@ class Split(): remove(child, self.children) if child in self.mouse_interest: remove(child, self.mouse_interest) + if child in self.keybd_interest: + remove(child, self.keybd_interest) if child in self.timer_interest: remove(child, self.timer_interest) + if child in self.altdraw_interest: + remove(child, self.altdraw_interest) if child = self.mouse_focus: self.mouse_focus = 0 # @@ -91,6 +111,16 @@ class Split(): if not self.mouse_interest: self.parent.no_mouse(self) # + def need_keybd(self, child): + if child not in self.keybd_interest: + self.keybd_interest.append(child) + self.parent.need_keybd(self) + def no_keybd(self, child): + if child in self.keybd_interest: + remove(child, self.keybd_interest) + if not self.keybd_interest: + self.parent.no_keybd(self) + # def need_timer(self, child): if child not in self.timer_interest: self.timer_interest.append(child) @@ -101,12 +131,24 @@ class Split(): if not self.timer_interest: self.parent.no_timer(self) # + def need_altdraw(self, child): + if child not in self.altdraw_interest: + self.altdraw_interest.append(child) + self.parent.need_altdraw(self) + def no_altdraw(self, child): + if child in self.altdraw_interest: + remove(child, self.altdraw_interest) + if not self.altdraw_interest: + self.parent.no_altdraw(self) + # # The rest are transparent: # def begindrawing(self): return self.parent.begindrawing() def beginmeasuring(self): return self.parent.beginmeasuring() + def getwindow(self): + return self.parent.getwindow() # def change(self, area): self.parent.change(area) |