Debian Codegraph @

demos/winop2.tcl

raw
1 #!../src/bltwish
2
3 package require BLT
4 # --------------------------------------------------------------------------
5 # Starting with Tcl 8.x, the BLT commands are stored in their own
6 # namespace called "blt". The idea is to prevent name clashes with
7 # Tcl commands and variables from other packages, such as a "table"
8 # command in two different packages.
9 #
10 # You can access the BLT commands in a couple of ways. You can prefix
11 # all the BLT commands with the namespace qualifier "blt::"
12 #
13 # blt::graph .g
14 # blt::table . .g -resize both
15 #
16 # or you can import all the command into the global namespace.
17 #
18 # namespace import blt::*
19 # graph .g
20 # table . .g -resize both
21 #
22 # --------------------------------------------------------------------------
23 if { $tcl_version >= 8.0 } {
24 namespace import blt::*
25 namespace import -force blt::tile::*
26 }
27 source scripts/demo.tcl
28
29 set file images/qv100.t.gif
30
31 if { [file exists $file] } {
32 set src [image create photo -file $file]
33 } else {
34 puts stderr "no image file"
35 exit 0
36 }
37
38 set width [image width $src]
39 set height [image height $src]
40
41 option add *Label.font *helvetica*10*
42 option add *Label.background white
43
44 set i 0
45 foreach r { 0 90 180 270 360 45 } {
46 set dest [image create photo]
47 winop image rotate $src $dest $r
48 label .footer$i -text "$r degrees"
49 label .l$i -image $dest
50 table . \
51 0,$i .l$i \
52 1,$i .footer$i
53 update
54 incr i
55 }
56
57