[racket] printer-dc% and end-doc

From: Nikolaus Klepp (dr.klepp at gmx.at)
Date: Tue Nov 20 03:20:06 EST 2012

Thanks to Matthew I have a printer dialog :-)

I can actually print a page, but  (send dc end-doc) throws an error.

Example:

(define pss (get-page-setup-from-user "Drucke das Wunderwerk"))
  (when pss
    (current-ps-setup pss)
    (define dc (new printer-dc%))
    (send dc start-doc "")
    (send dc start-page)
    (send dc set-scale 3 3)
    (send dc set-text-foreground "blue")
    (send dc draw-text "Don't Panic!" 0 0)
    (send dc end-page)
    (send dc end-doc))

 meth: broke its contract
 promised: void?
 produced: #<semaphore>
 in: the range of
      (->m void?)
 contract from: (class printer-dc%)
 blaming: (class printer-dc%)

Well, the page is printed, but I would like to get rid of that error. Any way 
to do that?

Nik

Posted on the users mailing list.