mirror of https://github.com/python/cpython.git
Use MacOS.string_id_to_buffer for the hack to convert string id() to
buffer address.
This commit is contained in:
parent
9a8cb84072
commit
4240b610f3
|
@ -3,6 +3,7 @@
|
||||||
import Qd
|
import Qd
|
||||||
import time
|
import time
|
||||||
import struct
|
import struct
|
||||||
|
import MacOS
|
||||||
|
|
||||||
_fmt_to_mac = {
|
_fmt_to_mac = {
|
||||||
imgformat.macrgb16 : (16, 16, 3, 5),
|
imgformat.macrgb16 : (16, 16, 3, 5),
|
||||||
|
@ -13,7 +14,7 @@ def mkpixmap(w, h, fmt, data):
|
||||||
fmtinfo = _fmt_to_mac[fmt]
|
fmtinfo = _fmt_to_mac[fmt]
|
||||||
|
|
||||||
rv = struct.pack("lhhhhhhhlllhhhhlll",
|
rv = struct.pack("lhhhhhhhlllhhhhlll",
|
||||||
id(data)+16,
|
id(data)+MacOS.string_id_to_buffer, # HACK HACK!!
|
||||||
w*2 + 0x8000,
|
w*2 + 0x8000,
|
||||||
0, 0, h, w,
|
0, 0, h, w,
|
||||||
0,
|
0,
|
||||||
|
|
Loading…
Reference in New Issue