File: tabset1.tcl

package info (click to toggle)
blt 2.4m-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 7,316 kB
  • ctags: 7,778
  • sloc: ansic: 68,187; tcl: 12,491; sh: 1,918; makefile: 709; csh: 25
file content (57 lines) | stat: -rwxr-xr-x 1,574 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!../src/bltwish

package require BLT
# --------------------------------------------------------------------------
# Starting with Tcl 8.x, the BLT commands are stored in their own 
# namespace called "blt".  The idea is to prevent name clashes with
# Tcl commands and variables from other packages, such as a "table"
# command in two different packages.  
#
# You can access the BLT commands in a couple of ways.  You can prefix
# all the BLT commands with the namespace qualifier "blt::"
#  
#    blt::graph .g
#    blt::table . .g -resize both
# 
# or you can import all the command into the global namespace.
#
#    namespace import blt::*
#    graph .g
#    table . .g -resize both
#
# --------------------------------------------------------------------------
if { $tcl_version >= 8.0 } {
    namespace import blt::*
    namespace import -force blt::tile::*
}

source scripts/demo.tcl

image create photo bgTile -file ./images/chalk.gif
image create photo label1 -file ./images/mini-book1.gif
image create photo label2 -file ./images/mini-book2.gif

tabset .t -relief raised \
    -activebackground yellow \
    -bg red -borderwidth 0 -highlightthickness 0 \
    -scrollcommand { .s set } \
    -width 3i 

#option add *iPadX 4
#option add *iPadY 2

.t insert end First \
    -image label1 \
    -anchor center \
    -selectbackground darkolivegreen2  \
    Again Next another test of \
    a -image label2 widget 

scrollbar .s -command { .t view } -orient horizontal
table . \
    .t 0,0 -fill both \
    .s 1,0 -fill x 

table configure . r1 -resize none
focus .t