mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Lots of minor tweaks for the pep252 checkins, mainly because Qd
attributes are no longer supported.
This commit is contained in:
parent
202355a333
commit
362c7cd07b
25 changed files with 60 additions and 61 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue