Carbon


PMItemProcPtr

Header: PMApplication.h Carbon status: Not Recommended

Defines a pointer to a dialog item event handling function. Your dialog item event handling function receives events for items you’ve added to your custom Page Setup or Print dialog box.

typedef void(* PMItemProcPtr) (
    DialogRef theDialog, 
    SInt16 item
);

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

void MyPMItemCallback (
    DialogRef theDialog, 
    SInt16 item
);
Parameter descriptions
theDialog

A PMDialog object representing your customized Page Setup or Print dialog box.

item

The number of the dialog item receiving the event.

DISCUSSION

You must provide an event handling callback function if you add items to the Page Setup or Print dialog boxes. Use the PMSetItemProc function to install your callback function.

To provide a pointer to your event handling function, you create a universal procedure pointer (UPP) of type PMItemUPP, using the function NewPMItemUPP . You can do so with code like the following:

PMItemUPP MyPMItemCallbackUPP;

MyPMItemCallbackUPP = NewPMPItemUPP ( &MyPMItemCallback );

If you wish to call your event handling function directly, you can use the InvokePMItemUPP function.

After you are finished with your event handling function, you can dispose of the UPP with the DisposePMItemUPP function. However, if you will use the same event handling 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 creating a custom Page Setup or Print dialog box and calling PMSetItemProc to register your dialog item event handling function.


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