| 1 |
# ---------------------------------------------------------------------- |
| 2 |
# DEMO: canvasprintbox in [incr Widgets] |
| 3 |
# ---------------------------------------------------------------------- |
| 4 |
package require Iwidgets 4.0 |
| 5 |
|
| 6 |
option add *textBackground seashell |
| 7 |
|
| 8 |
# |
| 9 |
# Make a canvas for the main application: |
| 10 |
# |
| 11 |
canvas .c -width 200 -height 200 -background white |
| 12 |
pack .c |
| 13 |
|
| 14 |
.c create rectangle 30 30 150 150 -fill blue |
| 15 |
.c create oval 70 70 190 190 -fill red |
| 16 |
.c create polygon 60 50 110 180 10 180 -fill green |
| 17 |
.c create text 100 5 -anchor n -text "Example Drawing" |
| 18 |
|
| 19 |
iwidgets::canvasprintbox .pcb -printcmd "lpr" -pagesize "A4" |
| 20 |
|
| 21 |
.pcb setcanvas .c |
| 22 |
|