1 # This file creates a visual test for bevels drawn around text in text
2 # widgets. It is part of the Tk visual test suite, which is invoked
3 # via the "visual" script.
9 wm title .t "Visual Tests for Borders in Text Widgets"
10 wm iconname .t "Text Borders"
13 text .t.t -width 60 -height 30 -setgrid true -xscrollcommand {.t.h set} \
15 -yscrollcommand {.t.v set} -wrap none -relief raised -bd 2
16 scrollbar .t.v -orient vertical -command ".t.t yview"
17 scrollbar .t.h -orient horizontal -command ".t.t xview"
18 button .t.quit -text Quit -command {destroy .t}
19 pack .t.quit -side bottom -pady 3 -ipadx 4 -ipady 2
20 pack .t.h -side bottom -fill x
21 pack .t.v -side right -fill y
22 pack .t.t -expand yes -fill both
25 if {[winfo depth .t] > 1} {
26 .t.t tag configure r1 -relief raised -borderwidth 2 -background #b2dfee
27 .t.t tag configure r2 -relief raised -borderwidth 2 -background #b2dfee \
29 .t.t tag configure s1 -relief sunken -borderwidth 2 -background #b2dfee
31 .t.t tag configure r1 -relief raised -borderwidth 2 -background white
32 .t.t tag configure r2 -relief raised -borderwidth 2 -background white \
34 .t.t tag configure s1 -relief sunken -borderwidth 2 -background white
36 .t.t tag configure indent1 -lmargin1 100
37 .t.t tag configure indent2 -lmargin1 200
39 .t.t insert end {This display contains a bunch of raised and sunken
40 regions to exercise the bevel-drawing facilities of
41 DisplayLineBackground. The letters have the following
44 r - should appear raised
45 u - should appear raised and also slightly offset vertically
46 s - should appear sunken
47 n - preceding relief should extend right to end of line.
48 * - should appear "normal"
49 x - extra long lines to allow horizontal scrolling.
51 Try scrolling the text both vertically and horizontally to
52 be sure that the bevels are still drawn correctly.
54 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
60 .t.t insert end rrrrrrr r1
61 .t.t insert end uuuu r2
62 .t.t insert end ************
63 .t.t insert end ssssssssssssssssss s1
64 .t.t insert end \n\n****************
65 .t.t insert end rrrrrrrrrrrrrrn\n r1
67 .t.t insert end "\nPass 2 (top bevels):\n\n"
68 .t.t insert end rrrrrrrrrrrrrr r1
69 .t.t insert end rrrrr {r1 dummy}
70 .t.t insert end rrrrrrrrrrrrrrrrrrr r1
71 .t.t insert end \n************
72 .t.t insert end rrrrrrrrrrrrrrrrr r1
73 .t.t insert end ***********\n
74 .t.t insert end rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r1
75 .t.t insert end \n\n***
76 .t.t insert end rrrrrrrrrrrrrrrrrrr r1
77 .t.t insert end ***********\n*
78 .t.t insert end rrrrrrrrr r1
79 .t.t insert end ********
80 .t.t insert end rrrrrrrrrrrrrrrrrrrrrrrrr r1
82 .t.t insert end *** dummy
83 .t.t insert end rrrrrrrrrrrrrrrrrrrrrrrrr r1
84 .t.t insert end n\nrrrrrrrrrrrrrrr {r1 indent1}
85 .t.t insert end \n\n***
86 .t.t insert end rrr r1
88 .t.t insert end rrrr {r1 indent1}
90 .t.t insert end \n\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n\n
91 .t.t insert end "Pass 3 (bottom bevels):\n\n"
92 .t.t insert end *******
93 .t.t insert end ********** dummy
94 .t.t insert end rrrrrrrrrrrrrrrr r1
95 .t.t insert end **********\n
96 .t.t insert end rrrrrrrrr r1
97 .t.t insert end uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu r2
98 .t.t insert end \n********************
99 .t.t insert end rrrrrrrrrrrrrrr r1
100 .t.t insert end ************\n\n*
101 .t.t insert end rrrrrrrrrrrr r1
102 .t.t insert end ********
103 .t.t insert end rrrrrrrrrrrrrrrrrrrrrrrrr r1
104 .t.t insert end \n*****
105 .t.t insert end rrrrrrrrrrrrrrrrrrrr r1
106 .t.t insert end **********\n\n
107 .t.t insert end rrrrrrrrrrrrrrr {r1 indent1}
108 .t.t insert end \n** dummy
110 .t.t insert end rrrrrrrrrrrrrrrrrrrrn\n r1
112 .t.t insert end rrrr {r1 indent1}
113 .t.t insert end \n***
114 .t.t insert end rrr r1
116 .t.t insert end \n\nMiscellaneous:\n\n
117 .t.t insert end rrr r1
118 .t.t insert end *****
119 .t.t insert end rrr r1
123 .t.t insert end rrrrr r1
126 .t.t insert end rrr r1
127 .t.t insert end *****
128 .t.t insert end rrr r1