wm title . "Canvasprintbox Example" ##========================================================= ## Create a canvasprintbox iwidget ##========================================================= ## iwidgets::canvasprintbox .cpb \ -stretch 0 \ -filename "canvas_out.ps" \ -orient portrait \ -output file \ -pagesize Letter pack .cpb ## ## Create a canvas to show the usage ## canvas .can pack .can \ -expand true \ -fill both .can create oval 50 50 100 100 \ -fill red .can create oval 100 50 150 100 \ -fill green update ## ## import the canvas to the Canvasprintbox ## .cpb setcanvas .can pack forget .can ## ## Create a label to show the destination ## just for illustration purposes ## label .label \ -relief raised pack .label \ -fill x \ -expand true .label configure \ -text "The output will go to: [.cpb getoutput]"