Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What event caused my PDE to terminate?



Manish,

Your PDE's Terminate was called because there was nothing more
for your PDE to do. In general, the PDE cannot know if the Print
or Cancel button was pressed because this may occur after the PDE
has been called and dismissed. However, I stuck some fprintfs in my
PDE to see what was called for various situations. I did this by
adding code like this to each function
"fprintf(stderr, "in PDESync(direction=%d)\n", syncDirection);"
and seeing what Console showed. While all API calls have code like
this, I show only the "big 6" below -- Prologue, Initialize, Sync,
Open, Close, and Terminate.

Bring up Print dialog but cancel without displaying PDE at all:
Prologue, Sync(1), Initialize, Terminate.

Show PDE but cancel print dialog without changing any settings:
Prologue, Sync(1), Initialize, Open, Terminate.

Show PDE and change some settings but cancel print dialog:
Prologue, Sync(1), Initialize, Open, Terminate.

Show PDE and change some settings, then switch to Copies & Pages panel
but cancel without printing:
Prologue, Sync(1), Initialize, Open, Sync(0), Close, Terminate.

Show PDE and change some settings, then make the print:
Prologue, Sync(1), Initialize, Open, Sync(0), Close, Terminate.

As you can see, the last two sets of actions have the same result.
Sync(1) moves settings from the print ticket to the PDE, Open shows
the PDE, and "saving" them (by switching panels or pressing the Print
button) calls Sync(0) to move the settings back to the print ticket
and Close to dispose of the PDE, and Terminate does general clean up.
If the next-to-last set of actions cancelled the Print dialog after
switching to Copies & Pages, the calls would have been the same,
because the PDE would no longer be involved.

Hope this helps.
Bob Maggi

> On Tuesday, June 17, 2003, at 03:06 AM, Manish shrikant shet wrote:

> Hi List,
> I am trying to develop my own custom PDE. In the 'terminate'
> function of the PDE, I want to find out the reason which caused my PDE
> to be terminated. It could be one of the three options below
> 1)The user pressed cancel button in the print dialog
> 2)The user selected some other queue in the print dialog
> 3)The user pressed print button in the print dialog
> Actually, the second parameter to my terminate function
"OSStatus
> status " should have the value which I want but it seems that it has
> been reserved for future use. Is there any other way in which I can find

> this out?
>
> Manish
_______________________________________________
printing mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/printing
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.