1iwidgets::canvasprintbox  −  Create and manipulate a canvas print
2box widget iwidgets::canvasprintbox pathName ?options?  itk::Wid‐
3get <‐ iwidgets::Canvasprintbox

activeBackground background borderWidth cursor

foreground highlightBackground highlightColor highlightThickness

insertBackground insertBorderWidth insertOffTime insertOnTime

insertWidth relief repeatDelay repeatInterval

selectBackground selectBorderWidth selectForeground

9See  the  "options"  manual entry for details on the standard op‐
10tions.
11Name:           filename
12Class:          FileName
13Command‐Line Switch:           ‐filename
14The file to write the postscript output to (Only when  output  is
15set  to  "file"). If posterizing is turned on and hpagecnt and/or

vpagecnt is more than 1, x.y is appended to the filename where x

17is the horizontal page number and y the vertical page number.
18Name:           hpagecnt
19Class:          PageCnt
20Command‐Line Switch:           ‐hpagecnt
21Is  used in combination with posterize to determine over how many
22pages the output should be distributed. This attribute  specifies
23how  many  pages  should be used horizontaly.  Any change to this
24attribute will automatically update the "stamp".  Defaults to 1.
25Name:           orient
26Class:          Orient
27Command‐Line Switch:           ‐orient
28Determines the orientation of  the  output  to  the  printer  (or
29file).   It  can  take  the  value "portrait" or "landscape" (de‐
30fault). Changes to this attribute will be  reflected  immediately
31in  the "stamp".  Defaults to "landscape" but will be changed au‐
32tomaticaly to the value deemed appropiate for the current canvas.
33Setting  this  attribute  when  the  canvasprintbox is first con‐
34structed (instead of using the "configure" method) will turn  off
35the auto adjustment of this attribute.
36Name:           output
37Class:          Output
38Command‐Line Switch:           ‐output
39Specifies  where  the postscript output should go: to the printer
40or to a file. Can take on the values "printer"  or  "file".   The
41corresponding  entry‐widget  will  reflect the contents of either
42the printcmd attribute or the filename  attribute.   Defaults  to
43"printer".
44Name:           pageSize
45Class:          PageSize
46Command‐Line Switch:           ‐pagesize
47The pagesize the printer supports. Changes to this attribute will
48be reflected immediately in the "stamp".  Defaults to "a4".
49Name:           posterize
50Class:          Posterize
51Command‐Line Switch:           ‐posterize
52Indicates if posterizing is turned on  or  not.  Posterizing  the
53output  means  that  it is possible to distribute the output over
54more than one page. This way it is possible to print a canvas/re‐
55gion which is larger than the specified pagesize without stretch‐
56ing. If used in combination with stretching it  can  be  used  to
57"blow  up"  the  contents  of a canvas to as large as size as you
58want (See attributes: hpagecnt and vpagecnt). Any change to  this
59attribute will automatically update the "stamp".  Defaults to 0.
60Name:           printCmd
61Class:          PrintCmd
62Command‐Line Switch:           ‐printcmd
63The  command to execute when printing the postscript output.  The
64command will get the postscript directed to  its  standard  input
65(Only when output is set to "printer").  Defaults to "lpr".
66Name:           printRegion
67Class:          PrintRegion
68Command‐Line Switch:           ‐printregion
69A list of four coordinates specifying which part of the canvas to
70print.  An empty list means that the canvas’ entire  scrollregion
71should be printed. Any change to this attribute will automatical‐
72ly update the "stamp".  Defaults to an empty list.
73Name:           stretch
74Class:          Stretch
75Command‐Line Switch:           ‐stretch
76Determines if the output should be stretched to fill the page (as
77defined  by the attribute pagesize) as large as possible. The as‐
78pect‐ratio of the output will be retained  and  the  output  will
79never  fall outside of the boundaries of the page.  Defaults to 0
80but will be changed automaticaly to the value  deemed  appropiate
81for  the  current  canvas.  Setting  this attribute when the can‐
82vasprintbox is first constructed (instead of using  the  "config‐
83ure" method) will turn off the auto adjustment of this attribute.
84Name:           vPageCnt
85Class:          PageCnt
86Command‐Line Switch:           ‐vpagecnt
87Is  used  in  combination  with "posterize" to determine over how
88many pages the output should be distributed. This attribute spec‐
89ifies  how  many  pages  should be used verticaly.  Any change to
90this attribute will automatically update the  "stamp".   Defaults
91to 1.
92
93Implements a print box for printing the contents of a canvas wid‐
94get to a printer or a file. It is possible to specify page orien‐
95tation, the number of pages to print the image on and if the out‐
96put should be stretched to fit the page. Options exist to control
97the appearance and actions of the widget.
98
99The  iwidgets::canvasprintbox  command  creates a new Tcl command
100whose name is pathName.  This command may be used to invoke vari‐
101ous operations on the widget.  It has the following general form:

pathName option ?arg arg ...? Option and the args determine the

103exact behavior of the command.  The following commands are possi‐
104ble for canvasprintbox widgets:
105

pathName cget option Returns the current value of the configura‐

107tion  option  given by option.  Option may have any of the values
108accepted by the iwidgets::canvasprintbox command.  pathName  con‐

figure ?option? ?value option value ...? Query or modify the

110configuration options of the widget.  If no option is  specified,
111returns  a list describing all of the available options for path‐

Name (see Tk_ConfigureInfo for information on the format of this

113list).   If  option  is specified with no value, then the command
114returns a list describing the one named option (this list will be
115identical  to  the corresponding sublist of the value returned if
116no option is specified).  If one or more option−value  pairs  are
117specified,  then  the command modifies the given widget option(s)
118to have the given value(s);  in this case the command returns  an
119empty  string.  Option may have any of the values accepted by the

iwidgets::canvasprintbox command. pathName getoutput Returns the

121value  of the printercmd or filename option depending on the cur‐
122rent setting of output.  pathName print Perfrom the actual print‐
123ing  of  the  canvas  using  the  current settings of all the at‐
124tributes. Returns a boolean indicating wether  the  printing  was
125successful  or not.  pathName refresh Retrieves the current value
126for all edit fields and updates the stamp accordingly. Is  useful
127for Apply‐buttons.  pathName setcanvas canvas This is used to set
128the canvas that has to be printed.  A stamp‐sized copy will auto‐
129matically  be  drawn  to  show how the output would look with the
130current  settings.   pathName  stop  Stops  the  drawing  of  the
131"stamp".  I’m  currently  unable  to detect when a Canvasprintbox
132gets destroyed or withdrawn. It’s therefore advised that you per‐
133form a stop before you do something like that.
134Name:           prtflentry
135Class:          Entry
136The prtflentry component is the entry field for user input of the

filename or printer command (depending on the value of output).

138Name:           hpcnt
139Class:          Entry
140The hpcnt component is the entry field for user input of the num‐
141ber of pages to use horizontaly when posterize is turned on.
142Name:           vpcnt
143Class:          Entry
144The vpcnt component is the entry field for user input of the num‐
145ber of pages to use verticaly when posterize is turned on.
146
147package require Iwidgets 4.0 iwidgets::canvasprintbox .fsb  ‐ori‐
148ent  landscape  ‐stretch 1 pack .fsb ‐padx 10 ‐pady 10 ‐fill both
149‐expand  yes  Tako  Schotanus   Tako.Schotanus@bouw.tno.nl   can‐
150vasprintbox, widget
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
Impressum