[pywin32-checkins] pywin32/win32/src win32gui.i,1.98,1.99
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2007-01-11 04:42:27
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1946/win32/src Modified Files: win32gui.i Log Message: Call handle's Close() method in DeleteObject Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** win32gui.i 5 Jan 2007 20:06:53 -0000 1.98 --- win32gui.i 11 Jan 2007 04:42:26 -0000 1.99 *************** *** 2536,2541 **** #endif /* not MS_WINCE */ // @pyswig |DeleteObject|Deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object. After the object is deleted, the specified handle is no longer valid. ! BOOLAPI DeleteObject(HANDLE h); // @pyparm int|handle||handle to the object to delete. // @pyswig |BitBlt|Performs a bit-block transfer of the color data corresponding --- 2536,2568 ---- #endif /* not MS_WINCE */ + %{ // @pyswig |DeleteObject|Deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object. After the object is deleted, the specified handle is no longer valid. ! static PyObject *PyDeleteObject(PyObject *self, PyObject *args) ! { ! PyObject *obhgdiobj; ! if (!PyArg_ParseTuple(args, "O:DeleteObject", ! &obhgdiobj)) // @pyparm <o PyGdiHANDLE>|handle||handle to the object to delete. ! return NULL; ! if (PyHANDLE_Check(obhgdiobj)){ ! // Make sure we don't call Close() for any other type of PyHANDLE ! if (strcmp(((PyHANDLE *)obhgdiobj)->GetTypeName(),"PyGdiHANDLE")!=0){ ! PyErr_SetString(PyExc_TypeError,"DeleteObject requires a PyGdiHANDLE"); ! return NULL; ! } ! if (!((PyHANDLE *)obhgdiobj)->Close()) ! return NULL; ! Py_INCREF(Py_None); ! return Py_None; ! } ! HGDIOBJ hgdiobj; ! if (!PyWinObject_AsHANDLE(obhgdiobj, &hgdiobj, FALSE)) ! return NULL; ! if (!DeleteObject(hgdiobj)) ! return PyWin_SetAPIError("DeleteObject"); ! Py_INCREF(Py_None); ! return Py_None; ! } ! %} ! %native (DeleteObject) PyDeleteObject; // @pyswig |BitBlt|Performs a bit-block transfer of the color data corresponding |