![]() |
PMIdleProcPtr |
||||
Header: | PMCore.h | Carbon status: | Not Recommended | |
Defines a pointer to an idle function the Carbon Printing Manager calls during your print loop. Your idle function can display status information during printing.
typedef void(* PMIdleProcPtr) ();
You would declare your function like this if you were to name it MyPMIdleCallback:
void MyPMIdleCallback ();
If you install an idle function using the PMSessionSetIdleProc function or the PMSetIdleProc function, the Carbon Printing Manager will call your idle function periodically during your print loop. Your idle function can display application status while printing, but it should not duplicate information displayed by the Carbon Printing Manager or the printer driver.
Your idle function must check whether the user has pressed Command-period, in which case your application should stop its printing operation. If your status dialog box contains a button to cancel the printing operation, your idle function should also check for clicks in the button and respond accordingly.
To provide a pointer to your idle function, you create a universal procedure pointer (UPP) of type PMIdleUPP, using the function NewPMIdleUPP. You can do so with code like the following:
PMIdleUPP MyPrintIdleUPP;
MyPrintIdleUPP = NewPMIdleUPP ( &MyPrintIdleCallback );
If you wish to call your idle function directly, you can use the InvokePMIdleUPP function.
When your print job is completed, you should use the DisposePMIdleUPP function to dispose of the universal procedure pointer associated with your idle function. However, if you will use the same idle function in subsequent print jobs, you can reuse the same UPP, rather than dispose of it and later create a new UPP.
Valid within the context of a printing session.
© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)