Beispiel #1
0
static PyObject *Ah_AHRegisterHelpBook(PyObject *_self, PyObject *_args)
{
    PyObject *_res = NULL;
    OSStatus _err;
    FSRef appBundleRef;
    if (!PyArg_ParseTuple(_args, "O&",
                          PyMac_GetFSRef, &appBundleRef))
        return NULL;
    _err = AHRegisterHelpBook(&appBundleRef);
    if (_err != noErr) return PyMac_Error(_err);
    Py_INCREF(Py_None);
    _res = Py_None;
    return _res;
}
Beispiel #2
0
void RegisterHelpBook (void)
{
	OSStatus	err;
	CFBundleRef	bundleRef;
	CFURLRef	bundleURL;
	FSRef		fref;

	bundleRef = CFBundleGetMainBundle();
	if (bundleRef)
	{
		bundleURL = CFBundleCopyBundleURL(bundleRef);
		if (bundleURL)
		{
			if (CFURLGetFSRef(bundleURL, &fref))
				err = AHRegisterHelpBook(&fref);

			CFRelease(bundleURL);
		}
	}
}