Lots of minor tweaks for the pep252 checkins, mainly because Qd

attributes are no longer supported.
This commit is contained in:
Jack Jansen 2002-11-30 00:01:29 +00:00
parent 202355a333
commit 362c7cd07b
25 changed files with 60 additions and 61 deletions

View file

@ -1,4 +1,4 @@
"""imgbrowse - Display pictures using img"""
GetPortBounds()"""imgbrowse - Display pictures using img"""
import FrameWork
import EasyDialogs
@ -88,16 +88,16 @@ class imgwindow(FrameWork.Window):
currect = self.fitrect()
print 'PICT:', self.pictrect
print 'WIND:', currect
print 'ARGS:', (self.pixmap, self.wid.GetWindowPort().portBits, self.pictrect,
print 'ARGS:', (self.pixmap, self.wid.GetWindowPort().GetPortBitMapForCopyBits(), self.pictrect,
currect, QuickDraw.srcCopy, None)
self.info()
Qd.CopyBits(self.pixmap, self.wid.GetWindowPort().portBits, self.pictrect,
Qd.CopyBits(self.pixmap, self.wid.GetWindowPort().GetPortBitMapForCopyBits(), self.pictrect,
currect, QuickDraw.srcCopy, None)
def fitrect(self):
"""Return self.pictrect scaled to fit in window"""
graf = self.wid.GetWindowPort()
screenrect = graf.portRect
screenrect = graf.GetPortBounds()
picwidth = self.pictrect[2] - self.pictrect[0]
picheight = self.pictrect[3] - self.pictrect[1]
if picwidth > screenrect[2] - screenrect[0]:
@ -113,7 +113,7 @@ class imgwindow(FrameWork.Window):
def info(self):
graf = self.wid.GetWindowPort()
bits = graf.portBits
bits = graf.GetPortBitMapForCopyBits()
mac_image.dumppixmap(bits.pixmap_data)
main()