Carbon


PMPrintDialogInitProcPtr

Header: PMApplication.h Carbon status: Not Recommended

Defines a pointer to a dialog initialization function the Carbon Printing Manager calls before displaying your custom Print dialog box. Your initialization function can append items to the Print dialog box.

typedef void(* PMPrintDialogInitProcPtr) (
    PMPrintSettings printSettings, 
    PMDialog *theDialog
);

You would declare your function like this if you were to name it MyPMPrintDialogInitCallback:

void MyPMPrintDialogInitCallback (
    PMPrintSettings printSettings, 
    PMDialog *theDialog
);
Parameter descriptions
printSettings

A PMPrintSettings object.

theDialog

A pointer to the PMDialog object representing your custom Print dialog box. You obtain this object from the PMSessionPrintDialogInit function. Because the PMSessionPrintDialogMain function does not pass this object to the Carbon Printing Manager, your application should store a pointer to the dialog object in a global variable or as extended data in the PMPrintSettings object, where it is accessible by your initialization function.

DISCUSSION

You pass a pointer to your dialog initialization function as a parameter to the PMSessionPrintDialogMain function. The Carbon Printing Manager then calls your dialog initialization function before displaying your custom Print dialog box. Your initialization function can append items to the Print dialog box, and should install an event filter using the PMSetModalFilterProc function.

To provide a pointer to your dialog initialization function, you create a universal procedure pointer (UPP) of type PMPrintDialogInitUPP, using the function NewPMPrintDialogInitUPP . You can do so with code like the following:

PMPrintDialogInitUPP MyPrintDialogInitCallbackUPP;

MyPrintDialogInitCallbackUPP = NewPMPrintDialogInitUPP ( &MyPrintDialogInitCallback );

If you wish to call your dialog initialization function directly, you can use the InvokePMPrintDialogInitUPP function.

After you are finished with your dialog initialization function, you can dispose of the UPP with the DisposePMPrintDialogInitUPP function. However, if you will use the same dialog initialization function for subsequent print jobs, you can reuse the same UPP, rather than dispose of it and later create a new UPP.

SPECIAL CONSIDERATIONS

Valid within the context of a printing session after calling PMSessionPrintDialogInit.


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)