File: tabset1.tcl

package info (click to toggle)
blt 3.0~1%2B08570046%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 45,556 kB
  • sloc: ansic: 278,852; tcl: 96,434; sh: 3,410; makefile: 2,026; cpp: 374
file content (93 lines) | stat: -rw-r--r-- 1,902 bytes parent folder | download
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!../src/bltwish
package require BLT
if 0 {
option add *Tabset*Tab.PadY 0
option add *Tabset*Tab.PadX 0
option add *Tabset.Tab.iPadY 0
option add *Tabset.Tab.iPadX 0
#option add *Tabset.Tab.background green
}
if { [blt::winop xdpi] > 150 } {
  image create picture img1 -file $blt_library/icons/32x32/filter.tga
} else {
  image create picture img1 -file $blt_library/icons/16x16/filter.tga
}
image create picture img2 -file ./images/mini-book2.gif
image create picture img3 -width 10 -height 30
img3 blank white

set side bottom
blt::tabset .t \
    -outerrelief raised \
    -side $side \
    -tearoff yes \
    -slide yes \
    -slant none \
    -scrolltabs yes \
    -justify center \
    -tabwidth same \
    -outerborderwidth 0 \
    -highlightthickness 0 \
    -scrollcommand { .s set } \
    -rotate auto \
    -xbutton selected 
.t add First \
    -icon img1 \
    -anchor center \
   
if 1 {
.t style create green \
	-selectbackground darkolivegreen2 \
	-perforationbackground darkolivegreen2  
.t style create blue \
	-selectbackground lightblue \
	-perforationbackground lightblue 

foreach page { Second Third Fourth Fifth } {
    .t add $page \
	-anchor center \
	-style green
    #	-icon img3
}

.t add -text Sixth \
    -style blue
}
set tabcount 0
proc NewTab { args } {
    global tabcount
    set i [.t insert end "New Tab $tabcount"]
    .t select $i
    update
    .t focus $i
    .t see last
    incr tabcount
}

.t style create plus \
    -selectbackground yellow 
.t add "+" \
    -anchor center \
    -style plus \
    -selectcommand NewTab


if { $side == "bottom" || $side == "top" } {
  set orient "horizontal"
  set loc 1,0
  set fill x
} else {
  set orient "vertical"
  set loc 0,1
  set fill y

}

blt::tk::scrollbar .s -command { .t view } -orient $orient
blt::table . \
    .t 0,0 -fill both \
    .s $loc -fill $fill

blt::table configure . r1 -resize none
focus .t