OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [tags/] [start/] [insight/] [itcl/] [iwidgets3.0.0/] [demos/] [canvasprintdialog] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
#!/bin/sh
2
# ----------------------------------------------------------------------
3
#  DEMO: canvasprintdialog in [incr Widgets]
4
# ----------------------------------------------------------------------
5
#\
6
exec itkwish "$0" ${1+"$@"}
7
package require Iwidgets 3.0
8
 
9
# itkwish interprets the rest...
10
# ----------------------------------------------------------------------
11
option add *textBackground seashell
12
 
13
#
14
# Make a canvas for the main application:
15
#
16
canvas .c -width 200 -height 200 -background white
17
pack .c
18
 
19
.c create rectangle 30 30 150 150 -fill blue
20
.c create oval 70 70 190 190 -fill red
21
.c create polygon 60 50 110 180 10 180 -fill green
22
.c create text 100 5 -anchor n -text "Example Drawing"
23
 
24
button .print -text "Print..." -command {
25
    if {[.pcd activate]} {
26
        puts "use command \".pcd print\" to really print"
27
    } else {
28
        puts "aborted"
29
    }
30
}
31
pack .print
32
 
33
iwidgets::canvasprintdialog .pcd -modality application \
34
    -printcmd "lpr" -pagesize "A4"
35
 
36
.pcd setcanvas .c

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.