Jack Jansen | e058189 | 1999-02-07 14:02:03 +0000 | [diff] [blame] | 1 | f = Function(ControlHandle, 'as_Control', |
| 2 | (Handle, 'h', InMode)) |
| 3 | functions.append(f) |
| 4 | |
Jack Jansen | 5d56f4b | 1995-06-18 20:16:33 +0000 | [diff] [blame] | 5 | as_resource_body = """ |
| 6 | return ResObj_New((Handle)_self->ob_itself); |
| 7 | """ |
| 8 | |
| 9 | f = ManualGenerator("as_Resource", as_resource_body) |
| 10 | f.docstring = lambda : "Return this Control as a Resource" |
| 11 | |
| 12 | methods.append(f) |
Jack Jansen | cfb60ee | 1996-10-01 10:46:46 +0000 | [diff] [blame] | 13 | |
| 14 | DisposeControl_body = """ |
| 15 | if (!PyArg_ParseTuple(_args, "")) |
| 16 | return NULL; |
| 17 | if ( _self->ob_itself ) { |
Jack Jansen | a755e68 | 1997-09-20 17:40:22 +0000 | [diff] [blame] | 18 | SetControlReference(_self->ob_itself, (long)0); /* Make it forget about us */ |
Jack Jansen | cfb60ee | 1996-10-01 10:46:46 +0000 | [diff] [blame] | 19 | DisposeControl(_self->ob_itself); |
| 20 | _self->ob_itself = NULL; |
| 21 | } |
| 22 | Py_INCREF(Py_None); |
| 23 | _res = Py_None; |
| 24 | return _res; |
| 25 | """ |
| 26 | |
| 27 | f = ManualGenerator("DisposeControl", DisposeControl_body) |
| 28 | f.docstring = lambda : "() -> None" |
| 29 | |
| 30 | methods.append(f) |