File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments