[comp.sys.mac] Printing Question

rs4u+@ANDREW.CMU.EDU.UUCP (07/07/87)

I've got an application under development, and I thought that for
printing I'd implement a background procedure so that I could
use a dialog box with a "Cancel" button and a status bar
showing the percentage of the page printed. Following the
suggestion in Inside Macintosh (volume2, page 154), I set the
"pIdleProc" field of my print handle to "DoDialog" (which is my
idle procedure).

The procedure never gets called! Just to be sure, I put a SysBeep in
the procedure, and the procedure never gets invoked.

I'm printing on the LaserWriter, using System 4.1 and the
new PrintTraps interface (though I suspect the problem would
remain if I used the older MacPrint interfaces and the glue).

I suspect that the LaserWriter printing process never calls the
IdleProc; can anyone verify this? What am I doing wrong?

Help?

		--Rich

Oh yeah - in case it matters, I'm using Lightspeed Pascal.

woody@tybalt.caltech.edu.UUCP (07/07/87)

pIdleProc only is called during spool printing; specifically, pIdleProc is
called during the process of printing a spooled file.  The only printer that
uses this is the Imagewriter, which stores the page youre printing as a
picture, and then (during PrPicFile) scan converts the picture and prints it
out on the imagewriter.  pIdleProc is called only during the scan conversion
process.

As the Laserwriter only prints in "draft" mode (ie, there is no scan
conversion phase), the routine pIdleProc of course is not called.
The proper way to implement the dialog you're after is to set up and
maintain the dialog during the process of "drawing" the pages into the
tprport grafport.  (And you may want to note in the dialog if the drawing
is taking place, or if scan conversion is taking place.)

Sorry for posting this one to the network, but the mailer here is having
problems.  Maybe when I leave Caltech and start work in September, they'll
have a reasonable mailer and news reader program!!!
- William Woody                          Mac! > ][n && /|\
  woody@tybalt.caltech.edu
  woody@juliet.caltech.edu

dowdy@apple.UUCP (Tom Dowdy) (07/08/87)

In article <IUwGZ3y00V4Ihk80G9@andrew.cmu.edu> rs4u+@ANDREW.CMU.EDU (Richard Siegel) writes:
>
>I've got an application under development, and I thought that for
>printing I'd implement a background procedure so that I could
>use a dialog box with a "Cancel" button and a status bar
>showing the percentage of the page printed. Following the
>suggestion in Inside Macintosh (volume2, page 154), I set the
>"pIdleProc" field of my print handle to "DoDialog" (which is my
>idle procedure).
>

From volume2, page154:

"Note: If you designate a background procedure, you must set pIdleProc
AFTER presenting the dialogs, validating the print record, and initializing
the printing grafPort:  The routines that performs these operations
reset pIdleProc to NIL."

I got stung with this once myself, perhaps it is the problem in this case
as well.  Pretty simple fix if it is.

  Tom Dowdy                 CSNET:    dowdy@apple.CSNET
  Apple Computer MS:27Y     AppleLink:DOWDY1
  20525 Mariani Ave         UUCP:     {sun,voder,amdahl,decwrl}!apple!dowdy
  Cupertino, CA 95014       
  "Plus ca change, Plus c'est la meme chose."