Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3155923 commit 81920f1Copy full SHA for 81920f1
1 file changed
Mac/Modules/res/resedit.py
@@ -0,0 +1,25 @@
1
+resource_body = """
2
+char *buf;
3
+int len;
4
+Handle h;
5
+
6
+if (!PyArg_ParseTuple(_args, "s#", &buf, &len))
7
+ return NULL;
8
+h = NewHandle(len);
9
+if ( h == NULL ) {
10
+ PyErr_NoMemory();
11
12
+}
13
+HLock(h);
14
+memcpy(*h, buf, len);
15
+HUnlock(h);
16
+return (PyObject *)ResObj_New(h);
17
+"""
18
19
+f = ManualGenerator("Resource", resource_body)
20
+f.docstring = lambda: """Convert a string to a resource object.
21
22
+The created resource object is actually just a handle.
23
+Apply AddResource() to write it to a resource file.
24
25
+functions.append(f)
0 commit comments