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.
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::"
14 # blt::table . .g -resize both
16 # or you can import all the command into the global namespace.
18 # namespace import blt::*
20 # table . .g -resize both
22 # --------------------------------------------------------------------------
23 if { $tcl_version >= 8.0 } {
24 namespace import blt::*
25 namespace import -force blt::tile::*
27 source scripts/demo.tcl
29 if { [ file exists ./images/sample.gif] } {
30 set src [image create photo -file ./images/sample.gif]
32 puts stderr "no image file"
36 set width [image width $src]
37 set height [image height $src]
39 option add *Label.font *helvetica*10*
40 option add *Label.background white
42 label .header0 -text "$width x $height"
43 label .footer0 -text "100%"
46 for { set i 2 } { $i <= 10 } { incr i } {
47 set iw [expr $width / $i]
48 set ih [expr $height / $i]
49 set r [format %6g [expr 100.0 / $i]]
50 image create photo r$i -width $iw -height $ih
51 winop image resample $src r$i sinc
52 label .header$i -text "$iw x $ih"
53 label .footer$i -text "$r%"