Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7051e52

Browse files
author
Just van Rossum
committed
added setbound() method, some cleanups (jvr)
1 parent 6e5f2d1 commit 7051e52

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

Mac/Tools/IDE/Wwindows.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ def show(self, onoff):
7878
def isvisible(self):
7979
return self.wid.IsWindowVisible()
8080

81-
def getbounds(self):
82-
if 0: #self.isvisible():
83-
self.wid.GetWindowContentRgn(scratchRegion)
84-
self._globalbounds = GetRgnBounds(scratchRegion)
85-
return self._globalbounds
86-
8781
def select(self):
8882
self.wid.SelectWindow()
8983
# not sure if this is the best place, I need it when
@@ -143,18 +137,27 @@ def close(self):
143137
def domenu_close(self, *args):
144138
self.close()
145139

140+
def getbounds(self):
141+
return self._globalbounds
142+
143+
def setbounds(self, bounds):
144+
l, t, r, b = bounds
145+
self.move(l, t)
146+
self.resize(r-l, b-t)
147+
146148
def move(self, x, y = None):
147149
"""absolute move"""
148150
if y == None:
149151
x, y = x
150152
self.wid.MoveWindow(x, y, 0)
151153

152154
def resize(self, x, y = None):
155+
if not self._hasgrowbox:
156+
return # hands off!
153157
if y == None:
154158
x, y = x
155-
if self._hasgrowbox:
156-
self.SetPort()
157-
Win.InvalRect(self.getgrowrect())
159+
self.SetPort()
160+
Win.InvalRect(self.getgrowrect())
158161
self.wid.SizeWindow(x, y, 1)
159162
self._calcbounds()
160163

0 commit comments

Comments
 (0)