canvasprintbox - Create and manipulate a canvas print box widget
SYNOPSIScanvasprintbox pathName ?options?
INHERITANCEitk::Widget <- Canvasprintbox
See the "options" manual entry for details on the standard options.
Name: filename Class: FileName Command-Line Switch: -filename
Name: hpagecnt Class: PageCnt Command-Line Switch: -hpagecnt
Name: orient Class: Orient Command-Line Switch: -orient
Name: output Class: Output Command-Line Switch: -output
Name: pageSize Class: PageSize Command-Line Switch: -pagesize
Name: posterize Class: Posterize Command-Line Switch: -posterize
Name: printCmd Class: PrintCmd Command-Line Switch: -printcmd
Name: printRegion Class: PrintRegion Command-Line Switch: -printregion
Name: stretch Class: Stretch Command-Line Switch: -stretch
Name: vPageCnt Class: PageCnt Command-Line Switch: -vpagecnt
Implements a print box for printing the contents of a canvas widget to a printer or a file. It is possible to specify page orientation, the number of pages to print the image on and if the output should be stretched to fit the page. Options exist to control the appearance and actions of the widget.
The canvasprintbox command creates a new Tcl command whose name is pathName. This command may be used to invoke various operations on the widget. It has the following general form:
pathName option ?arg arg ...?Option and the args determine the exact behavior of the command. The following commands are possible for canvasprintbox widgets:
- pathName cget option
- Returns the current value of the configuration option given by option. Option may have any of the values accepted by the canvasprintbox command.
- pathName configure ?option? ?value option value ...?
- Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the canvasprintbox command.
- pathName getoutput
- Returns the value of the printercmd or filename option depending on the current setting of output.
- pathName print
- Perfrom the actual printing of the canvas using the current settings of all the attributes. Returns a boolean indicating wether the printing was successful or not.
- pathName refresh
- Retrieves the current value for all edit fields and updates the stamp accordingly. Is useful for Apply-buttons.
- pathName setcanvas canvas
- This is used to set the canvas that has to be printed. A stamp-sized copy will automatically be drawn to show how the output would look with the current settings.
- pathName stop
- Stops the drawing of the "stamp". I'm currently unable to detect when a Canvasprintbox gets destroyed or withdrawn. It's therefore advised that you perform a stop before you do something like that.
Name: prtflentry Class: Entry
Name: hpcnt Class: Entry
Name: vpcnt Class: Entry
canvasprintbox .fsb -orient landscape -stretch 1 pack .fsb -padx 10 -pady 10 -fill both -expand yes