home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / tcl / 2485 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.3 KB

  1. Path: sparky!uunet!opl.com!hri.com!spool.mu.edu!sdd.hp.com!ux1.cso.uiuc.edu!milo.mcs.anl.gov!donner.mcs.anl.gov!lusk
  2. From: lusk@donner.mcs.anl.gov (Rusty Lusk)
  3. Newsgroups: comp.lang.tcl
  4. Subject: Re: printing a canvas
  5. Message-ID: <1993Jan27.211024.15671@mcs.anl.gov>
  6. Date: 27 Jan 93 21:10:24 GMT
  7. References: <1k6igdINNqnj@cae.cad.gatech.edu>
  8. Sender: usenet@mcs.anl.gov
  9. Reply-To: lusk@donner.mcs.anl.gov (Rusty Lusk)
  10. Organization: Argonne National Laboratory, Chicago, Illinois
  11. Lines: 20
  12.  
  13. In article <1k6igdINNqnj@cae.cad.gatech.edu>, estephen@whosnext.cad.gatech.edu (Eric R Stephens) writes:
  14.  
  15. > How do you print canvases?
  16.  
  17. I just discovered this, and it works great.  For some reason it is not 
  18. described in the man page for canvases.  You can figure out the possible
  19. options by looking in the source code, however.  Here is an example:
  20.  
  21. button .buttonframe.print -text Print -borderwidth 2 -command print
  22.  
  23. proc print {} {
  24.    .canvas postscript -file $filename -x 0 -y 0 -width 500 -height 500
  25.     }
  26.  
  27. When you hit the button you get a file with nice color postscript 
  28. for the canvas.  Goddbye forever to screendumps.  The only problem is that
  29. it seems to ignore the backgound color of the canvas (always comes out white),
  30. but you can draw a big rectangle on the canvas to take care of this.
  31.  
  32. - Rusty Lusk
  33.