diff options
author | Just van Rossum <just@lettererror.com> | 2000-04-09 19:44:45 (GMT) |
---|---|---|
committer | Just van Rossum <just@lettererror.com> | 2000-04-09 19:44:45 (GMT) |
commit | 7051e5263eccf767aa76db14f4bc6cd03dc9ac0b (patch) | |
tree | b8ec051d02c990c8b5fde5ca6235e62b1030b218 /Mac | |
parent | 6e5f2d1f8ec837cb7ae7786a85683143212aef13 (diff) | |
download | cpython-7051e5263eccf767aa76db14f4bc6cd03dc9ac0b.zip cpython-7051e5263eccf767aa76db14f4bc6cd03dc9ac0b.tar.gz cpython-7051e5263eccf767aa76db14f4bc6cd03dc9ac0b.tar.bz2 |
added setbound() method, some cleanups (jvr)
Diffstat (limited to 'Mac')
-rw-r--r-- | Mac/Tools/IDE/Wwindows.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Mac/Tools/IDE/Wwindows.py b/Mac/Tools/IDE/Wwindows.py index 52301fb..37ad47e 100644 --- a/Mac/Tools/IDE/Wwindows.py +++ b/Mac/Tools/IDE/Wwindows.py @@ -78,12 +78,6 @@ class Window(FrameWork.Window, Wbase.SelectableWidget): def isvisible(self): return self.wid.IsWindowVisible() - def getbounds(self): - if 0: #self.isvisible(): - self.wid.GetWindowContentRgn(scratchRegion) - self._globalbounds = GetRgnBounds(scratchRegion) - return self._globalbounds - def select(self): self.wid.SelectWindow() # not sure if this is the best place, I need it when @@ -143,6 +137,14 @@ class Window(FrameWork.Window, Wbase.SelectableWidget): def domenu_close(self, *args): self.close() + def getbounds(self): + return self._globalbounds + + def setbounds(self, bounds): + l, t, r, b = bounds + self.move(l, t) + self.resize(r-l, b-t) + def move(self, x, y = None): """absolute move""" if y == None: @@ -150,11 +152,12 @@ class Window(FrameWork.Window, Wbase.SelectableWidget): self.wid.MoveWindow(x, y, 0) def resize(self, x, y = None): + if not self._hasgrowbox: + return # hands off! if y == None: x, y = x - if self._hasgrowbox: - self.SetPort() - Win.InvalRect(self.getgrowrect()) + self.SetPort() + Win.InvalRect(self.getgrowrect()) self.wid.SizeWindow(x, y, 1) self._calcbounds() |