
airo
stranger
Oct 12, 2001, 2:24 PM
Post #1 of 5
(1574 views)
|
printing a Tk canvas
|
Can't Post
|
|
hi, I'm not sure if this is the correct place for this question. But... is there a way to print a canvas to a printer. here is a simple example of what i have..... use strict; use Tk; use Tk::Menubutton; use Tk::Canvas; my $mw = MainWindow->new; my $canvas = $mw->Canvas(-width=>200,-height=>110, -background=>"white")->pack( -side=>"top",-anchor=>"n"); $canvas->createText(100,20, -text=>"Here is an example of what\nthe form should look like.",-tags=>"note"); $canvas->createText(85,60, -text=>"\nTitle Colors\n(10 spaces)Blue\n(10 spaces)Green\n(10 spaces)Red", -tags=>"note");$canvas->createRectangle(80,50,150,35,-tags=>'note'); $canvas->createRectangle(80,68,150,53,-tags=>"note"); $canvas->createRectangle(80,83,150,70,-tags=>"note"); $canvas->createRectangle(80,100,150,85,-tags=>"note"); $mw->Button(-text=>'Print Canvas',-command=>sub {$canvas->postscript(-file=>"testps.out");},-width=>17)->pack; MainLoop; the button will create a postscript file but I want to just click and have the canvas print. is it possible???? thanks paul
|