diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1995-12-12 15:02:03 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1995-12-12 15:02:03 (GMT) |
commit | 425e9eb6cb269dda231a617a28252f5232ccc624 (patch) | |
tree | 60f26b3caca10b60bfdaec558c7938cb8fbd3081 /Mac/Modules/res/ressupport.py | |
parent | 72b56e831fdc35f06b5e3aa7d071879d3b6df762 (diff) | |
download | cpython-425e9eb6cb269dda231a617a28252f5232ccc624.zip cpython-425e9eb6cb269dda231a617a28252f5232ccc624.tar.gz cpython-425e9eb6cb269dda231a617a28252f5232ccc624.tar.bz2 |
- Added color window/pixmap support
- Added support for obtaining pixmap data
- Added OptResObj_* routines for optional handles
Diffstat (limited to 'Mac/Modules/res/ressupport.py')
-rw-r--r-- | Mac/Modules/res/ressupport.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Mac/Modules/res/ressupport.py b/Mac/Modules/res/ressupport.py index fd4f4e6..8eb6bf4 100644 --- a/Mac/Modules/res/ressupport.py +++ b/Mac/Modules/res/ressupport.py @@ -32,7 +32,7 @@ includestuff = includestuff + """ finalstuff = finalstuff + """ /* Alternative version of ResObj_New, which returns None for null argument */ -PyObject *ResObj_OptNew(itself) +PyObject *OptResObj_New(itself) Handle itself; { ResourceObject *it; @@ -43,6 +43,23 @@ PyObject *ResObj_OptNew(itself) return ResObj_New(itself); } +OptResObj_Convert(v, p_itself) + PyObject *v; + Handle *p_itself; +{ + if ( v == Py_None ) { + *p_itself = NULL; + return 1; + } + if (!ResObj_Check(v)) + { + PyErr_SetString(PyExc_TypeError, "Resource required"); + return 0; + } + *p_itself = ((ResourceObject *)v)->ob_itself; + return 1; +} + """ initstuff = initstuff + """ |