Debian Codegraph @

demos/tabset1.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
28 source scripts/demo.tcl
29
30 image create photo bgTile -file ./images/chalk.gif
31 image create photo label1 -file ./images/mini-book1.gif
32 image create photo label2 -file ./images/mini-book2.gif
33
34 tabset .t -relief raised \
35 -activebackground yellow \
36 -bg red -borderwidth 0 -highlightthickness 0 \
37 -scrollcommand { .s set } \
38 -width 3i
39
40 #option add *iPadX 4
41 #option add *iPadY 2
42
43 .t insert end First \
44 -image label1 \
45 -anchor center \
46 -selectbackground darkolivegreen2 \
47 Again Next another test of \
48 a -image label2 widget
49
50 scrollbar .s -command { .t view } -orient horizontal
51 table . \
52 .t 0,0 -fill both \
53 .s 1,0 -fill x
54
55 table configure . r1 -resize none
56 focus .t
57