home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Python 1.4 / Python 1.4 source / Mac / Modules / ctl / ctledit.py < prev    next >
Encoding:
Text File  |  1996-10-01  |  616 b   |  27 lines  |  [TEXT/Pyth]

  1. as_resource_body = """
  2. return ResObj_New((Handle)_self->ob_itself);
  3. """
  4.  
  5. f = ManualGenerator("as_Resource", as_resource_body)
  6. f.docstring = lambda : "Return this Control as a Resource"
  7.  
  8. methods.append(f)
  9.  
  10. DisposeControl_body = """
  11.     if (!PyArg_ParseTuple(_args, ""))
  12.         return NULL;
  13.     if ( _self->ob_itself ) {
  14.         SetCRefCon(_self->ob_itself, (long)0); /* Make it forget about us */
  15.         DisposeControl(_self->ob_itself);
  16.         _self->ob_itself = NULL;
  17.     }
  18.     Py_INCREF(Py_None);
  19.     _res = Py_None;
  20.     return _res;
  21. """
  22.  
  23. f = ManualGenerator("DisposeControl", DisposeControl_body)
  24. f.docstring = lambda : "() -> None"
  25.  
  26. methods.append(f)
  27.