Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4240b61

Browse files
committed
Use MacOS.string_id_to_buffer for the hack to convert string id() to
buffer address.
1 parent 9a8cb84 commit 4240b61

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Mac/Demo/imgbrowse/mac_image.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import Qd
44
import time
55
import struct
6+
import MacOS
67

78
_fmt_to_mac = {
89
imgformat.macrgb16 : (16, 16, 3, 5),
@@ -13,7 +14,7 @@ def mkpixmap(w, h, fmt, data):
1314
fmtinfo = _fmt_to_mac[fmt]
1415

1516
rv = struct.pack("lhhhhhhhlllhhhhlll",
16-
id(data)+16,
17+
id(data)+MacOS.string_id_to_buffer, # HACK HACK!!
1718
w*2 + 0x8000,
1819
0, 0, h, w,
1920
0,

0 commit comments

Comments
 (0)