diff options
Diffstat (limited to 'Mac/Modules/win/winedit.py')
-rw-r--r-- | Mac/Modules/win/winedit.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Mac/Modules/win/winedit.py b/Mac/Modules/win/winedit.py index d2551af..d79356f 100644 --- a/Mac/Modules/win/winedit.py +++ b/Mac/Modules/win/winedit.py @@ -48,5 +48,24 @@ f = Method(void, 'ShowWindow', ) methods.append(f) +# +# A method to set the auto-dispose flag +# +AutoDispose_body = """ +int onoff, old = 0; +if (!PyArg_ParseTuple(_args, "i", &onoff)) + return NULL; +if ( _self->ob_freeit ) + old = 1; +if ( onoff ) + _self->ob_freeit = PyMac_AutoDisposeWindow; +else + _self->ob_freeit = NULL; +_res = Py_BuildValue("i", old); +return _res; +""" +f = ManualGenerator("AutoDispose", AutoDispose_body) +f.docstring = lambda: "(int)->int. Automatically DisposeHandle the object on Python object cleanup" +methods.append(f) |