summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJust van Rossum <just@lettererror.com>1999-10-30 11:49:07 (GMT)
committerJust van Rossum <just@lettererror.com>1999-10-30 11:49:07 (GMT)
commit66e53854d646c96d8724b3b0cacc740860928849 (patch)
treee10b1dac396ca64c4cb7657987e5d1824d569439
parent7171df3e7e48156d47aedb78842242f30f0332e2 (diff)
downloadcpython-66e53854d646c96d8724b3b0cacc740860928849.zip
cpython-66e53854d646c96d8724b3b0cacc740860928849.tar.gz
cpython-66e53854d646c96d8724b3b0cacc740860928849.tar.bz2
- windowbounds() now works with multiple screens (window position prefs!)
- Minor tab behavior tweak -- jvr
-rw-r--r--Mac/Tools/IDE/Wwindows.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/Mac/Tools/IDE/Wwindows.py b/Mac/Tools/IDE/Wwindows.py
index f48e11e..52301fb 100644
--- a/Mac/Tools/IDE/Wwindows.py
+++ b/Mac/Tools/IDE/Wwindows.py
@@ -109,11 +109,13 @@ class Window(FrameWork.Window, Wbase.SelectableWidget):
for w in self._widgets:
w.forall_frombottom("open")
self._maketabchain()
- if self._tabchain:
- self._tabchain[0].select(1)
if self._tabbable:
self.bind('tab', self.nextwidget)
self.bind('shifttab', self.previouswidget)
+ else:
+ self._hasselframes = 0
+ if self._tabchain:
+ self._tabchain[0].select(1)
self.do_postopen()
def close(self):
@@ -581,14 +583,19 @@ def getnextwindowpos():
_windowcounter = _windowcounter + 1
return l, t
-def windowbounds(preferredsize, minsize = None):
+def windowbounds(preferredsize, minsize=None):
"Return sensible window bounds"
global _windowcounter
if len(preferredsize) == 4:
bounds = l, t, r, b = preferredsize
- union = Qd.UnionRect(bounds, Qd.qd.screenBits.bounds)
- if union == Qd.qd.screenBits.bounds:
+ desktopRgn = Win.GetGrayRgn()
+ tempRgn = Qd.NewRgn()
+ Qd.RectRgn(tempRgn, bounds)
+ union = Qd.UnionRgn(tempRgn, desktopRgn, tempRgn)
+ equal = Qd.EqualRgn(tempRgn, desktopRgn)
+ Qd.DisposeRgn(tempRgn)
+ if equal:
return bounds
else:
preferredsize = r - l, b - t