Tk Source Code

Changes On Branch deprecate-bd-bg-fg
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch deprecate-bd-bg-fg Excluding Merge-Ins

This is equivalent to a diff from 32a9cba0 to e50471a0

2020-10-27
12:26
Merge 8.7 Closed-Leaf check-in: e50471a0 user: jan.nijtmans tags: deprecate-bd-bg-fg
12:25
Merge 8.6 check-in: 0b35c1c6 user: jan.nijtmans tags: trunk, main
09:57
Update tk_setPalette and documentation check-in: f75b96c6 user: jan.nijtmans tags: deprecate-bd-bg-fg
07:08
Rename "trunk" to "main". Add "trunk" propagating tag for backwards compatibility check-in: 0f77b70d user: jan.nijtmans tags: trunk, main
01:25
Merge 8.6 Closed-Leaf check-in: 32a9cba0 user: marc_culler tags: trunk
2020-10-26
08:58
Merge 8.6 check-in: 88e0ce57 user: jan.nijtmans tags: trunk
2020-10-25
20:11
Adjustment for Sierra. Closed-Leaf check-in: 77a51c32 user: culler tags: bug-5cc72e002c

Changes to .travis.yml.
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
177
178
179
180
181
182
183










184
185
186
187
188
189



190
191
192
193
194
195



196
197
198
199
200
201



202
203
204
205
206
207
208



209
210
211
212
213
214
215
216
217
218
219



220
221
222
223
224
225
226
227
228
229
230



231
232
233
234
235
236
237







-
-
-
-
-
-
-
-
-
-






-
-
-






-
-
-






-
-
-







-
-
-











-
-
-











-
-
-







        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include"
    - name: "macOS/Clang++/Xcode 12/Shared"
      os: osx
      osx_image: xcode12
      env:
        - BUILD_DIR=unix
        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib CC=clang++ --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-D__private_extern__=extern"
    - name: "macOS/Xcode 12/Shared"
      os: osx
      osx_image: xcode12
      env:
        - BUILD_DIR=unix
        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include"
      install:
        - ./configure ${CFGOPT} "--prefix=$HOME" || (cat config.log && exit 1)
      script: &mactest
        - make all tktest
    - name: "macOS/Xcode 12/Static"
      os: osx
      osx_image: xcode12
      env:
        - BUILD_DIR=unix
        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua --disable-shared CFLAGS=-I/usr/local/opt/tcl-tk/include"
      install:
        - ./configure ${CFGOPT} "--prefix=$HOME" || (cat config.log && exit 1)
      script: *mactest
    - name: "macOS/Xcode 12/Debug"
      os: osx
      osx_image: xcode12
      env:
        - BUILD_DIR=unix
        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua --enable-symbols CFLAGS=-I/usr/local/opt/tcl-tk/include"
      install:
        - ./configure ${CFGOPT} "--prefix=$HOME" || (cat config.log && exit 1)
      script: *mactest
    - name: "macOS/Xcode 12/Shared/XQuartz"
      os: osx
      osx_image: xcode12
      env:
        - BUILD_DIR=unix
        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --disable-corefoundation --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib CFLAGS=-I/usr/local/opt/tcl-tk/include"
      install:
        - ./configure ${CFGOPT} "--prefix=$HOME" || (cat config.log && exit 1)
      script: *mactest
# Older MacOS versions
    - name: "macOS/Xcode 11/Shared"
      os: osx
      osx_image: xcode11.7
      env:
        - BUILD_DIR=unix
        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-mmacosx-version-min=10.14"
      install:
        - ./configure ${CFGOPT} "--prefix=$HOME" || (cat config.log && exit 1)
      script: *mactest
    - name: "macOS/Xcode 10/Shared"
      os: osx
      osx_image: xcode10.3
      addons:
        homebrew:
          packages:
            - tcl-tk
          update: true
      env:
        - BUILD_DIR=unix
        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-mmacosx-version-min=10.14"
      install:
        - ./configure ${CFGOPT} "--prefix=$HOME" || (cat config.log && exit 1)
      script: *mactest
    - name: "macOS/Xcode 9/Shared"
      os: osx
      osx_image: xcode9.4
      addons:
        homebrew:
          packages:
            - tcl-tk
          update: true
      env:
        - BUILD_DIR=unix
        - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-mmacosx-version-min=10.13"
      install:
        - ./configure ${CFGOPT} "--prefix=$HOME" || (cat config.log && exit 1)
      script: *mactest
# Test on Windows with MSVC native
#   - name: "Windows/MSVC/Shared"
#     os: windows
#     compiler: cl
#     env: &vcenv
#       - BUILD_DIR=win
#       - VCDIR="/C/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build"
Changes to doc/CanvTxtInfo.3.
48
49
50
51
52
53
54
55

56
57
58
59
60
61
62
48
49
50
51
52
53
54

55
56
57
58
59
60
61
62







-
+







    int \fIcursorOn\fR;
} \fBTk_CanvasTextInfo\fR;
.CE
The \fBselBorder\fR field identifies a Tk_3DBorder that should be
used for drawing the background under selected text.
\fIselBorderWidth\fR gives the width of the raised border around
selected text, in pixels.
\fIselFgColorPtr\fR points to an XColor that describes the foreground
\fIselFgColorPtr\fR points to an XColor that describes the
color to be used when drawing selected text.
\fIselItemPtr\fR points to the item that is currently selected, or
NULL if there is no item selected or if the canvas does not have the
selection.
\fIselectFirst\fR and \fIselectLast\fR give the indices of the first
and last selected characters in \fIselItemPtr\fR, as returned by the
\fIindexProc\fR for that item.
Changes to doc/ConfigWidg.3.
115
116
117
118
119
120
121
122

123
124
125
126
127
128
129
115
116
117
118
119
120
121

122
123
124
125
126
127
128
129







-
+







The \fItype\fR field indicates what type of configuration option this is
(e.g. \fBTK_CONFIG_COLOR\fR for a color value, or \fBTK_CONFIG_INT\fR for
an integer value).  The \fItype\fR field indicates how to use the
value of the option (more on this below).
The \fIargvName\fR field is a string such as
.QW \-font
or
.QW \-bg ,
.QW \-background ,
which is compared with the values in \fIargv\fR (if \fIargvName\fR is
NULL it means this is a grouped entry;  see \fBGROUPED ENTRIES\fR below).  The
\fIdbName\fR and \fIdbClass\fR fields are used to look up a value
for this option in the option database.  The \fIdefValue\fR field
specifies a default value for this configuration option if no
value is specified in either \fIargv\fR or the option database.
\fIOffset\fR indicates where in \fIwidgRec\fR to store information
Changes to doc/GetColor.3.
151
152
153
154
155
156
157
158

159
160
161
162
163
164
165
151
152
153
154
155
156
157

158
159
160
161
162
163
164
165







-
+







color.  If \fIcolorPtr\fR was created by a call to \fBTk_GetColorByValue\fR,
or by any other mechanism, then the return value is a string
that could be passed to \fBTk_GetColor\fR to return the same
color.  Note:  the string returned by \fBTk_NameOfColor\fR is
only guaranteed to persist until the next call to
\fBTk_NameOfColor\fR.
.PP
\fBTk_GCForColor\fR returns a graphics context whose \fBforeground\fR
\fBTk_GCForColor\fR returns a graphics context whose \fBcolor\fR
field is the pixel allocated for \fIcolorPtr\fR and whose other fields
all have default values.
This provides an easy way to do basic drawing with a color.
The graphics context is cached with the color and will exist only as
long as \fIcolorPtr\fR exists;  it is freed when the last reference
to \fIcolorPtr\fR is freed by calling \fBTk_FreeColor\fR.
.PP
Changes to doc/GetCursor.3.
20
21
22
23
24
25
26
27

28
29
30
31
32
33
34
20
21
22
23
24
25
26

27
28
29
30
31
32
33
34







-
+







Tk_Cursor
\fBTk_GetCursor(\fIinterp, tkwin, name\fB)\fR
.sp
Tk_Cursor
\fBTk_GetCursorFromObj(\fItkwin, objPtr\fB)\fR
.sp
Tk_Cursor
\fBTk_GetCursorFromData(\fIinterp, tkwin, source, mask, width, height, xHot, yHot, fg, bg\fB)\fR
\fBTk_GetCursorFromData(\fIinterp, tkwin, source, mask, width, height, xHot, yHot, color, background\fB)\fR
.sp
const char *
\fBTk_NameOfCursor(\fIdisplay, cursor\fB)\fR
.sp
\fBTk_FreeCursorFromObj(\fItkwin, objPtr\fB)\fR
.sp
\fBTk_FreeCursor(\fIdisplay, cursor\fB)\fR
52
53
54
55
56
57
58
59
60
61



62
63
64
65
66
67
68
52
53
54
55
56
57
58



59
60
61
62
63
64
65
66
67
68







-
-
-
+
+
+







Width of \fIsource\fR and \fImask\fR.
.AP "int" height in
Height of \fIsource\fR and \fImask\fR.
.AP "int" xHot in
X-location of cursor hot-spot.
.AP "int" yHot in
Y-location of cursor hot-spot.
.AP Tk_Uid fg in
Textual description of foreground color for cursor.
.AP Tk_Uid bg in
.AP Tk_Uid color in
Textual description of color for cursor.
.AP Tk_Uid background in
Textual description of background color for cursor.
.AP Display *display in
Display for which \fIcursor\fR was allocated.
.AP Tk_Cursor cursor in
Opaque Tk identifier for cursor.  If passed to \fBTk_FreeCursor\fR, must
have been returned by some previous call to \fBTk_GetCursor\fR or
\fBTk_GetCursorFromData\fR.
82
83
84
85
86
87
88
89

90
91
92
93
94
95
96

97
98
99

100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117

118
119
120
121

122
123
124
125
126

127
128
129
130
131
132
133
82
83
84
85
86
87
88

89
90
91
92
93
94
95

96
97
98

99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116

117
118
119
120

121
122
123
124
125

126
127
128
129
130
131
132
133







-
+






-
+


-
+

















-
+



-
+




-
+







future calls to procedures such as \fBTk_AllocCursorFromObj\fR and
\fBTk_GetCursorFromObj\fR. If an error occurs in creating the cursor,
such as when \fIobjPtr\fR refers to a non-existent file, then \fBNone\fR
is returned and an error message will be stored in \fIinterp\fR's result
if \fIinterp\fR is not NULL.  \fIObjPtr\fR must contain a standard Tcl
list with one of the following forms:
.TP
\fIname\fR\0[\fIfgColor\fR\0[\fIbgColor\fR]]
\fIname\fR\0[\fIcolor\fR\0[\fIbackground\fR]]
\fIName\fR is the name of a cursor in the standard X cursor cursor,
i.e., any of the names defined in \fBcursorcursor.h\fR, without
the \fBXC_\fR.  Some example values are \fBX_cursor\fR, \fBhand2\fR,
or \fBleft_ptr\fR.  Appendix B of
.QW "The X Window System"
by Scheifler & Gettys has illustrations showing what each of these
cursors looks like.  If \fIfgColor\fR and \fIbgColor\fR are both
cursors looks like.  If \fIcolor\fR and \fIbackground\fR are both
specified, they give the foreground and background colors to use
for the cursor (any of the forms acceptable to \fBTk_GetColor\fR
may be used).  If only \fIfgColor\fR is specified, then there
may be used).  If only \fIcolor\fR is specified, then there
will be no background color:  the background will be transparent.
If no colors are specified, then the cursor
will use black for its foreground color and white for its background
color.
.RS
.PP
The Macintosh version of Tk supports all of the X cursors and
will also accept any of the standard Mac cursors
including \fBibeam\fR, \fBcrosshair\fR, \fBwatch\fR, \fBplus\fR, and
\fBarrow\fR.  In addition, Tk will load Macintosh cursor resources of
the types \fBcrsr\fR (color) and \fBCURS\fR (black and white) by the
name of the resource.  The application and all its open
dynamic library's resource files will be searched for the named
cursor.  If there are conflicts color cursors will always be loaded
in preference to black and white cursors.
.RE
.TP
\fB@\fIsourceName\0maskName\0fgColor\0bgColor\fR
\fB@\fIsourceName\0maskName\0color\0background\fR
In this form, \fIsourceName\fR and \fImaskName\fR are the names of
files describing cursors for the cursor's source bits and mask.
Each file must be in standard X11 cursor format.
\fIFgColor\fR and \fIbgColor\fR
\fIColor\fR and \fIbackground\fR
indicate the colors to use for the
cursor, in any of the forms acceptable to \fBTk_GetColor\fR.  This
form of the command will not work on Macintosh or Windows computers.
.TP
\fB@\fIsourceName\0fgColor\fR
\fB@\fIsourceName\0color\fR
This form is similar to the one above, except that the source is
used as mask also.  This means that the cursor's background is
transparent.  This form of the command will not work on Macintosh
or Windows computers.
.TP
\fB@\fIsourceName\fR
This form only works on Windows, and will load a Windows system
153
154
155
156
157
158
159
160

161
162
163
164
165
166
167
153
154
155
156
157
158
159

160
161
162
163
164
165
166
167







-
+







in-memory descriptions of their source and mask cursors.  \fISource\fR
points to standard cursor data for the cursor's source bits, and
\fImask\fR points to standard cursor data describing
which pixels of \fIsource\fR are to be drawn and which are to be
considered transparent.  \fIWidth\fR and \fIheight\fR give the
dimensions of the cursor, \fIxHot\fR and \fIyHot\fR indicate the
location of the cursor's hot-spot (the point that is reported when
an event occurs), and \fIfg\fR and \fIbg\fR describe the cursor's
an event occurs), and \fIcolor\fR and \fIbackground\fR describe the cursor's
foreground and background colors textually (any of the forms
suitable for \fBTk_GetColor\fR may be used).  Typically, the
arguments to \fBTk_GetCursorFromData\fR are created by including
a cursor file directly into the source code for a program, as in
the following example:
.CS
Tk_Cursor cursor;
Changes to doc/ParseArgv.3.
76
77
78
79
80
81
82
83

84
85
86
87
88
89
90
76
77
78
79
80
81
82

83
84
85
86
87
88
89
90







-
+







    void *\fIdst\fR;
    const char *\fIhelp\fR;
} \fBTk_ArgvInfo\fR;
.CE
The \fIkey\fR field is a string such as
.QW \-display
or
.QW \-bg
.QW \-background
that is compared with the values in \fIargv\fR.  \fIType\fR
indicates how to process an argument that matches \fIkey\fR
(more on this below).  \fISrc\fR and \fIdst\fR are additional
values used in processing the argument.  Their exact usage
depends on \fItype\fR, but typically \fIsrc\fR indicates
a value and \fIdst\fR indicates where to store the
value.  The \fBchar *\fR declarations for \fIsrc\fR and \fIdst\fR
Changes to doc/SetOptions.3.
256
257
258
259
260
261
262
263

264
265
266
267
268
269
270
256
257
258
259
260
261
262

263
264
265
266
267
268
269
270







-
+







    int \fItypeMask\fR;
} \fBTk_OptionSpec\fR;
.CE
The \fItype\fR field indicates what kind of configuration option this is
(e.g. \fBTK_OPTION_COLOR\fR for a color value, or \fBTK_OPTION_INT\fR for
an integer value).  \fIType\fR determines how the
value of the option is parsed (more on this below).
The \fIoptionName\fR field is a string such as \fB\-font\fR or \fB\-bg\fR;
The \fIoptionName\fR field is a string such as \fB\-font\fR or \fB\-background\fR;
it is the name used for the option in Tcl commands and passed to
procedures via the \fIobjc\fR or \fInamePtr\fR arguments.
The \fIdbName\fR and \fIdbClass\fR fields are used by \fBTk_InitOptions\fR
to look up a default value for this option in the option database; if
\fIdbName\fR is NULL then the option database is not used by
\fBTk_InitOptions\fR for this option.  The \fIdefValue\fR field
specifies a default value for this configuration option if no
Changes to doc/bitmap.n.
20
21
22
23
24
25
26
27

28
29
30
31
32
33
34

35
36
37
38
39
40
41
20
21
22
23
24
25
26

27
28
29
30
31
32
33

34
35
36
37
38
39
40
41







-
+






-
+







.fi
.BE
.SH DESCRIPTION
.PP
A bitmap is an image whose pixels can display either of two colors
or be transparent.
A bitmap image is defined by four things:  a background color,
a foreground color, and two bitmaps, called the \fIsource\fR
a color, and two bitmaps, called the \fIsource\fR
and the \fImask\fR.
Each of the bitmaps specifies 0/1 values for a rectangular
array of pixels, and the two bitmaps must have the same
dimensions.
For pixels where the mask is zero, the image displays nothing,
producing a transparent effect.
For other pixels, the image displays the foreground color if
For other pixels, the image displays the color if
the source data is one and the background color if the source
data is zero.
.SH "CREATING BITMAPS"
.PP
Like all images, bitmaps are created using the \fBimage create\fR
command.
Bitmaps support the following \fIoptions\fR:
59
60
61
62
63
64
65
66

67
68

69
70
71
72
73
74
75
59
60
61
62
63
64
65

66
67

68
69
70
71
72
73
74
75







-
+

-
+







\fB\-file \fIname\fR
.
\fIname\fR gives the name of a file whose contents define the
source bitmap.
The file must adhere to X11 bitmap format (e.g., as generated
by the \fBbitmap\fR program).
.TP
\fB\-foreground \fIcolor\fR
\fB\-color \fIcolor\fR
.
Specifies a foreground color for the image in any of the standard
Specifies a color for the image in any of the standard
ways accepted by Tk.
.TP
\fB\-maskdata \fIstring\fR
.
Specifies the contents of the mask as a string.
The string must adhere to X11 bitmap format (e.g., as generated
by the \fBbitmap\fR program).
Changes to doc/button.n.
10
11
12
13
14
15
16
17
18


19
20
21
22
23
24
25



26
27
28
29
30
31
32
10
11
12
13
14
15
16


17
18
19
20
21
22



23
24
25
26
27
28
29
30
31
32







-
-
+
+




-
-
-
+
+
+







.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
button \- Create and manipulate 'button' action widgets
.SH SYNOPSIS
\fBbutton\fR \fIpathName \fR?\fIoptions\fR?
.SO
\-activebackground	\-font	\-relief
\-activeforeground	\-foreground	\-repeatdelay
\-activebackground	\-disabledcolor	\-relief
\-activecolor	\-font	\-repeatdelay
\-anchor	\-highlightbackground	\-repeatinterval
\-background	\-highlightcolor	\-takefocus
\-bitmap	\-highlightthickness	\-text
\-borderwidth	\-image	\-textvariable
\-compound	\-justify	\-underline
\-cursor	\-padx	\-wraplength
\-disabledforeground	\-pady
\-color	\-justify	\-underline
\-compound	\-padx	\-wraplength
-cursor	\-pady
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-command command Command
Specifies a Tcl command to associate with the button.  This command
is typically invoked when mouse button 1 is released over the button
window.
.OP \-default default Default
53
54
55
56
57
58
59
60

61
62

63
64
65
66

67
68
69
70
71
72
73
53
54
55
56
57
58
59

60
61

62
63
64
65

66
67
68
69
70
71
72
73







-
+

-
+



-
+







toolbar buttons, by configuring \fB\-relief flat \-overrelief
raised\fR.  If the value of this option is the empty string, then no
alternative relief is used when the mouse cursor is over the button.
The empty string is the default value.
.OP \-state state State
Specifies one of three states for the button:  \fBnormal\fR, \fBactive\fR,
or \fBdisabled\fR.  In normal state the button is displayed using the
\fB\-foreground\fR and \fB\-background\fR options.  The active state is
\fB\-color\fR and \fB\-background\fR options.  The active state is
typically used when the pointer is over the button.  In active state
the button is displayed using the \fB\-activeforeground\fR and
the button is displayed using the \fB\-activecolor\fR and
\fB\-activebackground\fR options.  Disabled state means that the button
should be insensitive:  the default bindings will refuse to activate
the widget and will ignore mouse button presses.
In this state the \fB\-disabledforeground\fR and
In this state the \fB\-disabledcolor\fR and
\fB\-background\fR options determine how the button is displayed.
.OP \-width width Width
Specifies a desired width for the button.
If an image or bitmap is being displayed in the button then the value is in
screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR).
For a text button (no image or with \fB\-compound none\fR) then the width
specifies how much space in characters to allocate for the text label.
Changes to doc/canvas.n.
15
16
17
18
19
20
21
22

23
24
25
26
27
28
29
15
16
17
18
19
20
21

22
23
24
25
26
27
28
29







-
+







.SH SYNOPSIS
\fBcanvas\fR \fIpathName \fR?\fIoptions\fR?
.SO
\-background	\-borderwidth	\-cursor
\-highlightbackground	\-highlightcolor	\-highlightthickness
\-insertbackground	\-insertborderwidth	\-insertofftime
\-insertontime	\-insertwidth	\-relief
\-selectbackground	\-selectborderwidth	\-selectforeground
\-selectbackground	\-selectborderwidth	\-selectcolor
\-takefocus	\-xscrollcommand	\-yscrollcommand
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-closeenough closeEnough CloseEnough
Specifies a floating-point value indicating how close the mouse cursor
must be to an item before it is considered to be
.QW inside
1255
1256
1257
1258
1259
1260
1261
1262

1263
1264
1265
1266
1267
1268
1269
1255
1256
1257
1258
1259
1260
1261

1262
1263
1264
1265
1266
1267
1268
1269







-
+







.TP
\fB\-disabledfill \fIcolor\fR
.
Specifies the color to be used to fill item's area.
in its normal, active, and disabled states,
\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
For the line item, it specifies the color of the line drawn.
For the text item, it specifies the foreground color of the text.
For the text item, it specifies the color of the text.
If \fIcolor\fR is an empty string (the default for all canvas items
except line and text), then the item will not be filled.
.TP
\fB\-outline \fIcolor\fR
.TP
\fB\-activeoutline \fIcolor\fR
.TP
1499
1500
1501
1502
1503
1504
1505
1506

1507
1508

1509
1510

1511
1512
1513
1514
1515
1516
1517
1499
1500
1501
1502
1503
1504
1505

1506
1507

1508
1509

1510
1511
1512
1513
1514
1515
1516
1517







-
+

-
+

-
+







\fB\-activebitmap \fIbitmap\fR
.TP
\fB\-disabledbitmap \fIbitmap\fR
Specifies the bitmaps to display in the item in its normal, active and
disabled states.
\fIBitmap\fR may have any of the forms accepted by \fBTk_GetBitmap\fR.
.TP
\fB\-foreground \fIcolor\fR
\fB\-colord \fIcolor\fR
.TP
\fB\-activeforeground \fIcolor\fR
\fB\-activecolor \fIcolor\fR
.TP
\fB\-disabledforeground \fIcolor\fR
\fB\-disabledcolor \fIcolor\fR
Specifies the color to use for each of the bitmap's
.QW 1
valued pixels in its normal, active and disabled states.
\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
.SS "IMAGE ITEMS"
.PP
Items of type \fBimage\fR are used to display images on a
Changes to doc/checkbutton.n.
10
11
12
13
14
15
16
17
18
19



20
21
22
23
24


25
26
27
28
29
30
31
10
11
12
13
14
15
16



17
18
19
20
21
22


23
24
25
26
27
28
29
30
31







-
-
-
+
+
+



-
-
+
+







.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
checkbutton \- Create and manipulate 'checkbutton' boolean selection widgets
.SH SYNOPSIS
\fBcheckbutton\fI pathName \fR?\fIoptions\fR?
.SO
\-activebackground	\-disabledforeground	\-padx
\-activeforeground	\-font	\-pady
\-anchor	\-foreground	\-relief
\-activebackground	\-cursor	\-padx
\-activecolor	\-disabledcolor	\-pady
\-anchor	\-font	\-relief
\-background	\-highlightbackground	\-takefocus
\-bitmap	\-highlightcolor	\-text
\-borderwidth	\-highlightthickness	\-textvariable
\-compound	\-image	\-underline
\-cursor	\-justify	\-wraplength
\-color	\-image	\-underline
\-compound	\-justify	\-wraplength
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-command command Command
Specifies a Tcl command to associate with the button.  This command
is typically invoked when mouse button 1 is released over the button
window.  The button's global variable (\fB\-variable\fR option) will
be updated before the command is invoked.
82
83
84
85
86
87
88
89

90
91

92
93
94
95

96
97
98
99
100
101
102
82
83
84
85
86
87
88

89
90

91
92
93
94

95
96
97
98
99
100
101
102







-
+

-
+



-
+







Specifies an image to display (in place of the \fB\-image\fR option)
when the checkbutton is selected.
This option is ignored unless the \fB\-image\fR option has been
specified.
.OP \-state state State
Specifies one of three states for the checkbutton:  \fBnormal\fR, \fBactive\fR,
or \fBdisabled\fR.  In normal state the checkbutton is displayed using the
\fB\-foreground\fR and \fB\-background\fR options.  The active state is
\fB\-color\fR and \fB\-background\fR options.  The active state is
typically used when the pointer is over the checkbutton.  In active state
the checkbutton is displayed using the \fB\-activeforeground\fR and
the checkbutton is displayed using the \fB\-activecolor\fR and
\fB\-activebackground\fR options.  Disabled state means that the checkbutton
should be insensitive:  the default bindings will refuse to activate
the widget and will ignore mouse button presses.
In this state the \fB\-disabledforeground\fR and
In this state the \fB\-disabledcolor\fR and
\fB\-background\fR options determine how the checkbutton is displayed.
.OP \-tristateimage tristateImage TristateImage
Specifies an image to display (in place of the \fB\-image\fR option)
when the checkbutton is in tri-state mode.
This option is ignored unless the \fB\-image\fR option has been
specified.
.OP \-tristatevalue tristateValue Value
Changes to doc/chooseColor.n.
35
36
37
38
39
40
41
42

43
44
45
46
47
48
35
36
37
38
39
40
41

42
43
44
45
46
47
48







-
+






If the user selects a color, \fBtk_chooseColor\fR will return the
name of the color in a form acceptable to \fBTk_GetColor\fR.  If the
user cancels the operation, both commands will return the empty
string.
.SH EXAMPLE
.PP
.CS
button .b \-bg [tk_chooseColor \-initialcolor gray \-title "Choose color"]
button .b \-background [tk_chooseColor \-initialcolor gray \-title "Choose color"]
.CE
.SH KEYWORDS
color, color selection, dialog
'\" Local Variables:
'\" mode: nroff
'\" End:
Changes to doc/entry.n.
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
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







-
-
-
-
+
+
+
+


-
+





-
-
-
+
+
+







.SH NAME
entry \- Create and manipulate 'entry' one-line text entry widgets
.SH SYNOPSIS
\fBentry\fR \fIpathName \fR?\fIoptions\fR?
.SO
\-background	\-highlightthickness	\-selectbackground
\-borderwidth	\-insertbackground	\-selectborderwidth
\-cursor	\-insertborderwidth	\-selectforeground
\-exportselection	\-insertofftime	\-takefocus
\-font	\-insertontime	\-textvariable
\-foreground	\-insertwidth	\-xscrollcommand
\-color	\-insertborderwidth	\-selectcolor
\-cursor	\-insertofftime	\-takefocus
\-exportselection	\-insertontime	\-textvariable
\-font	\-insertwidth	\-xscrollcommand
\-highlightbackground	\-justify
\-highlightcolor	\-relief
\-placeholder	\-placeholderforeground
\-placeholder	\-placeholdercolor
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-disabledbackground disabledBackground DisabledBackground
Specifies the background color to use when the entry is disabled.  If
this option is the empty string, the normal background color is used.
.OP \-disabledforeground disabledForeground DisabledForeground
Specifies the foreground color to use when the entry is disabled.  If
this option is the empty string, the normal foreground color is used.
.OP \-disabledcolor disabledForeground DisabledForeground
Specifies the color to use when the entry is disabled.  If
this option is the empty string, the normal color is used.
.OP "\-invalidcommand or \-invcmd" invalidCommand InvalidCommand
Specifies a script to eval when \fB\-validatecommand\fR returns 0.
Setting it to {} disables this feature (the default).  The best use
of this option is to set it to \fIbell\fR.  See \fBVALIDATION\fR
below for more information.
.OP \-readonlybackground readonlyBackground ReadonlyBackground
Specifies the background color to use when the entry is readonly.  If
56
57
58
59
60
61
62
63

64
65
66
67
68
69
70
56
57
58
59
60
61
62

63
64
65
66
67
68
69
70







-
+







\fBdisabled\fR, or \fBreadonly\fR.  If the entry is readonly, then the
value may not be changed using widget commands and no insertion cursor
will be displayed, even if the input focus is in the widget; the
contents of the widget may still be selected.  If the entry is
disabled, the value may not be changed, no insertion cursor will be
displayed, the contents will not be selectable, and the entry may
be displayed in a different color, depending on the values of the
\fB\-disabledforeground\fR and \fB\-disabledbackground\fR options.
\fB\-disabledcolor\fR and \fB\-disabledbackground\fR options.
.OP \-validate validate Validate
Specifies the mode in which validation should operate: \fBnone\fR,
\fBfocus\fR, \fBfocusin\fR, \fBfocusout\fR, \fBkey\fR, or \fBall\fR.
It defaults to \fBnone\fR.  When you want validation, you must explicitly
state which mode you wish to use.  See \fBVALIDATION\fR below for more.
.OP "\-validatecommand or \-vcmd" validateCommand ValidateCommand
Specifies a script to eval when you want to validate the input into
Changes to doc/label.n.
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
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







-
-
-
+
+
+

















-
-
+
+

-
+







.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
label \- Create and manipulate 'label' non-interactive text or image widgets
.SH SYNOPSIS
\fBlabel\fR \fIpathName \fR?\fIoptions\fR?
.SO
\-activebackground	\-disabledforeground	\-padx
\-activeforeground	\-font	\-pady
\-anchor	\-foreground	\-relief
\-activebackground	\-disabledcolor	\-padx
\-activecolor	\-font	\-pady
\-anchor	\-color	\-relief
\-background	\-highlightbackground	\-takefocus
\-bitmap	\-highlightcolor	\-text
\-borderwidth	\-highlightthickness	\-textvariable
\-compound	\-image	\-underline
\-cursor	\-justify	\-wraplength
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-height height Height
Specifies a desired height for the label.
If an image or bitmap is being displayed in the label then the value is in
screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
for text it is in lines of text.
If this option is not specified, the label's desired height is computed
from the size of the image or bitmap or text being displayed in it.
.OP \-state state State
Specifies one of three states for the label:  \fBnormal\fR, \fBactive\fR,
or \fBdisabled\fR.  In normal state the button is displayed using the
\fB\-foreground\fR and \fB\-background\fR options.  In active state
the label is displayed using the \fB\-activeforeground\fR and
\fB\-color\fR and \fB\-background\fR options.  In active state
the label is displayed using the \fB\-activecolor\fR and
\fB\-activebackground\fR options.  In the disabled state the
\fB\-disabledforeground\fR and \fB\-background\fR options determine how
\fB\-disabledcolor\fR and \fB\-background\fR options determine how
the button is displayed.
.OP \-width width Width
Specifies a desired width for the label.
If an image or bitmap is being displayed in the label then the value is in
screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
for text it is in characters.
If this option is not specified, the label's desired width is computed
104
105
106
107
108
109
110
111
112


113
114
115
116
117
118
119
104
105
106
107
108
109
110


111
112
113
114
115
116
117
118
119







-
-
+
+







.PP
When a new label is created, it has no default event bindings:
labels are not intended to be interactive.
.SH EXAMPLE
.PP
.CS
# Make the widgets
\fBlabel\fR .t \-text "This widget is at the top"    \-bg red
\fBlabel\fR .b \-text "This widget is at the bottom" \-bg green
\fBlabel\fR .t \-text "This widget is at the top"    \-background red
\fBlabel\fR .b \-text "This widget is at the bottom" \-background green
\fBlabel\fR .l \-text "Left\enHand\enSide"
\fBlabel\fR .r \-text "Right\enHand\enSide"
text .mid
\&.mid insert end "This layout is like Java's BorderLayout"
# Lay them out
pack .t   \-side top    \-fill x
pack .b   \-side bottom \-fill x
Changes to doc/labelframe.n.
13
14
15
16
17
18
19
20

21
22
23
24
25
26
27
13
14
15
16
17
18
19

20
21
22
23
24
25
26
27







-
+







labelframe \- Create and manipulate 'labelframe' labelled container widgets
.SH SYNOPSIS
\fBlabelframe\fR \fIpathName\fR ?\fIoptions\fR?
.SO
\-borderwidth	\-highlightbackground	\-pady
\-cursor	\-highlightcolor	\-relief
\-font	\-highlightthickness	\-takefocus
\-foreground	\-padx	\-text
\-color	\-padx	\-text
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-background background Background
This option is the same as the standard \fB\-background\fR option
except that its value may also be specified as an empty string.
In this case, the widget will display no background or border, and
no colors will be consumed from its colormap for its background
Changes to doc/listbox.n.
11
12
13
14
15
16
17
18
19


20
21

22
23
24
25
26
27
28
11
12
13
14
15
16
17


18
19
20

21
22
23
24
25
26
27
28







-
-
+
+

-
+







'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
listbox \- Create and manipulate 'listbox' item list widgets
.SH SYNOPSIS
\fBlistbox\fR \fIpathName \fR?\fIoptions\fR?
.SO
\-background	\-borderwidth	\-cursor
\-disabledforeground	\-exportselection	\-font
\-foreground	\-highlightbackground	\-highlightcolor
\-disabledcolor	\-exportselection	\-font
\-color	\-highlightbackground	\-highlightcolor
\-highlightthickness	\-justify	\-relief
\-selectbackground	\-selectborderwidth	\-selectforeground
\-selectbackground	\-selectborderwidth	\-selectcolor
\-setgrid	\-takefocus	\-xscrollcommand
\-yscrollcommand
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-activestyle activeStyle ActiveStyle
Specifies the style in which to draw the active element.  This must be
one of \fBdotbox\fR (show a focus ring around the active element),
44
45
46
47
48
49
50
51

52
53
54
55
56
57
58
44
45
46
47
48
49
50

51
52
53
54
55
56
57
58







-
+







Specifies one of several styles for manipulating the selection.
The value of the option may be arbitrary, but the default bindings
expect it to be either \fBsingle\fR, \fBbrowse\fR, \fBmultiple\fR,
or \fBextended\fR;  the default value is \fBbrowse\fR.
.OP \-state state State
Specifies one of two states for the listbox:  \fBnormal\fR or \fBdisabled\fR.
If the listbox is disabled then items may not be inserted or deleted,
items are drawn in the \fB\-disabledforeground\fR color, and selection
items are drawn in the \fB\-disabledcolor\fR color, and selection
cannot be modified and is not shown (though selection information is retained).
.OP \-width width Width
Specifies the desired width for the window in characters.
If the font does not have a uniform width then the width of the character
.QW 0
is used in translating from character units to screen units.
If zero or less, then the desired width for the window is made just
248
249
250
251
252
253
254
255

256
257

258
259
260
261
262
263
264
265
266

267
268

269
270
271
272
273
274
275
248
249
250
251
252
253
254

255
256

257
258
259
260
261
262
263
264
265

266
267

268
269
270
271
272
273
274
275







-
+

-
+








-
+

-
+







.RS
.TP
\fB\-background \fIcolor\fR
.
\fIColor\fR specifies the background color to use when displaying the
item. It may have any of the forms accepted by \fBTk_GetColor\fR.
.TP
\fB\-foreground \fIcolor\fR
\fB\-color \fIcolor\fR
.
\fIColor\fR specifies the foreground color to use when displaying the
\fIColor\fR specifies the color to use when displaying the
item. It may have any of the forms accepted by \fBTk_GetColor\fR.
.TP
\fB\-selectbackground \fIcolor\fR
.
\fIcolor\fR specifies the background color to use when displaying the
item while it is selected. It may have any of the forms accepted by
\fBTk_GetColor\fR.
.TP
\fB\-selectforeground \fIcolor\fR
\fB\-selectcolor \fIcolor\fR
.
\fIcolor\fR specifies the foreground color to use when displaying the
\fIcolor\fR specifies the color to use when displaying the
item while it is selected. It may have any of the forms accepted by
\fBTk_GetColor\fR.
.RE
.TP
\fIpathName \fBnearest \fIy\fR
.
Given a y-coordinate within the listbox window, this command returns
Changes to doc/menu.n.
12
13
14
15
16
17
18
19

20
21

22
23
24
25
26
27
28
12
13
14
15
16
17
18

19
20

21
22
23
24
25
26
27
28







-
+

-
+







.SH NAME
menu, tk_menuSetFocus \- Create and manipulate 'menu' widgets and menubars
.SH SYNOPSIS
.nf
\fBmenu\fR \fIpathName \fR?\fIoptions\fR?
\fBtk_menuSetFocus\fR \fIpathName\fR
.SO
\-activebackground	\-borderwidth	\-foreground
\-activebackground	\-borderwidth	\-color
\-activeborderwidth	\-cursor	\-relief
\-activeforeground	\-disabledforeground	\-takefocus
\-activecolor	\-disabledcolor	\-takefocus
\-background	\-font	\-activerelief
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-postcommand postCommand Command
If this option is specified then it provides a Tcl command to execute
each time the menu is posted.  The command is invoked by the \fBpost\fR
widget command before posting the menu. Note that in Tk 8.0 on Macintosh
527
528
529
530
531
532
533
534

535
536

537
538
539

540
541
542
543
544
545
546
527
528
529
530
531
532
533

534
535

536
537
538

539
540
541
542
543
544
545
546







-
+

-
+


-
+







If this option is specified as an empty string (the default), then the
\fB\-activebackground\fR option for the overall menu is used.
If the \fBtk_strictMotif\fR variable has been set to request strict
Motif compliance, then this option is ignored and the \fB\-background\fR
option is used in its place.
This option is not available for separator or tear-off entries.
.TP
\fB\-activeforeground \fIvalue\fR
\fB\-activecolor \fIvalue\fR
.
Specifies a foreground color to use for displaying this entry when it
Specifies a color to use for displaying this entry when it
is active.
If this option is specified as an empty string (the default), then the
\fB\-activeforeground\fR option for the overall menu is used.
\fB\-activecolor\fR option for the overall menu is used.
This option is not available for separator or tear-off entries.
.TP
\fB\-accelerator \fIvalue\fR
.
Specifies a string to display at the right side of the menu entry.
Normally describes an accelerator keystroke sequence that may be
used to invoke the same function as the menu entry. This is a display
595
596
597
598
599
600
601
602

603
604

605
606
607

608
609
610
611
612
613
614
595
596
597
598
599
600
601

602
603

604
605
606

607
608
609
610
611
612
613
614







-
+

-
+


-
+







.
Specifies the font to use when drawing the label or accelerator
string in this entry.
If this option is specified as an empty string (the default) then
the \fB\-font\fR option for the overall menu is used.
This option is not available for separator or tear-off entries.
.TP
\fB\-foreground \fIvalue\fR
\fB\-color \fIvalue\fR
.
Specifies a foreground color to use for displaying this entry when it
Specifies a color to use for displaying this entry when it
is in the normal state (neither active nor disabled).
If this option is specified as an empty string (the default), then the
\fB\-foreground\fR option for the overall menu is used.
\fB\-color\fR option for the overall menu is used.
This option is not available for separator or tear-off entries.
.TP
\fB\-hidemargin \fIvalue\fR
.
Specifies whether the standard margins should be drawn for this menu
entry. This is useful when creating palette with images in them, i.e.,
color palettes, pattern palettes, etc. 1 indicates that the margin for
672
673
674
675
676
677
678
679

680
681
682

683
684
685
686
687
688

689
690
691
692
693
694
695
672
673
674
675
676
677
678

679
680
681

682
683
684
685
686
687

688
689
690
691
692
693
694
695







-
+


-
+





-
+







This option is ignored unless the \fB\-image\fR option has
been specified.
.TP
\fB\-state \fIvalue\fR
.
Specifies one of three states for the entry:  \fBnormal\fR, \fBactive\fR,
or \fBdisabled\fR.  In normal state the entry is displayed using the
\fB\-foreground\fR option for the menu and the \fB\-background\fR
\fB\-color\fR option for the menu and the \fB\-background\fR
option from the entry or the menu.
The active state is typically used when the pointer is over the entry.
In active state the entry is displayed using the \fB\-activeforeground\fR
In active state the entry is displayed using the \fB\-activecolor\fR
option for the menu along with the \fB\-activebackground\fR option from
the entry.  Disabled state means that the entry
should be insensitive:  the default bindings will refuse to activate
or invoke the entry.
In this state the entry is displayed according to the
\fB\-disabledforeground\fR option for the menu and the
\fB\-disabledcolor\fR option for the menu and the
\fB\-background\fR option from the entry.
This option is not available for separator entries.
.TP
\fB\-underline \fIvalue\fR
.
Specifies the integer index of a character to underline in the entry.
This option is also queried by the default bindings and used to
Changes to doc/menubutton.n.
10
11
12
13
14
15
16
17
18
19



20
21
22
23
24
25
26
10
11
12
13
14
15
16



17
18
19
20
21
22
23
24
25
26







-
-
-
+
+
+







.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
menubutton \- Create and manipulate 'menubutton' pop-up menu indicator widgets
.SH SYNOPSIS
\fBmenubutton\fR \fIpathName \fR?\fIoptions\fR?
.SO
\-activebackground	\-disabledforeground	\-padx
\-activeforeground	\-font	\-pady
\-anchor	\-foreground	\-relief
\-activebackground	\-disabledcolor	\-padx
\-activecolor	\-font	\-pady
\-anchor	\-color	\-relief
\-background	\-highlightbackground	\-takefocus
\-bitmap	\-highlightcolor	\-text
\-borderwidth	\-highlightthickness	\-textvariable
\-cursor	\-image	\-underline
\-compound	\-justify	\-wraplength
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
47
48
49
50
51
52
53
54

55
56

57
58
59
60

61
62
63
64
65
66
67
47
48
49
50
51
52
53

54
55

56
57
58
59

60
61
62
63
64
65
66
67







-
+

-
+



-
+







displayed.
.OP \-menu menu MenuName
Specifies the path name of the menu associated with this menubutton.
The menu must be a child of the menubutton.
.OP \-state state State
Specifies one of three states for the menubutton:  \fBnormal\fR, \fBactive\fR,
or \fBdisabled\fR.  In normal state the menubutton is displayed using the
\fBforeground\fR and \fBbackground\fR options.  The active state is
\fBcolor\fR and \fBbackground\fR options.  The active state is
typically used when the pointer is over the menubutton.  In active state
the menubutton is displayed using the \fB\-activeforeground\fR and
the menubutton is displayed using the \fB\-activecolor\fR and
\fB\-activebackground\fR options.  Disabled state means that the menubutton
should be insensitive:  the default bindings will refuse to activate
the widget and will ignore mouse button presses.
In this state the \fB\-disabledforeground\fR and
In this state the \fB\-disabledcolor\fR and
\fB\-background\fR options determine how the button is displayed.
.OP \-width width Width
Specifies a desired width for the menubutton.
If an image or bitmap is being displayed in the menubutton then the value is in
screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
for text it is in characters.
If this option is not specified, the menubutton's desired width is computed
Changes to doc/message.n.
11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
11
12
13
14
15
16
17

18
19
20
21
22
23
24
25







-
+







'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
message \- Create and manipulate 'message' non-interactive text widgets
.SH SYNOPSIS
\fBmessage\fR \fIpathName \fR?\fIoptions\fR?
.SO
\-anchor	\-background	\-borderwidth
\-cursor	\-font	\-foreground
\-cursor	\-font	\-color
\-highlightbackground	\-highlightcolor	\-highlightthickness
\-padx	\-pady	\-relief
\-takefocus	\-text	\-textvariable
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-aspect aspect Aspect
Specifies a non-negative integer value indicating desired
Changes to doc/option.n.
113
114
115
116
117
118
119
120

121
122
123

124
125
126
127
128
129
130
113
114
115
116
117
118
119

120
121
122

123
124
125
126
127
128
129
130







-
+


-
+







applies anywhere it can throughout the whole widget hierarchy. Otherwise the
first word of the pattern is matched against the name and class of the
.QW \fB.\fR
\fBtoplevel\fR, which are usually set by options to \fBwish\fR.
.SH EXAMPLES
.PP
Instruct every button in the application to have red text on it unless
explicitly overridden, by setting the \fBforeground\fR for the \fBButton\fR
explicitly overridden, by setting the \fBcolor\fR for the \fBButton\fR
class (note that on some platforms the option is ignored):
.CS
\fBoption add\fR *Button.foreground red startupFile
\fBoption add\fR *Button.color red startupFile
.CE
.PP
Allow users to control what happens in an entry widget when the Return
key is pressed by specifying a script in the option database and add a
default option for that which rings the bell:
.CS
entry .e
Changes to doc/options.n.
22
23
24
25
26
27
28
29

30
31
32

33
34
35
36
37
38
39
22
23
24
25
26
27
28

29
30
31

32
33
34
35
36
37
38
39







-
+


-
+







has exactly the effect described below.
.PP
In the descriptions below,
.QW "Command-Line Name"
refers to the
switch used in class commands and \fBconfigure\fR widget commands to
set this value.  For example, if an option's command-line switch is
\fB\-foreground\fR and there exists a widget \fB.a.b.c\fR, then the
\fB\-color\fR and there exists a widget \fB.a.b.c\fR, then the
command
.CS
\&\fB.a.b.c\0\0configure\0\0\-foreground black\fR
\&\fB.a.b.c\0\0configure\0\0\-color black\fR
.CE
may be used to specify the value \fBblack\fR for the option in
the widget \fB.a.b.c\fR.  Command-line switches may be abbreviated,
as long as the abbreviation is unambiguous.
.QW "Database Name"
refers to the option's name in the option database (e.g. in .Xdefaults files).
.QW "Database Class"
51
52
53
54
55
56
57
58
59


60
61
62
63
64
65
66
51
52
53
54
55
56
57


58
59
60
61
62
63
64
65
66







-
-
+
+







.OP \-activeborderwidth activeBorderWidth BorderWidth
Specifies a non-negative value indicating
the width of the 3-D border drawn around active elements.  See above for
definition of active elements.
The value may have any of the forms acceptable to \fBTk_GetPixels\fR.
This option is typically only available in widgets displaying more
than one element at a time (e.g. menus but not buttons).
.OP \-activeforeground activeForeground Background
Specifies foreground color to use when drawing active elements.
.OP \-activecolor activeColor ActiveColor
Specifies color to use when drawing active elements.
See above for definition of active elements.
.OP \-activerelief activeRelief Relief
Specifies the 3-D effect desired for the active item of the widget.
See the \fB-relief\fR option for details.
.OP \-anchor anchor Anchor
Specifies how the information in a widget (e.g. text or a bitmap)
is to be displayed in the widget.
101
102
103
104
105
106
107
108
109


110
111
112

113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129


130
131
132
133
134
135
136
101
102
103
104
105
106
107


108
109
110
111

112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127


128
129
130
131
132
133
134
135
136







-
-
+
+


-
+















-
-
+
+







to the text.  Must be one of the values \fBnone\fR, \fBbottom\fR,
\fBtop\fR, \fBleft\fR, \fBright\fR, or \fBcenter\fR.  For example, the
(default) value \fBnone\fR specifies that the bitmap or image should
(if defined) be displayed instead of the text, the value \fBleft\fR
specifies that the bitmap or image should be displayed to the left of
the text, and the value \fBcenter\fR specifies that the bitmap or
image should be displayed on top of the text.
.OP \-disabledforeground disabledForeground DisabledForeground
Specifies foreground color to use when drawing a disabled element.
.OP \-disabledcolor disabledColor DisabledColor
Specifies color to use when drawing a disabled element.
If the option is specified as an empty string (which is typically the
case on monochrome displays), disabled elements are drawn with the
normal foreground color but they are dimmed by drawing them
normal color but they are dimmed by drawing them
with a stippled fill pattern.
.OP \-exportselection exportSelection ExportSelection
Specifies whether or not a selection in the widget should also be
the X selection.
The value may have any of the forms accepted by \fBTcl_GetBoolean\fR,
such as \fBtrue\fR, \fBfalse\fR, \fB0\fR, \fB1\fR, \fByes\fR, or \fBno\fR.
If the selection is exported, then selecting in the widget deselects
the current X selection, selecting outside the widget deselects any
widget selection, and the widget will respond to selection retrieval
requests when it has a selection.  The default is usually for widgets
to export selections.
.OP \-font font Font
Specifies the font to use when drawing text inside the widget.
The value may have any of the forms described in the \fBfont\fR manual
page under \fBFONT DESCRIPTION\fR.
.OP "\-foreground or \-fg" foreground Foreground
Specifies the normal foreground color to use when displaying the widget.
.OP \-color color Color
Specifies the normal color to use when displaying the widget.
.OP \-highlightbackground highlightBackground HighlightBackground
Specifies the color to display in the traversal highlight region when
the widget does not have the input focus.
.OP \-highlightcolor highlightColor HighlightColor
Specifies the color to use for the traversal highlight rectangle that is
drawn around the widget when it has the input focus.
.OP \-highlightthickness highlightThickness HighlightThickness
224
225
226
227
228
229
230
231
232


233
234
235
236
237
238
239
224
225
226
227
228
229
230


231
232
233
234
235
236
237
238
239







-
-
+
+







Most widgets only use this option for padding text:  if they are
displaying a bitmap or image, then they usually ignore padding
options.
.OP \-placeholder placeHolder PlaceHolder
Specifies a help text string to display if no text is otherwise displayed,
that is when the widget is empty. The placeholder text is displayed using
the values of the \fB\-font\fR and \fB\-justify\fR options.
.OP \-placeholderforeground placeholderForeground PlaceholderForeground
Specifies the foreground color to use when the placeholder text is
.OP \-placeholdercolor placeholderColor PlaceholderColor
Specifies the color to use when the placeholder text is
displayed. The default color is platform-specific.
.OP \-relief relief Relief
Specifies the 3-D effect desired for the widget.  Acceptable
values are \fBraised\fR, \fBsunken\fR, \fBflat\fR, \fBridge\fR,
\fBsolid\fR, and \fBgroove\fR.
The value
indicates how the interior of the widget should appear relative
251
252
253
254
255
256
257
258
259


260
261
262
263
264
265
266
251
252
253
254
255
256
257


258
259
260
261
262
263
264
265
266







-
-
+
+







.OP \-selectbackground selectBackground Foreground
Specifies the background color to use when displaying selected
items.
.OP \-selectborderwidth selectBorderWidth BorderWidth
Specifies a non-negative value indicating the width
of the 3-D border to draw around selected items.
The value may have any of the forms acceptable to \fBTk_GetPixels\fR.
.OP \-selectforeground selectForeground Background
Specifies the foreground color to use when displaying selected
.OP \-selectcolor selectColor SelectColor
Specifies the color to use when displaying selected
items.
.OP \-setgrid setGrid SetGrid
Specifies a boolean value that determines whether this widget controls the
resizing grid for its top-level window.
This option is typically used in text widgets, where the information
in the widget has a natural size (the size of a character) and it makes
sense for the window's dimensions to be integral numbers of these units.
Changes to doc/pack.n.
269
270
271
272
273
274
275
276
277


278
279
280
281
282
283
284
269
270
271
272
273
274
275


276
277
278
279
280
281
282
283
284







-
-
+
+







will be highest in the stacking order.
Or, you can use the \fBraise\fR and \fBlower\fR commands to change
the stacking order of either the container or the content.
.SH EXAMPLE
.PP
.CS
# Make the widgets
label .t \-text "This widget is at the top"    \-bg red
label .b \-text "This widget is at the bottom" \-bg green
label .t \-text "This widget is at the top"    \-background red
label .b \-text "This widget is at the bottom" \-background green
label .l \-text "Left\enHand\enSide"
label .r \-text "Right\enHand\enSide"
text .mid
\&.mid insert end "This layout is like Java's BorderLayout"
# Lay them out
\fBpack\fR .t   \-side top    \-fill x
\fBpack\fR .b   \-side bottom \-fill x
Changes to doc/palette.n.
29
30
31
32
33
34
35
36
37
38
39




40
41
42
43
44
45
46
29
30
31
32
33
34
35




36
37
38
39
40
41
42
43
44
45
46







-
-
-
-
+
+
+
+







Alternatively, the arguments to \fBtk_setPalette\fR may consist of any number
of \fIname\fR\-\fIvalue\fR pairs, where the first argument of the pair
is the name of an option in the Tk option database and the second
argument is the new value to use for that option.  The following
database names are currently supported:
.DS
.ta 4c 8c
\fBactiveBackground\fR	\fBforeground\fR	\fBselectColor\fR
\fBactiveForeground\fR	\fBhighlightBackground\fR	\fBselectBackground\fR
\fBbackground\fR	\fBhighlightColor\fR	\fBselectForeground\fR
\fBdisabledForeground\fR	\fBinsertBackground\fR	\fBtroughColor\fR
\fBactiveBackground\fR	\fBcolor\fR	\fBselectColor\fR
\fBactiveColor\fR	\fBhighlightBackground\fR	\fBselectBackground\fR
\fBbackground\fR	\fBhighlightColor\fR	\fBselectColor\fR
\fBdisabledColor\fR	\fBinsertBackground\fR	\fBtroughColor\fR
.DE
\fBtk_setPalette\fR tries to compute reasonable defaults for any
options that you do not specify.  You can specify options other
than the above ones and Tk will change those options on widgets as
well.  This feature may be useful if you are using custom widgets with
additional color options.
.PP
Changes to doc/place.n.
243
244
245
246
247
248
249
250

251
252
253
254
255
256
257
243
244
245
246
247
248
249

250
251
252
253
254
255
256
257







-
+







To control the sizes of these windows, make them windows like
frames and canvases that provide configuration options for this purpose.
.SH EXAMPLE
.PP
Make the label occupy the middle bit of the toplevel, no matter how it
is resized:
.CS
label .l \-text "In the\enMiddle!" \-bg black \-fg white
label .l \-text "In the\enMiddle!" \-background black \-color white
\fBplace\fR .l \-relwidth .3 \-relx .35 \-relheight .3 \-rely .35
.CE
.SH "SEE ALSO"
grid(n), pack(n)
.SH KEYWORDS
geometry manager, height, location, container, place, rubber sheet, content, width
'\" Local Variables:
Changes to doc/radiobutton.n.
10
11
12
13
14
15
16
17
18
19



20
21
22
23
24
25
26
10
11
12
13
14
15
16



17
18
19
20
21
22
23
24
25
26







-
-
-
+
+
+







.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
radiobutton \- Create and manipulate 'radiobutton' pick-one widgets
.SH SYNOPSIS
\fBradiobutton\fR \fIpathName \fR?\fIoptions\fR?
.SO
\-activebackground	\-disabledforeground	\-padx
\-activeforeground	\-font	\-pady
\-anchor	\-foreground	\-relief
\-activebackground	\-disabledcolor	\-padx
\-activecolor	\-font	\-pady
\-anchor	\-color	\-relief
\-background	\-highlightbackground	\-takefocus
\-bitmap	\-highlightcolor	\-text
\-borderwidth	\-highlightthickness	\-textvariable
\-compound	\-image	\-underline
\-cursor	\-justify	\-wraplength
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
74
75
76
77
78
79
80
81

82
83

84
85
86
87

88
89
90
91
92
93
94
74
75
76
77
78
79
80

81
82

83
84
85
86

87
88
89
90
91
92
93
94







-
+

-
+



-
+







Specifies an image to display (in place of the \fB\-image\fR option)
when the radiobutton is selected.
This option is ignored unless the \fB\-image\fR option has been
specified.
.OP \-state state State
Specifies one of three states for the radiobutton:  \fBnormal\fR, \fBactive\fR,
or \fBdisabled\fR.  In normal state the radiobutton is displayed using the
\fB\-foreground\fR and \fB\-background\fR options.  The active state is
\fB\-color\fR and \fB\-background\fR options.  The active state is
typically used when the pointer is over the radiobutton.  In active state
the radiobutton is displayed using the \fB\-activeforeground\fR and
the radiobutton is displayed using the \fB\-activecolor\fR and
\fB\-activebackground\fR options.  Disabled state means that the radiobutton
should be insensitive:  the default bindings will refuse to activate
the widget and will ignore mouse button presses.
In this state the \fB\-disabledforeground\fR and
In this state the \fB\-disabledcolor\fR and
\fB\-background\fR options determine how the radiobutton is displayed.
.OP \-tristateimage tristateImage TristateImage
Specifies an image to display (in place of the \fB\-image\fR option)
when the radiobutton is selected.
This option is ignored unless the \fB\-image\fR option has been
specified.
.OP \-tristatevalue tristateValue Value
Changes to doc/scale.n.
10
11
12
13
14
15
16
17

18
19
20
21
22
23
24
10
11
12
13
14
15
16

17
18
19
20
21
22
23
24







-
+







.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
scale \- Create and manipulate 'scale' value-controlled slider widgets
.SH SYNOPSIS
\fBscale\fR \fIpathName \fR?\fIoptions\fR?
.SO
\-activebackground	\-foreground	\-relief
\-activebackground	\-color	\-relief
\-background	\-highlightbackground	\-repeatdelay
\-borderwidth	\-highlightcolor	\-repeatinterval
\-cursor	\-highlightthickness	\-takefocus
\-font	\-orient	\-troughcolor
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-bigincrement bigIncrement BigIncrement
Changes to doc/spinbox.n.
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
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







-
+


-
+


-
+



















-
-
-
+
+
+







spinbox \- Create and manipulate 'spinbox' value spinner widgets
.SH SYNOPSIS
\fBspinbox\fR \fIpathName \fR?\fIoptions\fR?
.SO
\-activebackground	\-highlightthickness	\-repeatinterval
\-background	\-insertbackground	\-selectbackground
\-borderwidth	\-insertborderwidth	\-selectborderwidth
\-cursor	\-insertontime	\-selectforeground
\-cursor	\-insertontime	\-selectcolor
\-exportselection	\-insertwidth	\-takefocus
\-font	\-insertofftime	\-textvariable
\-foreground	\-justify	\-xscrollcommand
\-color	\-justify	\-xscrollcommand
\-highlightbackground	\-relief
\-highlightcolor	\-repeatdelay
\-placeholder	\-placeholderforeground
\-placeholder	\-placeholdercolor
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-buttonbackground buttonBackground Background
The background color to be used for the spin buttons.
.OP \-buttoncursor buttonCursor Cursor
The cursor to be used when over the spin buttons.  If this is empty
(the default), a default cursor will be used.
.OP \-buttondownrelief buttonDownRelief Relief
The relief to be used for the upper spin button.
.OP \-buttonuprelief buttonUpRelief Relief
The relief to be used for the lower spin button.
.OP \-command command Command
Specifies a Tcl command to invoke whenever a spinbutton is invoked.
The command recognizes several percent substitutions: \fB%W\fR for
the widget path, \fB%s\fR for the current value of the widget, and
\fB%d\fR for the direction of the button pressed (\fBup\fR or \fBdown\fR).
.OP \-disabledbackground disabledBackground DisabledBackground
Specifies the background color to use when the spinbox is disabled.  If
this option is the empty string, the normal background color is used.
.OP \-disabledforeground disabledForeground DisabledForeground
Specifies the foreground color to use when the spinbox is disabled.  If
this option is the empty string, the normal foreground color is used.
.OP \-disabledcolor disabledColor DisabledColor
Specifies the color to use when the spinbox is disabled.  If
this option is the empty string, the normal color is used.
.OP \-format format Format
Specifies an alternate format to use when setting the string value
when using the \fB\-from\fR and \fB\-to\fR range.
This must be a format specifier of the form \fB%<pad>.<pad>f\fR,
as it will format a floating-point number.
.OP \-from from From
A floating-point value corresponding to the lowest value for a spinbox, to
76
77
78
79
80
81
82
83

84
85
86
87
88
89
90
76
77
78
79
80
81
82

83
84
85
86
87
88
89
90







-
+







\fBdisabled\fR, or \fBreadonly\fR.  If the spinbox is readonly, then the
value may not be changed using widget commands and no insertion cursor
will be displayed, even if the input focus is in the widget; the
contents of the widget may still be selected.  If the spinbox is
disabled, the value may not be changed, no insertion cursor will be
displayed, the contents will not be selectable, and the spinbox may
be displayed in a different color, depending on the values of the
\fB\-disabledforeground\fR and \fB\-disabledbackground\fR options.
\fB\-disabledcolor\fR and \fB\-disabledbackground\fR options.
.OP \-to to To
A floating-point value corresponding to the highest value for the spinbox,
to be used in conjunction with \fB\-from\fR and \fB\-increment\fR.  When
all are specified correctly, the spinbox will use these values to control
its contents. If this value is less than the \fB\-from\fR option, then
\fB\-from\fR and \fB\-to\fR values are automatically swapped.
If \fB\-values\fR is specified, it supersedes this option.
220
221
222
223
224
225
226
227

228
229
230
231
232
233
234
220
221
222
223
224
225
226

227
228
229
230
231
232
233
234







-
+







associated \fB\-textvariable\fR during validation, as that can cause the
spinbox widget to become out of sync with the \fB\-textvariable\fR.
.PP
Also, the \fB-validate\fR option will set itself to \fBnone\fR when the
spinbox value gets changed because of adjustment of \fB-from\fR or \fB-to\fR
and the \fB-validatecommand\fR returns false. For instance
.CS
     \fIspinbox pathName \-from 1 \-to 10 \-validate all \-vcmd {return 0}\fR
     \fIspinbox pathName \-from 1 \-to 10 \-validate all \-validatecommand {return 0}\fR
.CE
will in fact set the \fB-validate\fR option to \fBnone\fR because the default
value for the spinbox gets changed (due to the \fB-from\fR and \fB-to\fR
options) to a value not accepted by the validation script.
.PP
Moreover, forced validation is performed when invoking any spinbutton of
the spinbox. If the validation script returns false in this situation,
Changes to doc/text.n.
17
18
19
20
21
22
23
24

25
26

27
28
29
30
31
32
33
17
18
19
20
21
22
23

24
25

26
27
28
29
30
31
32
33







-
+

-
+







\fBtk_textCopy\fR \fIpathName\fR
\fBtk_textCut\fR \fIpathName\fR
\fBtk_textPaste\fR \fIpathName\fR
.SO
\-background	\-highlightthickness	\-relief
\-borderwidth	\-insertbackground	\-selectbackground
\-cursor	\-insertborderwidth	\-selectborderwidth
\-exportselection	\-insertofftime	\-selectforeground
\-exportselection	\-insertofftime	\-selectcolor
\-font	\-insertontime	\-setgrid
\-foreground	\-insertwidth	\-takefocus
\-color	\-insertwidth	\-takefocus
\-highlightbackground	\-padx	\-xscrollcommand
\-highlightcolor	\-pady	\-yscrollcommand
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-autoseparators autoSeparators AutoSeparators
Specifies a boolean that says whether separators are automatically inserted in
the undo stack. Only meaningful when the \fB\-undo\fR option is true.
404
405
406
407
408
409
410
411

412
413
414
415
416
417
418
419
420
421
422
423
424

425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443

444
445
446
447
448
449
450
451
452
453
454
455
456

457
458
459
460
461
462
463
404
405
406
407
408
409
410

411
412
413
414
415
416
417
418
419
420
421
422
423

424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442

443
444
445
446
447
448
449
450
451
452
453
454
455

456
457
458
459
460
461
462
463







-
+












-
+


















-
+












-
+







.QW "\fIpathName \fBtag raise\fR"
and
.QW "\fIpathName \fBtag lower\fR"
widget commands.
.PP
Tags serve three purposes in text widgets. First, they control the way
information is displayed on the screen. By default, characters are displayed
as determined by the \fB\-background\fR, \fB\-font\fR, and \fB\-foreground\fR
as determined by the \fB\-background\fR, \fB\-font\fR, and \fB\-color\fR
options for the text widget. However, display options may be associated with
individual tags using the
.QW "\fIpathName \fBtag configure\fR"
widget command. If a character has been tagged, then the display options
associated with the tag override the default display style. The following
options are currently supported for tags:
.TP
\fB\-background \fIcolor\fR
.
\fIColor\fR specifies the background color to use for characters associated
with the tag. It may have any of the forms accepted by \fBTk_GetColor\fR.
.TP
\fB\-bgstipple \fIbitmap\fR
\fB\-backgroundstipple \fIbitmap\fR
.
\fIBitmap\fR specifies a bitmap that is used as a stipple pattern for the
background. It may have any of the forms accepted by \fBTk_GetBitmap\fR. If
\fIbitmap\fR has not been specified, or if it is specified as an empty string,
then a solid fill will be used for the background.
.TP
\fB\-borderwidth \fIpixels\fR
.
\fIPixels\fR specifies the width of a border to draw around the tag using any
of the forms accepted by \fBTk_GetPixels\fR. This option should be used in
conjunction with the \fB\-relief\fR option to provide the desired border.
.TP
\fB\-elide \fIboolean\fR
.
\fIElide\fR specifies whether the data should be elided. Elided data
(characters, images, embedded windows, etc.) is not displayed and takes no
space on screen, but further on behaves just as normal data.
.TP
\fB\-fgstipple \fIbitmap\fR
\fB\-stipple \fIbitmap\fR
.
\fIBitmap\fR specifies a bitmap that is used as a stipple pattern when drawing
text and other foreground information such as underlines. It may have any of
the forms accepted by \fBTk_GetBitmap\fR. If \fIbitmap\fR has not been
specified, or if it is specified as an empty string, then a solid fill will be
used.
.TP
\fB\-font \fIfontName\fR
.
\fIFontName\fR is the name of a font to use for drawing characters. It may
have any of the forms accepted by \fBTk_GetFont\fR.
.TP
\fB\-foreground \fIcolor\fR
\fB\-color \fIcolor\fR
.
\fIColor\fR specifies the color to use when drawing text and other foreground
information such as underlines. It may have any of the forms accepted by
\fBTk_GetColor\fR.
.TP
\fB\-justify \fIjustify\fR
.
506
507
508
509
510
511
512
513

514
515
516
517
518

519
520
521
522
523
524
525
506
507
508
509
510
511
512

513
514
515
516
517

518
519
520
521
522
523
524
525







-
+




-
+







.TP
\fB\-overstrike \fIboolean\fR
.
Specifies whether or not to draw a horizontal rule through the middle of
characters. \fIBoolean\fR may have any of the forms accepted by
\fBTcl_GetBoolean\fR.
.TP
\fB\-overstrikefg \fIcolor\fR
\fB\-overstrikecolor \fIcolor\fR
.
\fIColor\fR specifies the color to use when displaying the overstrike. It may
have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not
been specified, or if it is specified as an empty string, then the color
specified by the \fB\-foreground\fR tag option is used.
specified by the \fB\-color\fR tag option is used.
.TP
\fB\-relief \fIrelief\fR
.
\fIRelief\fR specifies the relief style to use for drawing the border, in any
of the forms accepted by \fBTk_GetRelief\fR. This option is used in
conjunction with the \fB\-borderwidth\fR option to enable to the desired
border appearance.
546
547
548
549
550
551
552
553
554


555
556
557

558
559
560
561
562
563
564
546
547
548
549
550
551
552


553
554
555
556

557
558
559
560
561
562
563
564







-
-
+
+


-
+







\fB\-selectbackground \fIcolor\fR
\fIColor\fR specifies the background color to use when displaying selected
items. It may have any of the forms accepted by \fBTk_GetColor\fR. If
\fIcolor\fR has not been specified, or if it is specified as an empty
string, then the color specified by the \fB\-background\fR tag option is
used.
.TP
\fB\-selectforeground \fIcolor\fR
\fIColor\fR specifies the foreground color to use when displaying selected
\fB\-selectcolor \fIcolor\fR
\fIColor\fR specifies the color to use when displaying selected
items. It may have any of the forms accepted by \fBTk_GetColor\fR. If
\fIcolor\fR has not been specified, or if it is specified as an empty
string, then the color specified by the \fB\-foreground\fR tag option is
string, then the color specified by the \fB\-color\fR tag option is
used.
.TP
\fB\-spacing1 \fIpixels\fR
.
\fIPixels\fR specifies how much additional space should be left above each
text line, using any of the standard forms for screen distances. If a line
wraps, this option only applies to the first line on the display.
595
596
597
598
599
600
601
602

603
604
605
606
607

608
609
610
611
612
613
614
595
596
597
598
599
600
601

602
603
604
605
606

607
608
609
610
611
612
613
614







-
+




-
+







unspecified for the tag (the default).
.TP
\fB\-underline \fIboolean\fR
.
\fIBoolean\fR specifies whether or not to draw an underline underneath
characters. It may have any of the forms accepted by \fBTcl_GetBoolean\fR.
.TP
\fB\-underlinefg \fIcolor\fR
\fB\-underlinecolor \fIcolor\fR
.
\fIColor\fR specifies the color to use when displaying the underline. It may
have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not
been specified, or if it is specified as an empty string, then the color
specified by the \fB\-foreground\fR tag option is used.
specified by the \fB\-color\fR tag option is used.
.TP
\fB\-wrap \fImode\fR
.
\fIMode\fR specifies how to handle lines that are wider than the text's
window. This option only applies to a display line if it applies to the
first non-elided character on that display line. It has the same legal
values as the \fB\-wrap\fR option for the text widget: \fBnone\fR,
848
849
850
851
852
853
854
855

856
857

858
859
860
861
862
863
864
848
849
850
851
852
853
854

855
856

857
858
859
860
861
862
863
864







-
+

-
+







Whenever the \fBsel\fR tag range changes a virtual event \fB<<Selection>>\fR
is generated.
.PP
The \fBsel\fR tag is automatically defined when a text widget is created, and
it may not be deleted with the
.QW "\fIpathName \fBtag delete\fR"
widget command. Furthermore, the \fB\-selectbackground\fR,
\fB\-selectborderwidth\fR, and \fB\-selectforeground\fR options for the text
\fB\-selectborderwidth\fR, and \fB\-selectcolor\fR options for the text
widget are tied to the \fB\-background\fR, \fB\-borderwidth\fR, and
\fB\-foreground\fR options for the \fBsel\fR tag: changes in either will
\fB\-color\fR options for the \fBsel\fR tag: changes in either will
automatically be reflected in the other. Also the
\fB\-inactiveselectbackground\fR option for the text widget is used instead of
\fB\-selectbackground\fR when the text widget does not have the focus. This
allows programmatic control over the visualization of the \fBsel\fR tag for
foreground and background windows, or to have \fBsel\fR not shown at all (when
\fB\-inactiveselectbackground\fR is empty) for background windows. Each peer
text widget has its own \fBsel\fR tag which can be separately configured and
Changes to doc/ttk_button.n.
37
38
39
40
41
42
43
44

45
46
47
48
49
50
51
37
38
39
40
41
42
43

44
45
46
47
48
49
50
51







-
+







.RS
.PP
Depending on the theme, the default button may be displayed
with an extra highlight ring, or with a different border color.
.RE
.\" Not documented -- may go away
.\" .OP \-padding padding Padding
.\" .OP \-foreground foreground Foreground
.\" .OP \-color color Color
.\" .OP \-font font Font
.\" .OP \-anchor anchor Anchor
.\" .OP \-relief relief Relief
.SH "WIDGET COMMAND"
.PP
In addition to the standard
\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR
67
68
69
70
71
72
73


74
75
76
77
78
79
80
81
82
83
84
85
86
87
67
68
69
70
71
72
73
74
75
76
77
78
79
80


81
82
83
84
85
86
87







+
+





-
-







are:
.PP
\fB\-anchor\fP \fIanchor\fP
.br
\fB\-background\fP \fIcolor\fP
.br
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-color\fP \fIcolor\fP
.br
\fB\-compound\fP \fIcompound\fP
.br
\fB\-darkcolor\fP \fIcolor\fP
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-font\fP \fIfont\fP
.br
\fB\-highlightcolor\fP \fIcolor\fP
.br
\fB\-highlightthickness\fP \fIamount\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
Changes to doc/ttk_checkbutton.n.
76
77
78
79
80
81
82
83

84
85

86
87
88
89
90
91
92
76
77
78
79
80
81
82

83
84

85
86
87
88
89
90
91
92







-
+

-
+







\fBpressed\fP, \fBselected\fP, \fBreadonly\fP.
.PP
\fBTCheckbutton\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-compound\fP \fIcompound\fP
\fB\-color\fP \fIcolor\fP
.br
\fB\-foreground\fP \fIcolor\fP
\fB\-compound\fP \fIcompound\fP
.br
\fB\-indicatorbackground\fP \fIcolor\fP
.br
\fB\-indicatorcolor\fP \fIcolor\fP
.br
\fB\-indicatormargin\fP \fIpadding\fP
.br
Changes to doc/ttk_combobox.n.
15
16
17
18
19
20
21
22

23
24
25
26
27
28
29
15
16
17
18
19
20
21

22
23
24
25
26
27
28
29







-
+







.SH DESCRIPTION
.PP
A \fBttk::combobox\fR combines a text field with a pop-down list of values;
the user may select the value of the text field from among the
values in the list.
.SO ttk_widget
\-class	\-cursor	\-takefocus
\-style	\-placeholder	\-placeholderforeground
\-style	\-placeholder	\-placeholdercolor
.SE
.\" ALSO: Other entry widget options
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-exportselection exportSelection ExportSelection
Boolean value.
If set, the widget selection is linked to the X selection.
.OP \-justify justify Justify
127
128
129
130
131
132
133


134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153

154
155
156
157
158
159
160
161

162
163

164
165
166
167
168
169
170
171
172
173
174

175
176
177
178

179
180
181
182
183
184
185
127
128
129
130
131
132
133
134
135
136
137
138
139
140


141
142
143
144
145
146
147
148
149
150
151
152

153
154
155
156
157
158
159
160

161
162

163
164
165
166
167
168
169
170
171
172
173

174
175
176
177

178
179
180
181
182
183
184
185







+
+





-
-












-
+







-
+

-
+










-
+



-
+







\fB\-arrowcolor\fP \fIcolor\fP
.br
\fB\-arrowsize\fP \fIamount\fP
.br
\fB\-background\fP \fIcolor\fP
.br
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-color\fP \fIcolor\fP
.br
\fB\-darkcolor\fP \fIcolor\fP
.br
\fB\-focusfill\fP \fIcolor\fP
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-fieldbackground\fP \fIcolor\fP
.RS
Can only be changed when using non-native and non-graphical themes.
.RE
\fB\-insertcolor\fP \fIcolor\fP
.br
\fB\-insertwidth\fP \fIamount\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
.br
\fB\-padding\fP \fIpadding\fP
.br
\fB\-placeholderforeground\fP \fIcolor\fP
\fB\-placeholdercolor\fP \fIcolor\fP
.br
\fB\-postoffset\fP \fIpadding\fP
.br
\fB\-selectbackground\fP \fIcolor\fP
.RS
Text entry select background.
.RE
\fB\-selectforeground\fP \fIcolor\fP
\fB\-selectcolor\fP \fIcolor\fP
.RS
Text entry select foreground.
Text entry select color.
.RE
.PP
The \fBttk::combobox\fP popdown listbox cannot be configured using
\fBttk::style\fP nor via the widget \fBconfigure\fP command.  The listbox
can be configured using the option database.
.PP
option add *TCombobox*Listbox.background \fIcolor\fP
.br
option add *TCombobox*Listbox.font \fIfont\fP
.br
option add *TCombobox*Listbox.foreground \fIcolor\fP
option add *TCombobox*Listbox.color \fIcolor\fP
.br
option add *TCombobox*Listbox.selectBackground \fIcolor\fP
.br
option add *TCombobox*Listbox.selectForeground \fIcolor\fP
option add *TCombobox*Listbox.selectColor \fIcolor\fP
.PP
To configure a specific listbox (subject to future change):
.CS
set popdown [ttk::combobox::PopdownWindow .mycombobox]
$popdown.f.l configure \-font \fIfont\fP
.CE
.PP
Changes to doc/ttk_entry.n.
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
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







-
+

-
+



















-
+







allows that string to be edited by the user.
The value of the string may be linked to a Tcl variable
with the \fB\-textvariable\fR option.
Entry widgets support horizontal scrolling with the
standard \fB\-xscrollcommand\fR option and \fBxview\fR widget command.
.SO ttk_widget
\-class	\-cursor
\-font	\-foreground
\-font	\-color
\-style
\-takefocus	\-xscrollcommand	\-placeholder	\-placeholderforeground
\-takefocus	\-xscrollcommand	\-placeholder	\-placeholdercolor
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-exportselection exportSelection ExportSelection
A boolean value specifying whether or not
a selection in the widget should be linked to the X selection.
If the selection is exported, then selecting in the widget deselects
the current X selection, selecting outside the widget deselects any
widget selection, and the widget will respond to selection retrieval
requests when it has a selection.
.\" MAYBE: .OP \-insertbackground insertBackground Foreground
.\" MAYBE: .OP \-insertwidth insertWidth InsertWidth
.OP \-invalidcommand invalidCommand InvalidCommand
A script template to evaluate whenever the \fB\-validatecommand\fR returns 0.
See \fBVALIDATION\fR below for more information.
.OP \-justify justify Justify
Specifies how the text is aligned within the entry widget.
One of \fBleft\fR, \fBcenter\fR, or \fBright\fR.
.\" MAYBE: .OP \-selectbackground selectBackground Foreground
.\" MAYBE: .OP \-selectborderwidth selectBorderWidth BorderWidth
.\" MAYBE: .OP \-selectforeground selectForeground Background
.\" MAYBE: .OP \-selectcolor selectForeground Background
.OP \-show show Show
If this option is specified, then the true contents of the entry
are not displayed in the window.
Instead, each character in the entry's value will be displayed as
the first character in the value of this option, such as
.QW *
or a bullet.
442
443
444
445
446
447
448
449

450
451
452
453
454
455
456
457
458
459

460
461
462
463
464
465
466
467

468
469
470
471
472
473
474
475
476
477
442
443
444
445
446
447
448

449
450
451
452
453
454
455
456
457
458

459
460
461
462
463
464
465
466

467
468
469
470
471
472
473
474
475
476
477







-
+









-
+







-
+










.br
\fB\-darkcolor\fP \fIcolor\fP
.br
\fB\-fieldbackground\fP \fIcolor\fP
.RS
Some themes use a graphical background and their field background colors cannot be changed.
.RE
\fB\-foreground\fP \fIcolor\fP
\fB\-color\fP \fIcolor\fP
.br
\fB\-insertcolor\fP \fIcolor\fP
.br
\fB\-insertwidth\fP \fIamount\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
.br
\fB\-padding\fP \fIpadding\fP
.br
\fB\-placeholderforeground\fP \fIcolor\fP
\fB\-placeholdercolor\fP \fIcolor\fP
.br
\fB\-relief\fP \fIrelief\fP
.br
\fB\-selectbackground\fP \fIcolor\fP
.br
\fB\-selectborderwidth\fP \fIamount\fP
.br
\fB\-selectforeground\fP \fIcolor\fP
\fB\-selectcolor\fP \fIcolor\fP
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO"
ttk::widget(n), entry(n)
.SH KEYWORDS
entry, widget, text field
'\" Local Variables:
'\" mode: nroff
'\" End:
Changes to doc/ttk_intro.n.
54
55
56
57
58
59
60
61

62
63
64
65
66
67
68
54
55
56
57
58
59
60

61
62
63
64
65
66
67
68







-
+







not found it looks for generic elements by stripping off
successive leading components of the element name.
.PP
Like widgets, elements have \fIoptions\fR which
specify what to display and how to display it.
For example, the \fBtext\fR element
(which displays a text string) has
\fB\-text\fR, \fB\-font\fR, \fB\-foreground\fR, \fB\-background\fR,
\fB\-text\fR, \fB\-font\fR, \fB\-color\fR, \fB\-background\fR,
\fB\-underline\fR, and \fB\-width\fR options.
The value of an element option is taken from (in precedence order):
.IP \(bu
an option of the same name and type in the widget containing the element;
.IP \(bu
a dynamic setting specified by \fBstyle map\fR and the current state;
.IP \(bu
148
149
150
151
152
153
154
155

156
157
158
159
160
161
162

163
164
165
166
167
168
169

170
171
172
173
174
175
176
177
148
149
150
151
152
153
154

155
156
157
158
159
160
161

162
163
164
165
166
167
168

169
170
171
172
173
174
175
176
177







-
+






-
+






-
+








Style names use a recursive dotted notation like layouts and elements;
by default, widgets use the class name to look up a style in the current theme.
For example:
.PP
.CS
ttk::\fBstyle configure\fR TButton \e
	\-background #d9d9d9 \e
	\-foreground black \e
	\-color black \e
	\-relief raised \e
	;
.CE
.PP
Many elements are displayed differently depending on the widget state.
For example, buttons have a different background when they are active,
a different foreground when disabled, and a different relief when pressed.
a different color when disabled, and a different relief when pressed.
The \fBstyle map\fR command specifies dynamic option settings
for a particular style:
.PP
.CS
ttk::\fBstyle map\fR TButton \e
	\-background [list disabled #d9d9d9  active #ececec] \e
	\-foreground [list disabled #a3a3a3] \e
	\-color [list disabled #a3a3a3] \e
	\-relief [list {pressed !disabled} sunken] \e
	;
.CE
.SH "SEE ALSO"
ttk::widget(n), ttk::style(n)
'\" Local Variables:
'\" mode: nroff
'\" End:
Changes to doc/ttk_label.n.
15
16
17
18
19
20
21
22

23
24
25
26
27
28
29
15
16
17
18
19
20
21

22
23
24
25
26
27
28
29







-
+







.SH DESCRIPTION
.PP
A \fBttk::label\fR widget displays a textual label and/or image.
The label may be linked to a Tcl variable
to automatically change the displayed text.
.SO ttk_widget
\-anchor	\-class	\-compound	\-cursor
\-font	\-foreground
\-font	\-color
\-image	\-justify	\-padding	\-state	\-style	\-takefocus
\-text	\-textvariable	\-underline
\-width	\-wraplength
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-background frameColor FrameColor
The widget's background color.
52
53
54
55
56
57
58
59

60
61

62
63
64
65
66
67
68
69
70
71
72
73
52
53
54
55
56
57
58

59
60

61
62
63
64
65
66
67
68
69
70
71
72
73







-
+

-
+












Dynamic states: \fBdisabled\fP, \fBreadonly\fP.
.PP
\fBTLabel\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-compound\fP \fIcompound\fP
\fB\-color\fP \fIcolor\fP
.br
\fB\-foreground\fP \fIcolor\fP
\fB\-compound\fP \fIcompound\fP
.br
\fB\-font\fP \fIfont\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO"
ttk::widget(n), label(n)
'\" Local Variables:
'\" mode: nroff
'\" End:
Changes to doc/ttk_labelframe.n.
93
94
95
96
97
98
99
100

101
102

103
104
105
106
107
108
109
93
94
95
96
97
98
99

100
101

102
103
104
105
106
107
108
109







-
+

-
+







\fB\-relief\fP \fIrelief\fP
.PP
\fBTLabelframe.Label\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-font\fP \fIfont\fP
\fB\-color\fP \fIcolor\fP
.br
\fB\-foreground\fP \fIcolor\fP
\fB\-font\fP \fIfont\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO"
ttk::widget(n), ttk::frame(n), labelframe(n)
Changes to doc/ttk_menubutton.n.
54
55
56
57
58
59
60
61

62
63

64
65
66
67
68
69
70
54
55
56
57
58
59
60

61
62

63
64
65
66
67
68
69
70







-
+

-
+







\fBTMenubutton\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-arrowsize\fP \fIamount\fP
.br
\fB\-background\fP \fIcolor\fP
.br
\fB\-compound\fP \fIcompound\fP
\fB\-color\fP \fIcolor\fP
.br
\fB\-foreground\fP \fIcolor\fP
\fB\-compound\fP \fIcompound\fP
.br
\fB\-font\fP \fIfont\fP
.br
\fB\-padding\fP \fIpadding\fP
.br
\fB\-relief\fP \fIrelief\fP
.br
Changes to doc/ttk_notebook.n.
220
221
222
223
224
225
226
227

228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243


244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
220
221
222
223
224
225
226

227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256


257
258
259
260
261
262
263
264
265
266
267
268
269







-
+
















+
+











-
-













.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-darkcolor\fP \fIcolor\fP
.br
\fB\-foreground\fP \fIcolor\fP
\fB\-color\fP \fIcolor\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
.br
\fB\-padding\fP \fIpadding\fP
.br
\fB\-tabmargins\fP \fIpadding\fP
.br
\fB\-tabposition\fP \fIside\fP
.br
.PP
\fBTNotebook.Tab\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-color\fP \fIcolor\fP
.br
\fB\-compound\fP \fIcompound\fP
.br
\fB\-expand\fP \fIpadding\fP
.RS
Defines how much the tab grows in size.  Usually used with the
\fBselected\fP dynamic state.  \fB\-tabmargins\fP should be
set appropriately so that there is room for the tab growth.
.RE
\fB\-font\fP \fIfont\fP
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-padding\fP \fIpadding\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO"
ttk::widget(n), grid(n)
.SH "KEYWORDS"
pane, tab
'\" Local Variables:
'\" mode: nroff
'\" End:
Changes to doc/ttk_progressbar.n.
18
19
20
21
22
23
24
25

26
27
28
29
30

31
32
33
34
35
36
37
18
19
20
21
22
23
24

25
26
27
28
29

30
31
32
33
34
35
36
37







-
+




-
+







operation.  They can operate in two modes: \fIdeterminate\fR mode shows the
amount completed relative to the total amount of work to be done, and
\fIindeterminate\fR mode provides an animated display to let the user know
that something is happening.
.PP
If the value of \fB-orient\fR is \fBhorizontal\fR a text string can be
displayed inside the progressbar. This string can be configured using
the \fB-anchor\fR, \fB-font\fR, \fB-foreground\fR, \fB-justify\fR,
the \fB-anchor\fR, \fB-color\fR, \fB-font\fR, \fB-justify\fR,
\fB-text\fR and \fB-wraplength\fR options. If the value of \fB-orient\fR
is \fBvertical\fR then these options are ignored.
.SO ttk_widget
\-anchor	\-class	\-cursor
\-font	\-foreground	\-justify	\-style
\-font	\-color	\-justify	\-style
\-takefocus	\-text	\-wraplength
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-length length Length
Specifies the length of the long axis of the progress bar
(width if horizontal, height if vertical). The value may have any of the forms
acceptable to \fBTk_GetPixels\fR.
Changes to doc/ttk_radiobutton.n.
73
74
75
76
77
78
79
80

81
82

83
84
85
86
87
88
89
73
74
75
76
77
78
79

80
81

82
83
84
85
86
87
88
89







-
+

-
+







\fBpressed\fP, \fBreadonly\fP, \fBselected\fP.
.PP
\fBTRadiobutton\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-compound\fP \fIcompound\fP
\fB\-color\fP \fIcolor\fP
.br
\fB\-foreground\fP \fIcolor\fP
\fB\-compound\fP \fIcompound\fP
.br
\fB\-indicatorbackground\fP \fIcolor\fP
.br
\fB\-indicatorcolor\fP \fIcolor\fP
.br
\fB\-indicatormargin\fP \fIpadding\fP
.br
Changes to doc/ttk_scrollbar.n.
169
170
171
172
173
174
175
176

177
178

179
180
181
182
183
184
185
169
170
171
172
173
174
175

176
177

178
179
180
181
182
183
184
185







-
+

-
+







.br
\fB\-arrowsize\fP \fIamount\fP
.br
\fB\-background\fP \fIcolor\fP
.br
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-darkcolor\fP \fIcolor\fP (color of the dark part of the 3D relief)
\fB\-color\fP \fIcolor\fP
.br
\fB\-foreground\fP \fIcolor\fP
\fB\-darkcolor\fP \fIcolor\fP (color of the dark part of the 3D relief)
.br
\fB\-gripcount\fP \fIcount\fP (number of lines on the thumb)
.br
\fB\-lightcolor\fP \fIcolor\fP (color of the light part of the 3D relief)
.br
\fB\-troughcolor\fP \fIcolor\fP
.PP
Changes to doc/ttk_spinbox.n.
18
19
20
21
22
23
24
25

26
27
28
29
30
31
32
18
19
20
21
22
23
24

25
26
27
28
29
30
31
32







-
+







up and down buttons that are used to either modify a numeric value or
to select among a set of values. The widget implements all the features
of the \fBttk::entry\fR widget including support of the
\fB\-textvariable\fR option to link the value displayed by the widget
to a Tcl variable.
.SO ttk_widget
\-class	\-cursor	\-state	\-style
\-takefocus	\-xscrollcommand	\-placeholder	\-placeholderforeground
\-takefocus	\-xscrollcommand	\-placeholder	\-placeholdercolor
.SE
.SO ttk_entry
\-validate	\-validatecommand
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-command command Command
Specifies a Tcl command to be invoked whenever a spinbutton is invoked.
96
97
98
99
100
101
102


103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118

119
120
121
122

123
124
125
126
127
128
129
130
131
132
133
134
96
97
98
99
100
101
102
103
104
105
106
107
108
109


110
111
112
113
114
115
116
117

118
119
120
121

122
123
124
125
126
127
128
129
130
131
132
133
134







+
+





-
-








-
+



-
+












\fB\-background\fP \fIcolor\fP
.RS
For backwards compatibility, when using the aqua theme (for macOS), this
option behaves as an alias for the \fB\-fieldbackground\fP provided that no
value is specified for \fB\-fieldbackground\fP. Otherwise it is ignored.
.RE
\fB\-bordercolor\fP \fIcolor\fP
.br
\fB\-color\fP \fIcolor\fP
.br
\fB\-darkcolor\fP \fIcolor\fP
.br
\fB\-fieldbackground\fP \fIcolor\fP
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-insertcolor\fP \fIcolor\fP
.br
\fB\-insertwidth\fP \fIamount\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
.br
\fB\-padding\fP \fIpadding\fP
.br
\fB\-placeholderforeground\fP \fIcolor\fP
\fB\-placeholdercolor\fP \fIcolor\fP
.br
\fB\-selectbackground\fP \fIcolor\fP
.br
\fB\-selectforeground\fP \fIcolor\fP
\fB\-selectcolor\fP \fIcolor\fP
.PP
Some options are only available for specific themes.
.PP
See the \fBttk::style\fP manual page for information on how to configure
ttk styles.
.SH "SEE ALSO"
ttk::widget(n), ttk::entry(n), spinbox(n)
.SH KEYWORDS
entry, spinbox, widget, text field
'\" Local Variables:
'\" mode: nroff
'\" End:
Changes to doc/ttk_treeview.n.
428
429
430
431
432
433
434
435
436


437
438
439
440
441
442
443
428
429
430
431
432
433
434


435
436
437
438
439
440
441
442
443







-
-
+
+







A boolean value indicating whether the item's children
should be displayed (\fB\-open true\fR) or hidden (\fB\-open false\fR).
.OP \-tags tags Tags
A list of tags associated with this item.
.SH "TAG OPTIONS"
.PP
The following options may be specified on tags:
.IP \fB\-foreground\fR
Specifies the text foreground color.
.IP \fB\-color\fR
Specifies the text color.
.IP \fB\-background\fR
Specifies the cell or item background color.
.IP \fB\-font\fR
Specifies the font to use when drawing text.
.\" ??? Maybe: .IP \-anchor
.\" ??? Maybe: .IP \-padding
.\" ??? Maybe: .IP \-text
497
498
499
500
501
502
503


504
505
506
507
508
509
510
511
512
513
514
515
516
517
497
498
499
500
501
502
503
504
505
506
507
508
509
510


511
512
513
514
515
516
517







+
+





-
-







.PP
Dynamic states: \fBdisabled\fP, \fBselected\fP.
.PP
\fBTreeview\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-background\fP \fIcolor\fP
.br
\fB\-color\fP \fIcolor\fP
.br
\fB\-fieldbackground\fP \fIcolor\fP
.br
\fB\-font\fP \fIfont\fP
.br
\fB\-foreground\fP \fIcolor\fP
.br
\fB\-rowheight\fP \fIamount\fP
.RS
The \fB\-rowheight\fP value is not corrected by the \fBtk scaling\fP
value or by the configured font size and must always be set.  Also make
sure that the \fB\-rowheight\fP is large enough to contain any images.
.PP
To adjust the \fB\-rowheight\fP for the Treeview style, use the following code
533
534
535
536
537
538
539
540

541
542
543
544
545
546
547
533
534
535
536
537
538
539

540
541
542
543
544
545
546
547







-
+







\fB\-font\fP \fIfont\fP
.br
\fB\-relief\fP \fIrelief\fP
.PP
\fBItem\fP styling options configurable with \fBttk::style\fP
are:
.PP
\fB\-foreground\fP \fIcolor\fP
\fB\-color\fP \fIcolor\fP
.br
\fB\-indicatormargins\fP \fIpadding\fP
.br
\fB\-indicatorsize\fP \fIamount\fP
.br
\fB\-padding\fP \fIpadding\fP
.PP
Changes to doc/ttk_widget.n.
97
98
99
100
101
102
103
104
105


106
107
108
109
110
111
112
97
98
99
100
101
102
103


104
105
106
107
108
109
110
111
112







-
-
+
+







.IP right
Display image above, below, left of, or right of the text, respectively.
.IP none
Display the image if present, otherwise the text.
.RE
.OP \-font font Font
Font to use for the text displayed by the widget.
.OP \-foreground textColor TextColor
The widget's foreground color.
.OP \-color textColor TextColor
The widget's color.
If unspecified, the theme default is used.
.OP \-image image Image
Specifies an image to display.
This is a list of 1 or more elements.
The first element is the default image name.
The rest of the list is a sequence of \fIstatespec / value\fR pairs
as per \fBstyle map\fR, specifying different images to use when
153
154
155
156
157
158
159
160
161
162



163
164
165
166
167
168
169
153
154
155
156
157
158
159



160
161
162
163
164
165
166
167
168
169







-
-
-
+
+
+







than the specified value.
.SH "ENTRY OPTIONS"
The following options are supported by entry, spinbox and combobox:
.OP \-placeholder placeHolder PlaceHolder
Specifies a help text string to display if no text is otherwise displayed,
that is when the widget is empty. The placeholder text is displayed using
the values of the \fB\-font\fR, \fB\-justify\fR and
\fB\-placeholderforeground\fR options.
.OP \-placeholderforeground placeHolderForeground PlaceHolderForeground
Specifies the foreground color of the placeholder text.
\fB\-placeholdercolor\fR options.
.OP \-placeholdercolor placeHolderForeground PlaceHolderForeground
Specifies the color of the placeholder text.
.SH "COMPATIBILITY OPTIONS"
This option is only available for themed widgets that have
.QW corresponding
traditional Tk widgets.
.OP \-state state State
May be set to \fBnormal\fR or \fBdisabled\fR
to control the \fBdisabled\fR state bit.
Changes to generic/tkButton.c.
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
94
95


96
97
98
99
100


101
102



103
104



105
106

107
108



109
110
111
112
113
114
115
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
94
95
96
97
98
99
100
101


102
103
104
105
106


107
108
109
110
111
112
113


114
115
116
117
118
119


120
121
122
123
124
125
126
127
128
129







-
+


-
+


+
+
+
+





+




+






+
+

-
-
+
+



-
-
+
+


+
+
+
-
-
+
+
+


+
-
-
+
+
+








/*
 * Information used for parsing configuration options.  There is a
 * separate table for each of the four widget classes.
 */

static const Tk_OptionSpec labelOptionSpecs[] = {
    {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground",
    {TK_OPTION_BORDER, "-activebackground", "activeBackground", "ActiveBackground",
	DEF_BUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeBorder),
	0, DEF_BUTTON_ACTIVE_BG_MONO, 0},
    {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background",
    {TK_OPTION_COLOR, "-activecolor", "activeColor", "ActiveColor",
	DEF_BUTTON_ACTIVE_FG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeFg),
	TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-activeforeground", "activecolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-activecolor", 0},
#endif
    {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor",
	DEF_BUTTON_ANCHOR, TCL_INDEX_NONE, offsetof(TkButton, anchor), 0, 0, 0},
    {TK_OPTION_BORDER, "-background", "background", "Background",
	DEF_BUTTON_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, normalBorder),
	0, DEF_BUTTON_BG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
#endif
    {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap",
	DEF_BUTTON_BITMAP, TCL_INDEX_NONE, offsetof(TkButton, bitmap),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr),
	offsetof(TkButton, borderWidth), 0, 0, 0},
    {TK_OPTION_COLOR, "-color", "color", "Color",
	DEF_BUTTON_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0},
    {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
	 DEF_BUTTON_COMPOUND, TCL_INDEX_NONE, offsetof(TkButton, compound), 0,
	 compoundStrings, 0},
	DEF_BUTTON_COMPOUND, TCL_INDEX_NONE, offsetof(TkButton, compound), 0,
	compoundStrings, 0},
    {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
	DEF_BUTTON_CURSOR, TCL_INDEX_NONE, offsetof(TkButton, cursor),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
	"DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR,
    {TK_OPTION_COLOR, "-disabledcolor", "disabledColor",
	"DisabledColor", DEF_BUTTON_DISABLED_FG_COLOR,
	TCL_INDEX_NONE, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK,
	(ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-disabledforeground", "disabledcolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-disabledcolor", 0},
    {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0},
    {TK_OPTION_SYNONYM, "-fg", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_FONT, "-font", "font", "Font",
	DEF_BUTTON_FONT, TCL_INDEX_NONE, offsetof(TkButton, tkfont), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
	DEF_BUTTON_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0},
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_STRING, "-height", "height", "Height",
	DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_INDEX_NONE, 0, 0, 0},
    {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground",
	"HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR,
	TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0,
	(ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0},
    {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
150
151
152
153
154
155
156
157

158
159
160

161
162




163
164
165
166
167

168
169
170
171

172
173
174
175
176
177


178
179
180
181
182
183
184
185
186
187
188
189
190
191


192
193



194
195



196
197

198
199



200
201
202
203
204
205
206
164
165
166
167
168
169
170

171
172
173

174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211


212
213
214
215
216
217
218


219
220
221
222
223
224


225
226
227
228
229
230
231
232
233
234







-
+


-
+


+
+
+
+





+




+






+
+












-
-
+
+


+
+
+
-
-
+
+
+


+
-
-
+
+
+







    {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength",
	DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthPtr),
	offsetof(TkButton, wrapLength), 0, 0, 0},
    {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0}
};

static const Tk_OptionSpec buttonOptionSpecs[] = {
    {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground",
    {TK_OPTION_BORDER, "-activebackground", "activeBackground", "ActiveBackground",
	DEF_BUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeBorder),
	0, DEF_BUTTON_ACTIVE_BG_MONO, 0},
    {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background",
    {TK_OPTION_COLOR, "-activecolor", "activeColor", "ActiveColor",
	DEF_BUTTON_ACTIVE_FG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeFg),
	TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-activeforeground", "activecolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-activecolor", 0},
#endif
    {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor",
	DEF_BUTTON_ANCHOR, TCL_INDEX_NONE, offsetof(TkButton, anchor), 0, 0, 0},
    {TK_OPTION_BORDER, "-background", "background", "Background",
	DEF_BUTTON_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, normalBorder),
	0, DEF_BUTTON_BG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
#endif
    {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap",
	DEF_BUTTON_BITMAP, TCL_INDEX_NONE, offsetof(TkButton, bitmap),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr),
	offsetof(TkButton, borderWidth), 0, 0, 0},
    {TK_OPTION_COLOR, "-color", "color", "Color",
	DEF_BUTTON_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0},
    {TK_OPTION_STRING, "-command", "command", "Command",
	DEF_BUTTON_COMMAND, offsetof(TkButton, commandPtr), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
	 DEF_BUTTON_COMPOUND, TCL_INDEX_NONE, offsetof(TkButton, compound), 0,
	 compoundStrings, 0},
    {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
	DEF_BUTTON_CURSOR, TCL_INDEX_NONE, offsetof(TkButton, cursor),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING_TABLE, "-default", "default", "Default",
        DEF_BUTTON_DEFAULT, TCL_INDEX_NONE, offsetof(TkButton, defaultState),
	0, defaultStrings, 0},
    {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
	"DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR,
    {TK_OPTION_COLOR, "-disabledcolor", "disabledColor",
	"DisabledColor", DEF_BUTTON_DISABLED_FG_COLOR,
	TCL_INDEX_NONE, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK,
	(ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-disabledforeground", "disabledcolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-disabledcolor", 0},
    {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0},
    {TK_OPTION_SYNONYM, "-fg", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_FONT, "-font", "font", "Font",
	DEF_BUTTON_FONT, TCL_INDEX_NONE, offsetof(TkButton, tkfont), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
	DEF_BUTTON_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0},
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_STRING, "-height", "height", "Height",
	DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_INDEX_NONE, 0, 0, 0},
    {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground",
	"HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR,
	TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0,
	(ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0},
    {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
251
252
253
254
255
256
257
258

259
260
261

262
263




264
265
266
267
268

269
270
271
272

273
274
275
276
277
278


279
280
281
282
283
284
285
286
287
288
289


290
291



292
293



294
295

296
297



298
299
300
301
302
303
304
279
280
281
282
283
284
285

286
287
288

289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323


324
325
326
327
328
329
330


331
332
333
334
335
336


337
338
339
340
341
342
343
344
345
346







-
+


-
+


+
+
+
+





+




+






+
+









-
-
+
+


+
+
+
-
-
+
+
+


+
-
-
+
+
+







    {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength",
	DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthPtr),
	offsetof(TkButton, wrapLength), 0, 0, 0},
    {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0}
};

static const Tk_OptionSpec checkbuttonOptionSpecs[] = {
    {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground",
    {TK_OPTION_BORDER, "-activebackground", "activeBackground", "ActiveBackground",
	DEF_BUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeBorder),
	0, DEF_BUTTON_ACTIVE_BG_MONO, 0},
    {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background",
    {TK_OPTION_COLOR, "-activecolor", "activeColor", "ActiveColor",
	DEF_CHKRAD_ACTIVE_FG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeFg),
	TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-activeforeground", "activecolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-activecolor", 0},
#endif
    {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor",
	DEF_BUTTON_ANCHOR, TCL_INDEX_NONE, offsetof(TkButton, anchor), 0, 0, 0},
    {TK_OPTION_BORDER, "-background", "background", "Background",
	DEF_BUTTON_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, normalBorder),
	0, DEF_BUTTON_BG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
#endif
    {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap",
	DEF_BUTTON_BITMAP, TCL_INDEX_NONE, offsetof(TkButton, bitmap),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr),
	offsetof(TkButton, borderWidth), 0, 0, 0},
    {TK_OPTION_COLOR, "-color", "color", "Color",
	DEF_CHKRAD_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0},
    {TK_OPTION_STRING, "-command", "command", "Command",
	DEF_BUTTON_COMMAND, offsetof(TkButton, commandPtr), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
	 DEF_BUTTON_COMPOUND, TCL_INDEX_NONE, offsetof(TkButton, compound), 0,
	 compoundStrings, 0},
    {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
	DEF_BUTTON_CURSOR, TCL_INDEX_NONE, offsetof(TkButton, cursor),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
	"DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR,
    {TK_OPTION_COLOR, "-disabledcolor", "disabledColor",
	"DisabledColor", DEF_BUTTON_DISABLED_FG_COLOR,
	TCL_INDEX_NONE, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK,
	(ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-disabledforeground", "disabledcolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-disabledcolor", 0},
    {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0},
    {TK_OPTION_SYNONYM, "-fg", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_FONT, "-font", "font", "Font",
	DEF_BUTTON_FONT, TCL_INDEX_NONE, offsetof(TkButton, tkfont), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
	DEF_CHKRAD_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0},
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_STRING, "-height", "height", "Height",
	DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_INDEX_NONE, 0, 0, 0},
    {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground",
	"HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR,
	TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0,
	(ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0},
    {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
364
365
366
367
368
369
370
371

372
373
374

375
376




377
378
379
380
381

382
383
384
385

386
387
388
389
390
391


392
393
394
395
396
397
398
399
400
401
402


403
404



405
406



407
408

409
410



411
412
413
414
415
416
417
406
407
408
409
410
411
412

413
414
415

416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450


451
452
453
454
455
456
457


458
459
460
461
462
463


464
465
466
467
468
469
470
471
472
473







-
+


-
+


+
+
+
+





+




+






+
+









-
-
+
+


+
+
+
-
-
+
+
+


+
-
-
+
+
+







    {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength",
	DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthPtr),
	offsetof(TkButton, wrapLength), 0, 0, 0},
    {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0}
};

static const Tk_OptionSpec radiobuttonOptionSpecs[] = {
    {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground",
    {TK_OPTION_BORDER, "-activebackground", "activeBackground", "ActiveBackground",
	DEF_BUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeBorder),
	0, DEF_BUTTON_ACTIVE_BG_MONO, 0},
    {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background",
    {TK_OPTION_COLOR, "-activecolor", "activeColor", "ActiveColor",
	DEF_CHKRAD_ACTIVE_FG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeFg),
	TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-activeforeground", "activecolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-activecolor", 0},
#endif
    {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor",
	DEF_BUTTON_ANCHOR, TCL_INDEX_NONE, offsetof(TkButton, anchor), 0, 0, 0},
    {TK_OPTION_BORDER, "-background", "background", "Background",
	DEF_BUTTON_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, normalBorder),
	0, DEF_BUTTON_BG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
#endif
    {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap",
	DEF_BUTTON_BITMAP, TCL_INDEX_NONE, offsetof(TkButton, bitmap),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr),
	offsetof(TkButton, borderWidth), 0, 0, 0},
    {TK_OPTION_COLOR, "-color", "color", "Color",
	DEF_CHKRAD_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0},
    {TK_OPTION_STRING, "-command", "command", "Command",
	DEF_BUTTON_COMMAND, offsetof(TkButton, commandPtr), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
	 DEF_BUTTON_COMPOUND, TCL_INDEX_NONE, offsetof(TkButton, compound), 0,
	 compoundStrings, 0},
    {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
	DEF_BUTTON_CURSOR, TCL_INDEX_NONE, offsetof(TkButton, cursor),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
	"DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR,
    {TK_OPTION_COLOR, "-disabledcolor", "disabledColor",
	"DisabledColor", DEF_BUTTON_DISABLED_FG_COLOR,
	TCL_INDEX_NONE, offsetof(TkButton, disabledFg), TK_OPTION_NULL_OK,
	(ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-disabledforeground", "disabledcolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-disabledcolor", 0},
    {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0},
    {TK_OPTION_SYNONYM, "-fg", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_FONT, "-font", "font", "Font",
	DEF_BUTTON_FONT, TCL_INDEX_NONE, offsetof(TkButton, tkfont), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
	DEF_CHKRAD_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0},
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_STRING, "-height", "height", "Height",
	DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_INDEX_NONE, 0, 0, 0},
    {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground",
	"HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR,
	TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0,
	(ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0},
    {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
Changes to generic/tkButton.h.
141
142
143
144
145
146
147
148

149
150
151
152
153
154
155






156
157
158
159
160
161
162
141
142
143
144
145
146
147

148
149






150
151
152
153
154
155
156
157
158
159
160
161
162







-
+

-
-
-
-
-
-
+
+
+
+
+
+







    int inset;			/* Total width of all borders, including
				 * traversal highlight and 3-D border.
				 * Indicates how much interior stuff must be
				 * offset from outside edges to leave room for
				 * borders. */
    Tk_Font tkfont;		/* Value of -font option: specifies font to
				 * use for display text. */
    XColor *normalFg;		/* Value of -font option: specifies foreground
    XColor *normalFg;		/* Value of -font option: specifies
				 * color in normal mode. */
    XColor *activeFg;		/* Value of -activeforeground option:
				 * foreground color in active mode. NULL means
				 * use -foreground instead. */
    XColor *disabledFg;		/* Value of -disabledforeground option:
				 * foreground color when disabled. NULL means
				 * use normalFg with a 50% stipple instead. */
    XColor *activeFg;		/* Value of -activecolor option:
				 * color in active mode. NULL means
				 * use -color instead. */
    XColor *disabledFg;		/* Value of -disabledcolor option:
				 * color when disabled. NULL means
				 * use -color with a 50% stipple instead. */
    GC normalTextGC;		/* GC for drawing text in normal mode. Also
				 * used to copy from off-screen pixmap onto
				 * screen. */
    GC activeTextGC;		/* GC for drawing text in active mode (NULL
				 * means use normalTextGC). */
    GC disabledGC;		/* Used to produce disabled effect for text
				 * and check/radio marks. */
Changes to generic/tkCanvBmap.c.
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
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







-
+

-
+

-
+

+
+
+


-
+

-
+

+
+
-
+


-
+


-
+


+
-
-
+
+
+







    TkStateParseProc, TkStatePrintProc, INT2PTR(2)
};
static const Tk_CustomOption tagsOption = {
    TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL
};

static const Tk_ConfigSpec configSpecs[] = {
    {TK_CONFIG_COLOR, "-activebackground", NULL, NULL,
    {TK_CONFIG_COLOR, "-activebackground", "activebackground", "Activebackground",
	NULL, offsetof(BitmapItem, activeBgColor), TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_BITMAP, "-activebitmap", NULL, NULL,
    {TK_CONFIG_BITMAP, "-activebitmap", "activebitmap", "Activebitmap",
	NULL, offsetof(BitmapItem, activeBitmap), TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_COLOR, "-activeforeground", NULL, NULL,
    {TK_CONFIG_COLOR, "-activecolor", "activecolor", "Activecolor",
	NULL, offsetof(BitmapItem, activeFgColor), TK_CONFIG_NULL_OK, NULL},
#ifndef TK_NO_DEPRECATED
    {TK_CONFIG_SYNONYM, "-activeforeground", "activecolor", NULL, NULL, 0, 0, NULL},
#endif
    {TK_CONFIG_ANCHOR, "-anchor", NULL, NULL,
	"center", offsetof(BitmapItem, anchor), TK_CONFIG_DONT_SET_DEFAULT, NULL},
    {TK_CONFIG_COLOR, "-background", NULL, NULL,
    {TK_CONFIG_COLOR, "-background", "background", "Background",
	NULL, offsetof(BitmapItem, bgColor), TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_BITMAP, "-bitmap", NULL, NULL,
    {TK_CONFIG_BITMAP, "-bitmap", "bitmap", "Bitmap",
	NULL, offsetof(BitmapItem, bitmap), TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_COLOR, "-color", "color", "Color",
	DEF_CANVBMAP_FG, offsetof(BitmapItem, fgColor), 0, NULL},
    {TK_CONFIG_COLOR, "-disabledbackground", NULL, NULL,
    {TK_CONFIG_COLOR, "-disabledbackground", "disabledbackground", "Disabledbackground",
	NULL, offsetof(BitmapItem, disabledBgColor),
	TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_BITMAP, "-disabledbitmap", NULL, NULL,
    {TK_CONFIG_BITMAP, "-disabledbitmap", "disabledbitmap", "Disabledbitmap",
	NULL, offsetof(BitmapItem, disabledBitmap),
	TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_COLOR, "-disabledforeground", NULL, NULL,
    {TK_CONFIG_COLOR, "-disabledcolor", "disabledcolor", "Disabledcolor",
	NULL, offsetof(BitmapItem, disabledFgColor),
	TK_CONFIG_NULL_OK, NULL},
#ifndef TK_NO_DEPRECATED
    {TK_CONFIG_COLOR, "-foreground", NULL, NULL,
	DEF_CANVBMAP_FG, offsetof(BitmapItem, fgColor), 0, NULL},
    {TK_CONFIG_SYNONYM, "-disabledforeground", "disabledcolor", NULL, NULL, 0, 0, NULL},
    {TK_CONFIG_SYNONYM, "-foreground", "color", NULL, NULL, 0, 0, NULL},
#endif
    {TK_CONFIG_CUSTOM, "-state", NULL, NULL,
	NULL, offsetof(Tk_Item, state), TK_CONFIG_NULL_OK,
	&stateOption},
    {TK_CONFIG_CUSTOM, "-tags", NULL, NULL,
	NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
    {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};
Changes to generic/tkCanvas.c.
92
93
94
95
96
97
98

99
100

101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119

120
121

122
123
124

125
126
127

128
129

130
131
132
133
134
135
136
137
138
139
140
141

142
143
144

145
146
147

148
149
150

151
152
153

154
155
156

157
158



159
160
161
162
163
164
165
166
167

168
169
170
171

172
173
174
175
176
177
178

179
180
181
182
183
184
185
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

121
122

123
124
125

126
127
128

129
130

131
132
133
134
135
136
137
138
139
140
141
142

143
144
145

146
147
148

149
150
151

152
153
154

155
156
157

158
159
160
161
162
163
164
165
166
167
168
169
170
171

172
173
174
175

176
177
178
179
180
181
182

183
184
185
186
187
188
189
190







+


+


















-
+

-
+


-
+


-
+

-
+











-
+


-
+


-
+


-
+


-
+


-
+


+
+
+








-
+



-
+






-
+







static const Tk_ConfigSpec configSpecs[] = {
    {TK_CONFIG_BORDER, "-background", "background", "Background",
	DEF_CANVAS_BG_COLOR, offsetof(TkCanvas, bgBorder),
	TK_CONFIG_COLOR_ONLY, NULL},
    {TK_CONFIG_BORDER, "-background", "background", "Background",
	DEF_CANVAS_BG_MONO, offsetof(TkCanvas, bgBorder),
	TK_CONFIG_MONO_ONLY, NULL},
#ifndef TK_NO_DEPRECATED
    {TK_CONFIG_SYNONYM, "-bd", "borderWidth", NULL, NULL, 0, 0, NULL},
    {TK_CONFIG_SYNONYM, "-bg", "background", NULL, NULL, 0, 0, NULL},
#endif
    {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	DEF_CANVAS_BORDER_WIDTH, offsetof(TkCanvas, borderWidth), 0, NULL},
    {TK_CONFIG_DOUBLE, "-closeenough", "closeEnough", "CloseEnough",
	DEF_CANVAS_CLOSE_ENOUGH, offsetof(TkCanvas, closeEnough), 0, NULL},
    {TK_CONFIG_BOOLEAN, "-confine", "confine", "Confine",
	DEF_CANVAS_CONFINE, offsetof(TkCanvas, confine), 0, NULL},
    {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
	DEF_CANVAS_CURSOR, offsetof(TkCanvas, cursor), TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_PIXELS, "-height", "height", "Height",
	DEF_CANVAS_HEIGHT, offsetof(TkCanvas, height), 0, NULL},
    {TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
	"HighlightBackground", DEF_CANVAS_HIGHLIGHT_BG,
	offsetof(TkCanvas, highlightBgColorPtr), 0, NULL},
    {TK_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
	DEF_CANVAS_HIGHLIGHT, offsetof(TkCanvas, highlightColorPtr), 0, NULL},
    {TK_CONFIG_PIXELS, "-highlightthickness", "highlightThickness",
	"HighlightThickness",
	DEF_CANVAS_HIGHLIGHT_WIDTH, offsetof(TkCanvas, highlightWidth), 0, NULL},
    {TK_CONFIG_BORDER, "-insertbackground", "insertBackground", "Foreground",
    {TK_CONFIG_BORDER, "-insertbackground", "insertBackground", "InsertBackground",
	DEF_CANVAS_INSERT_BG, offsetof(TkCanvas, textInfo.insertBorder), 0, NULL},
    {TK_CONFIG_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth",
    {TK_CONFIG_PIXELS, "-insertborderwidth", "insertBorderWidth", "InsertBorderWidth",
	DEF_CANVAS_INSERT_BD_COLOR,
	offsetof(TkCanvas, textInfo.insertBorderWidth), TK_CONFIG_COLOR_ONLY, NULL},
    {TK_CONFIG_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth",
    {TK_CONFIG_PIXELS, "-insertborderwidth", "insertBorderWidth", "InsertBorderWidth",
	DEF_CANVAS_INSERT_BD_MONO,
	offsetof(TkCanvas, textInfo.insertBorderWidth), TK_CONFIG_MONO_ONLY, NULL},
    {TK_CONFIG_INT, "-insertofftime", "insertOffTime", "OffTime",
    {TK_CONFIG_INT, "-insertofftime", "insertOffTime", "InsertOffTime",
	DEF_CANVAS_INSERT_OFF_TIME, offsetof(TkCanvas, insertOffTime), 0, NULL},
    {TK_CONFIG_INT, "-insertontime", "insertOnTime", "OnTime",
    {TK_CONFIG_INT, "-insertontime", "insertOnTime", "InsertOnTime",
	DEF_CANVAS_INSERT_ON_TIME, offsetof(TkCanvas, insertOnTime), 0, NULL},
    {TK_CONFIG_PIXELS, "-insertwidth", "insertWidth", "InsertWidth",
	DEF_CANVAS_INSERT_WIDTH, offsetof(TkCanvas, textInfo.insertWidth), 0, NULL},
    {TK_CONFIG_CUSTOM, "-offset", "offset", "Offset", "0,0",
	offsetof(TkCanvas, tsoffset),TK_CONFIG_DONT_SET_DEFAULT,
	&offsetOption},
    {TK_CONFIG_RELIEF, "-relief", "relief", "Relief",
	DEF_CANVAS_RELIEF, offsetof(TkCanvas, relief), 0, NULL},
    {TK_CONFIG_STRING, "-scrollregion", "scrollRegion", "ScrollRegion",
	DEF_CANVAS_SCROLL_REGION, offsetof(TkCanvas, regionString),
	TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_BORDER, "-selectbackground", "selectBackground", "Foreground",
    {TK_CONFIG_BORDER, "-selectbackground", "selectBackground", "SelectBackground",
	DEF_CANVAS_SELECT_COLOR, offsetof(TkCanvas, textInfo.selBorder),
	TK_CONFIG_COLOR_ONLY, NULL},
    {TK_CONFIG_BORDER, "-selectbackground", "selectBackground", "Foreground",
    {TK_CONFIG_BORDER, "-selectbackground", "selectBackground", "SelectBackground",
	DEF_CANVAS_SELECT_MONO, offsetof(TkCanvas, textInfo.selBorder),
	TK_CONFIG_MONO_ONLY, NULL},
    {TK_CONFIG_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth",
    {TK_CONFIG_PIXELS, "-selectborderwidth", "selectBorderWidth", "SelectBorderWidth",
	DEF_CANVAS_SELECT_BD_COLOR,
	offsetof(TkCanvas, textInfo.selBorderWidth), TK_CONFIG_COLOR_ONLY, NULL},
    {TK_CONFIG_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth",
    {TK_CONFIG_PIXELS, "-selectborderwidth", "selectBorderWidth", "SelectBorderWidth",
	DEF_CANVAS_SELECT_BD_MONO, offsetof(TkCanvas, textInfo.selBorderWidth),
	TK_CONFIG_MONO_ONLY, NULL},
    {TK_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background",
    {TK_CONFIG_COLOR, "-selectcolor", "selectColor", "SelectColor",
	DEF_CANVAS_SELECT_FG_COLOR, offsetof(TkCanvas, textInfo.selFgColorPtr),
	TK_CONFIG_COLOR_ONLY|TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background",
    {TK_CONFIG_COLOR, "-selectcolor", "selectColor", "SelectColor",
	DEF_CANVAS_SELECT_FG_MONO, offsetof(TkCanvas, textInfo.selFgColorPtr),
	TK_CONFIG_MONO_ONLY|TK_CONFIG_NULL_OK, NULL},
#ifndef TK_NO_DEPRECATED
    {TK_CONFIG_SYNONYM, "-selectforeground", "selectColor", NULL, NULL, 0, 0, NULL},
#endif
    {TK_CONFIG_CUSTOM, "-state", "state", "State",
	"normal", offsetof(TkCanvas, canvas_state), TK_CONFIG_DONT_SET_DEFAULT,
	&stateOption},
    {TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
	DEF_CANVAS_TAKE_FOCUS, offsetof(TkCanvas, takeFocus),
	TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_PIXELS, "-width", "width", "Width",
	DEF_CANVAS_WIDTH, offsetof(TkCanvas, width), 0, NULL},
    {TK_CONFIG_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
    {TK_CONFIG_STRING, "-xscrollcommand", "xScrollCommand", "XScrollCommand",
	DEF_CANVAS_X_SCROLL_CMD, offsetof(TkCanvas, xScrollCmd),
	TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_PIXELS, "-xscrollincrement", "xScrollIncrement",
	"ScrollIncrement",
	"XScrollIncrement",
	DEF_CANVAS_X_SCROLL_INCREMENT, offsetof(TkCanvas, xScrollIncrement),
	0, NULL},
    {TK_CONFIG_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand",
	DEF_CANVAS_Y_SCROLL_CMD, offsetof(TkCanvas, yScrollCmd),
	TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_PIXELS, "-yscrollincrement", "yScrollIncrement",
	"ScrollIncrement",
	"YScrollIncrement",
	DEF_CANVAS_Y_SCROLL_INCREMENT, offsetof(TkCanvas, yScrollIncrement),
	0, NULL},
    {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};

/*
 * List of all the item types known at present. This is *global* and is
Changes to generic/tkEntry.c.
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
94
95
96
97
98
99
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
94
95


96
97
98
99
100
101


102
103
104
105
106
107
108
109
110
111







+




+


+
+







-
-
+
+

+
+
+
+



+
-
-
+
+
+


+
-
-
+
+
+







 * Information used for Entry objv parsing.
 */

static const Tk_OptionSpec entryOptSpec[] = {
    {TK_OPTION_BORDER, "-background", "background", "Background",
	DEF_ENTRY_BG_COLOR, TCL_INDEX_NONE, offsetof(Entry, normalBorder),
	0, DEF_ENTRY_BG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
#endif
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	DEF_ENTRY_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Entry, borderWidth), 0, 0, 0},
    {TK_OPTION_COLOR, "-color", "color", "Color",
	DEF_ENTRY_FG, TCL_INDEX_NONE, offsetof(Entry, fgColorPtr), 0, 0, 0},
    {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
	DEF_ENTRY_CURSOR, TCL_INDEX_NONE, offsetof(Entry, cursor),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_BORDER, "-disabledbackground", "disabledBackground",
	"DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, TCL_INDEX_NONE,
	offsetof(Entry, disabledBorder), TK_OPTION_NULL_OK,
	(ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0},
    {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
	"DisabledForeground", DEF_ENTRY_DISABLED_FG, TCL_INDEX_NONE,
    {TK_OPTION_COLOR, "-disabledcolor", "disabledColor",
	"DisabledColor", DEF_ENTRY_DISABLED_FG, TCL_INDEX_NONE,
	offsetof(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-disabledforeground", "disabledcolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-disabledcolor", 0},
#endif
    {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection",
	"ExportSelection", DEF_ENTRY_EXPORT_SELECTION, TCL_INDEX_NONE,
	offsetof(Entry, exportSelection), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0},
    {TK_OPTION_SYNONYM, "-fg", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_FONT, "-font", "font", "Font",
	DEF_ENTRY_FONT, TCL_INDEX_NONE, offsetof(Entry, tkfont), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
	DEF_ENTRY_FG, TCL_INDEX_NONE, offsetof(Entry, fgColorPtr), 0, 0, 0},
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground",
	"HighlightBackground", DEF_ENTRY_HIGHLIGHT_BG,
	TCL_INDEX_NONE, offsetof(Entry, highlightBgColorPtr), 0, 0, 0},
    {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
	DEF_ENTRY_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Entry, highlightColorPtr), 0, 0, 0},
    {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
	"HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, TCL_INDEX_NONE,
110
111
112
113
114
115
116

117
118

119
120
121
122
123
124
125
126







127
128
129
130
131
132
133
134
135
136
137
138
139
140

141
142




143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159

160
161

162
163
164
165
166
167
168
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157

158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192







+


+





-
-
-
+
+
+
+
+
+
+













-
+


+
+
+
+

















+


+







    {TK_OPTION_INT, "-insertontime", "insertOnTime", "OnTime",
	DEF_ENTRY_INSERT_ON_TIME, TCL_INDEX_NONE, offsetof(Entry, insertOnTime), 0, 0, 0},
    {TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth",
	DEF_ENTRY_INSERT_WIDTH, TCL_INDEX_NONE, offsetof(Entry, insertWidth), 0, 0, 0},
    {TK_OPTION_STRING, "-invalidcommand", "invalidCommand", "InvalidCommand",
	DEF_ENTRY_INVALIDCMD, TCL_INDEX_NONE, offsetof(Entry, invalidCmd),
	TK_OPTION_NULL_OK, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-invcmd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-invalidcommand", 0},
#endif
    {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
	DEF_ENTRY_JUSTIFY, TCL_INDEX_NONE, offsetof(Entry, justify), 0, 0, 0},
    {TK_OPTION_STRING, "-placeholder", "placeHolder", "PlaceHolder",
	DEF_ENTRY_PLACEHOLDER, TCL_INDEX_NONE, offsetof(Entry, placeholderString),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_COLOR, "-placeholderforeground", "placeholderForeground",
        "PlaceholderForeground", DEF_ENTRY_PLACEHOLDERFG, TCL_INDEX_NONE,
        offsetof(Entry, placeholderColorPtr), 0, 0, 0},
    {TK_OPTION_COLOR, "-placeholdercolor", "placeholderColor",
	"PlaceholderColor", DEF_ENTRY_PLACEHOLDERFG, TCL_INDEX_NONE,
	offsetof(Entry, placeholderColorPtr), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-placeholderforeground", "placeholdercolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-placeholdercolor", 0},
#endif
    {TK_OPTION_BORDER, "-readonlybackground", "readonlyBackground",
	"ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, TCL_INDEX_NONE,
	offsetof(Entry, readonlyBorder), TK_OPTION_NULL_OK,
	(ClientData) DEF_ENTRY_READONLY_BG_MONO, 0},
    {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
	DEF_ENTRY_RELIEF, TCL_INDEX_NONE, offsetof(Entry, relief), 0, 0, 0},
    {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground",
	DEF_ENTRY_SELECT_COLOR, TCL_INDEX_NONE, offsetof(Entry, selBorder),
	0, DEF_ENTRY_SELECT_MONO, 0},
    {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth",
	"BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, TCL_INDEX_NONE,
	offsetof(Entry, selBorderWidth),
	0, DEF_ENTRY_SELECT_BD_MONO, 0},
    {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background",
    {TK_OPTION_COLOR, "-selectcolor", "selectColor", "SelectColor",
	DEF_ENTRY_SELECT_FG_COLOR, TCL_INDEX_NONE, offsetof(Entry, selFgColorPtr),
	TK_OPTION_NULL_OK, DEF_ENTRY_SELECT_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-selectforeground", "selectcolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-selectcolor", 0},
#endif
    {TK_OPTION_STRING, "-show", "show", "Show",
	DEF_ENTRY_SHOW, TCL_INDEX_NONE, offsetof(Entry, showChar),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING_TABLE, "-state", "state", "State",
	DEF_ENTRY_STATE, TCL_INDEX_NONE, offsetof(Entry, state),
	0, stateStrings, 0},
    {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
	DEF_ENTRY_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(Entry, takeFocus),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable",
	DEF_ENTRY_TEXT_VARIABLE, TCL_INDEX_NONE, offsetof(Entry, textVarName),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate",
	DEF_ENTRY_VALIDATE, TCL_INDEX_NONE, offsetof(Entry, validate),
	0, validateStrings, 0},
    {TK_OPTION_STRING, "-validatecommand", "validateCommand","ValidateCommand",
	NULL, TCL_INDEX_NONE, offsetof(Entry, validateCmd), TK_OPTION_NULL_OK, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-vcmd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-validatecommand", 0},
#endif
    {TK_OPTION_INT, "-width", "width", "Width",
	DEF_ENTRY_WIDTH, TCL_INDEX_NONE, offsetof(Entry, prefWidth), 0, 0, 0},
    {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
	DEF_ENTRY_SCROLL_COMMAND, TCL_INDEX_NONE, offsetof(Entry, scrollCmd),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0}
};
187
188
189
190
191
192
193

194
195
196
197

198
199
200
201
202
203
204
205
206
207
208
209


210
211
212
213
214
215
216
217
218
219
220
221


222




223
224
225

226
227



228
229

230
231



232
233
234
235
236
237
238
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247


248
249
250
251
252
253
254
255
256
257
258


259
260
261
262
263
264


265
266
267
268
269
270
271
272
273
274







+




+












+
+










-
-
+
+

+
+
+
+



+
-
-
+
+
+


+
-
-
+
+
+







static const Tk_OptionSpec sbOptSpec[] = {
    {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Background",
	DEF_BUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(Spinbox, activeBorder),
	0, DEF_BUTTON_ACTIVE_BG_MONO, 0},
    {TK_OPTION_BORDER, "-background", "background", "Background",
	DEF_ENTRY_BG_COLOR, TCL_INDEX_NONE, offsetof(Entry, normalBorder),
	0, DEF_ENTRY_BG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
#endif
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	DEF_ENTRY_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Entry, borderWidth), 0, 0, 0},
    {TK_OPTION_BORDER, "-buttonbackground", "buttonBackground", "Background",
	DEF_BUTTON_BG_COLOR, TCL_INDEX_NONE, offsetof(Spinbox, buttonBorder),
	0, DEF_BUTTON_BG_MONO, 0},
    {TK_OPTION_CURSOR, "-buttoncursor", "buttonCursor", "Cursor",
	DEF_BUTTON_CURSOR, TCL_INDEX_NONE, offsetof(Spinbox, bCursor),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_RELIEF, "-buttondownrelief", "buttonDownRelief", "Relief",
	DEF_BUTTON_RELIEF, TCL_INDEX_NONE, offsetof(Spinbox, bdRelief), 0, 0, 0},
    {TK_OPTION_RELIEF, "-buttonuprelief", "buttonUpRelief", "Relief",
	DEF_BUTTON_RELIEF, TCL_INDEX_NONE, offsetof(Spinbox, buRelief), 0, 0, 0},
    {TK_OPTION_COLOR, "-color", "color", "Color",
	DEF_ENTRY_FG, TCL_INDEX_NONE, offsetof(Entry, fgColorPtr), 0, 0, 0},
    {TK_OPTION_STRING, "-command", "command", "Command",
	DEF_SPINBOX_CMD, TCL_INDEX_NONE, offsetof(Spinbox, command),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
	DEF_ENTRY_CURSOR, TCL_INDEX_NONE, offsetof(Entry, cursor),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_BORDER, "-disabledbackground", "disabledBackground",
	"DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, TCL_INDEX_NONE,
	offsetof(Entry, disabledBorder), TK_OPTION_NULL_OK,
	(ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0},
    {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
	"DisabledForeground", DEF_ENTRY_DISABLED_FG, TCL_INDEX_NONE,
    {TK_OPTION_COLOR, "-disabledcolor", "disabledColor",
	"DisabledColor", DEF_ENTRY_DISABLED_FG, TCL_INDEX_NONE,
	offsetof(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-disabledforeground", "disabledcolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-disabledcolor", 0},
#endif
    {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection",
	"ExportSelection", DEF_ENTRY_EXPORT_SELECTION, TCL_INDEX_NONE,
	offsetof(Entry, exportSelection), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0},
    {TK_OPTION_SYNONYM, "-fg", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_FONT, "-font", "font", "Font",
	DEF_ENTRY_FONT, TCL_INDEX_NONE, offsetof(Entry, tkfont), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
	DEF_ENTRY_FG, TCL_INDEX_NONE, offsetof(Entry, fgColorPtr), 0, 0, 0},
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_STRING, "-format", "format", "Format",
	DEF_SPINBOX_FORMAT, TCL_INDEX_NONE, offsetof(Spinbox, reqFormat),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_DOUBLE, "-from", "from", "From",
	DEF_SPINBOX_FROM, TCL_INDEX_NONE, offsetof(Spinbox, fromValue), 0, 0, 0},
    {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground",
	"HighlightBackground", DEF_ENTRY_HIGHLIGHT_BG,
256
257
258
259
260
261
262

263
264

265
266
267
268
269
270
271
272







273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292

293
294




295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313

314
315

316
317
318
319
320
321
322
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333

334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370







+


+





-
-
-
+
+
+
+
+
+
+



















-
+


+
+
+
+



















+


+







    {TK_OPTION_INT, "-insertontime", "insertOnTime", "OnTime",
	DEF_ENTRY_INSERT_ON_TIME, TCL_INDEX_NONE, offsetof(Entry, insertOnTime), 0, 0, 0},
    {TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth",
	DEF_ENTRY_INSERT_WIDTH, TCL_INDEX_NONE, offsetof(Entry, insertWidth), 0, 0, 0},
    {TK_OPTION_STRING, "-invalidcommand", "invalidCommand", "InvalidCommand",
	DEF_ENTRY_INVALIDCMD, TCL_INDEX_NONE, offsetof(Entry, invalidCmd),
	TK_OPTION_NULL_OK, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-invcmd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-invalidcommand", 0},
#endif
    {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
	DEF_ENTRY_JUSTIFY, TCL_INDEX_NONE, offsetof(Entry, justify), 0, 0, 0},
    {TK_OPTION_STRING, "-placeholder", "placeHolder", "PlaceHolder",
	DEF_ENTRY_PLACEHOLDER, TCL_INDEX_NONE, offsetof(Entry, placeholderString),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_COLOR, "-placeholderforeground", "placeholderForeground",
        "PlaceholderForeground", DEF_ENTRY_PLACEHOLDERFG, TCL_INDEX_NONE,
        offsetof(Entry, placeholderColorPtr), 0, 0, 0},
    {TK_OPTION_COLOR, "-placeholdercolor", "placeholderColor",
	"PlaceholderColor", DEF_ENTRY_PLACEHOLDERFG, TCL_INDEX_NONE,
	offsetof(Entry, placeholderColorPtr), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-placeholderforeground", "placeholdercolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-placeholdercolor", 0},
#endif
    {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
	DEF_ENTRY_RELIEF, TCL_INDEX_NONE, offsetof(Entry, relief), 0, 0, 0},
    {TK_OPTION_BORDER, "-readonlybackground", "readonlyBackground",
	"ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, TCL_INDEX_NONE,
	offsetof(Entry, readonlyBorder), TK_OPTION_NULL_OK,
	(ClientData) DEF_ENTRY_READONLY_BG_MONO, 0},
    {TK_OPTION_INT, "-repeatdelay", "repeatDelay", "RepeatDelay",
	DEF_SPINBOX_REPEAT_DELAY, TCL_INDEX_NONE, offsetof(Spinbox, repeatDelay),
	0, 0, 0},
    {TK_OPTION_INT, "-repeatinterval", "repeatInterval", "RepeatInterval",
	DEF_SPINBOX_REPEAT_INTERVAL, TCL_INDEX_NONE, offsetof(Spinbox, repeatInterval),
	0, 0, 0},
    {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground",
	DEF_ENTRY_SELECT_COLOR, TCL_INDEX_NONE, offsetof(Entry, selBorder),
	0, DEF_ENTRY_SELECT_MONO, 0},
    {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth",
	"BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, TCL_INDEX_NONE,
	offsetof(Entry, selBorderWidth),
	0, DEF_ENTRY_SELECT_BD_MONO, 0},
    {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background",
    {TK_OPTION_COLOR, "-selectcolor", "selectColor", "SelectColor",
	DEF_ENTRY_SELECT_FG_COLOR, TCL_INDEX_NONE, offsetof(Entry, selFgColorPtr),
	TK_OPTION_NULL_OK, DEF_ENTRY_SELECT_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-selectforeground", "selectcolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-selectcolor", 0},
#endif
    {TK_OPTION_STRING_TABLE, "-state", "state", "State",
	DEF_ENTRY_STATE, TCL_INDEX_NONE, offsetof(Entry, state),
	0, stateStrings, 0},
    {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
	DEF_ENTRY_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(Entry, takeFocus),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable",
	DEF_ENTRY_TEXT_VARIABLE, TCL_INDEX_NONE, offsetof(Entry, textVarName),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_DOUBLE, "-to", "to", "To",
	DEF_SPINBOX_TO, TCL_INDEX_NONE, offsetof(Spinbox, toValue), 0, 0, 0},
    {TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate",
	DEF_ENTRY_VALIDATE, TCL_INDEX_NONE, offsetof(Entry, validate),
	0, validateStrings, 0},
    {TK_OPTION_STRING, "-validatecommand", "validateCommand","ValidateCommand",
	NULL, TCL_INDEX_NONE, offsetof(Entry, validateCmd), TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-values", "values", "Values",
	DEF_SPINBOX_VALUES, TCL_INDEX_NONE, offsetof(Spinbox, valueStr),
	TK_OPTION_NULL_OK, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-vcmd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-validatecommand", 0},
#endif
    {TK_OPTION_INT, "-width", "width", "Width",
	DEF_ENTRY_WIDTH, TCL_INDEX_NONE, offsetof(Entry, prefWidth), 0, 0, 0},
    {TK_OPTION_BOOLEAN, "-wrap", "wrap", "Wrap",
	DEF_SPINBOX_WRAP, TCL_INDEX_NONE, offsetof(Spinbox, wrap), 0, 0, 0},
    {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
	DEF_ENTRY_SCROLL_COMMAND, TCL_INDEX_NONE, offsetof(Entry, scrollCmd),
	TK_OPTION_NULL_OK, 0, 0},
3318
3319
3320
3321
3322
3323
3324
3325
3326


3327
3328
3329
3330
3331
3332
3333
3366
3367
3368
3369
3370
3371
3372


3373
3374
3375
3376
3377
3378
3379
3380
3381







-
-
+
+







 *
 *	This function is invoked when any character is added or removed from
 *	the entry widget, or a focus has trigerred validation.
 *
 * Results:

 *	TCL_OK if the validatecommand passes the new string. TCL_BREAK if the
 *	vcmd executed OK, but rejects the string. TCL_ERROR if an error
 *	occurred while executing the vcmd or a valid Tcl_Bool is not returned.
 *	validatecommand executed OK, but rejects the string. TCL_ERROR if an error
 *	occurred while executing the validatecommand or a valid Tcl_Bool is not returned.
 *
 * Side effects:
 *	An error condition may arise
 *
 *--------------------------------------------------------------
 */

Changes to generic/tkFrame.c.
182
183
184
185
186
187
188

189
190

191
192
193
194
195
196
197
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199







+


+







 * table used by all and one table for each widget class.
 */

static const Tk_OptionSpec commonOptSpec[] = {
    {TK_OPTION_BORDER, "-background", "background", "Background",
	DEF_FRAME_BG_COLOR, TCL_INDEX_NONE, offsetof(Frame, border),
	TK_OPTION_NULL_OK, DEF_FRAME_BG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
#endif
    {TK_OPTION_STRING, "-colormap", "colormap", "Colormap",
	DEF_FRAME_COLORMAP, TCL_INDEX_NONE, offsetof(Frame, colormapName),
	TK_OPTION_NULL_OK, 0, 0},
    /*
     * Having -container is useless in a labelframe since a container has
     * no border. It should be deprecated.
     */
228
229
230
231
232
233
234

235
236
237
238

239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254

255
256
257
258

259
260
261
262
263
264
265
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271







+




+
















+




+







    {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0}
};

static const Tk_OptionSpec frameOptSpec[] = {
    {TK_OPTION_STRING, "-backgroundimage", "backgroundImage", "BackgroundImage",
	DEF_FRAME_BG_IMAGE, offsetof(Frame, bgimgPtr), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
    {TK_OPTION_SYNONYM, "-bgimg", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-backgroundimage", 0},
#endif
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	DEF_FRAME_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Frame, borderWidth), 0, 0, 0},
    {TK_OPTION_STRING, "-class", "class", "Class",
	DEF_FRAME_CLASS, TCL_INDEX_NONE, offsetof(Frame, className), 0, 0, 0},
    {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
	DEF_FRAME_RELIEF, TCL_INDEX_NONE, offsetof(Frame, relief), 0, 0, 0},
    {TK_OPTION_BOOLEAN, "-tile", "tile", "Tile",
	DEF_FRAME_BG_TILE, TCL_INDEX_NONE, offsetof(Frame, tile), 0, 0, 0},
    {TK_OPTION_END, NULL, NULL, NULL,
	NULL, 0, 0, 0, commonOptSpec, 0}
};

static const Tk_OptionSpec toplevelOptSpec[] = {
    {TK_OPTION_STRING, "-backgroundimage", "backgroundImage", "BackgroundImage",
	DEF_FRAME_BG_IMAGE, offsetof(Frame, bgimgPtr), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
    {TK_OPTION_SYNONYM, "-bgimg", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-backgroundimage", 0},
#endif
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	DEF_FRAME_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Frame, borderWidth), 0, 0, 0},
    {TK_OPTION_STRING, "-class", "class", "Class",
	DEF_TOPLEVEL_CLASS, TCL_INDEX_NONE, offsetof(Frame, className), 0, 0, 0},
    {TK_OPTION_STRING, "-menu", "menu", "Menu",
	DEF_TOPLEVEL_MENU, TCL_INDEX_NONE, offsetof(Frame, menuName),
	TK_OPTION_NULL_OK, 0, 0},
281
282
283
284
285
286
287



288
289



290
291

292
293



294
295
296
297
298
299
300
287
288
289
290
291
292
293
294
295
296


297
298
299
300
301
302


303
304
305
306
307
308
309
310
311
312







+
+
+
-
-
+
+
+


+
-
-
+
+
+







    {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	DEF_LABELFRAME_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Frame, borderWidth),
	0, 0, 0},
    {TK_OPTION_STRING, "-class", "class", "Class",
	DEF_LABELFRAME_CLASS, TCL_INDEX_NONE, offsetof(Frame, className), 0, 0, 0},
    {TK_OPTION_COLOR, "-color", "color", "Color",
	DEF_LABELFRAME_FG, TCL_INDEX_NONE, offsetof(Labelframe, textColorPtr), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0},
    {TK_OPTION_SYNONYM, "-fg", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_FONT, "-font", "font", "Font",
	DEF_LABELFRAME_FONT, TCL_INDEX_NONE, offsetof(Labelframe, tkfont), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
	DEF_LABELFRAME_FG, TCL_INDEX_NONE, offsetof(Labelframe, textColorPtr), 0, 0, 0},
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_STRING_TABLE, "-labelanchor", "labelAnchor", "LabelAnchor",
	DEF_LABELFRAME_LABELANCHOR, TCL_INDEX_NONE, offsetof(Labelframe, labelAnchor),
	0, labelAnchorStrings, 0},
    {TK_OPTION_WINDOW, "-labelwidget", "labelWidget", "LabelWidget",
	NULL, TCL_INDEX_NONE, offsetof(Labelframe, labelWin), TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
	DEF_LABELFRAME_RELIEF, TCL_INDEX_NONE, offsetof(Frame, relief), 0, 0, 0},
824
825
826
827
828
829
830
831

832
833
834
835
836
837
838
836
837
838
839
840
841
842

843
844
845
846
847
848
849
850







-
+








		if (length < 2) {
		    continue;
		}
		c = arg[1];
		if (((c == 'c') && (length >= 2)
			&& (strncmp(arg, "-class", length) == 0))
		    || ((c == 'c') && (length >= 3)
		    || ((c == 'c') && (length >= 7)
			&& (strncmp(arg, "-colormap", length) == 0))
		    || ((c == 'c') && (length >= 3)
			&& (strncmp(arg, "-container", length) == 0))
		    || ((c == 's') && (framePtr->type == TYPE_TOPLEVEL)
			&& (strncmp(arg, "-screen", length) == 0))
		    || ((c == 'u') && (framePtr->type == TYPE_TOPLEVEL)
			&& (strncmp(arg, "-use", length) == 0))
Changes to generic/tkImgBmap.c.
103
104
105
106
107
108
109
110

111


112
113
114
115

116

117

118
119
120
121
122
123
124
103
104
105
106
107
108
109

110
111
112
113
114
115
116
117
118

119

120
121
122
123
124
125
126
127







-
+

+
+




+
-
+
-
+







};

/*
 * Information used for parsing configuration specs:
 */

static const Tk_ConfigSpec configSpecs[] = {
    {TK_CONFIG_UID, "-background", NULL, NULL,
    {TK_CONFIG_UID, "-background", "background", "Background",
	"", offsetof(BitmapModel, bgUid), 0, NULL},
    {TK_CONFIG_UID, "-color", "color", "Color",
	"#000000", offsetof(BitmapModel, fgUid), 0, NULL},
    {TK_CONFIG_STRING, "-data", NULL, NULL,
	NULL, offsetof(BitmapModel, dataString), TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_STRING, "-file", NULL, NULL,
	NULL, offsetof(BitmapModel, fileString), TK_CONFIG_NULL_OK, NULL},
#ifndef TK_NO_DEPRECATED
    {TK_CONFIG_UID, "-foreground", NULL, NULL,
    {TK_CONFIG_SYNONYM, "-foreground", "color", NULL, NULL, 0, 0, NULL},
	"#000000", offsetof(BitmapModel, fgUid), 0, NULL},
#endif
    {TK_CONFIG_STRING, "-maskdata", NULL, NULL,
	NULL, offsetof(BitmapModel, maskDataString), TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_STRING, "-maskfile", NULL, NULL,
	NULL, offsetof(BitmapModel, maskFileString), TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};

Changes to generic/tkListbox.c.
238
239
240
241
242
243
244
245
246



247
248

249
250


251
252
253




254
255
256
257
258
259









260
261
262
263
264






265
266
267
268





269
270

271
272
273


274
275
276


277
278
279


280
281
282
283
284
285
286




287
288

289
290
291
292







293
294
295


296
297

298
299
300
301
302
303


304
305
306
307
308
309
310
311
312
313
314










315
316
317
318
319
320
321
322
323
324
325
326
327




328
329
330
331
332
333










334
335
336
337
338
339
340
341
342















343
344
345
346
347
348
349
238
239
240
241
242
243
244


245
246
247
248

249
250

251
252
253


254
255
256
257
258





259
260
261
262
263
264
265
266
267
268




269
270
271
272
273
274
275



276
277
278
279
280
281

282
283


284
285
286


287
288
289


290
291
292
293
294




295
296
297
298
299

300
301



302
303
304
305
306
307
308
309


310
311
312

313
314
315
316
317


318
319
320










321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340



341
342
343
344
345





346
347
348
349
350
351
352
353
354
355









356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377







-
-
+
+
+

-
+

-
+
+

-
-
+
+
+
+

-
-
-
-
-
+
+
+
+
+
+
+
+
+

-
-
-
-
+
+
+
+
+
+

-
-
-
+
+
+
+
+

-
+

-
-
+
+

-
-
+
+

-
-
+
+



-
-
-
-
+
+
+
+

-
+

-
-
-
+
+
+
+
+
+
+

-
-
+
+

-
+




-
-
+
+

-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+










-
-
-
+
+
+
+

-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







 */

static const Tk_OptionSpec optionSpecs[] = {
    {TK_OPTION_STRING_TABLE, "-activestyle", "activeStyle", "ActiveStyle",
	DEF_LISTBOX_ACTIVE_STYLE, TCL_INDEX_NONE, offsetof(Listbox, activeStyle),
	0, activeStyleStrings, 0},
    {TK_OPTION_BORDER, "-background", "background", "Background",
	 DEF_LISTBOX_BG_COLOR, TCL_INDEX_NONE, offsetof(Listbox, normalBorder),
	 0, DEF_LISTBOX_BG_MONO, 0},
	DEF_LISTBOX_BG_COLOR, TCL_INDEX_NONE, offsetof(Listbox, normalBorder),
	0, DEF_LISTBOX_BG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
	 NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
	NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
	 NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
	NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
#endif
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	 DEF_LISTBOX_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Listbox, borderWidth),
	 0, 0, 0},
	DEF_LISTBOX_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Listbox, borderWidth),
	0, 0, 0},
    {TK_OPTION_COLOR, "-color", "color", "Color",
	DEF_LISTBOX_FG, TCL_INDEX_NONE, offsetof(Listbox, fgColorPtr), 0, 0, 0},
    {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
	 DEF_LISTBOX_CURSOR, TCL_INDEX_NONE, offsetof(Listbox, cursor),
	 TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
	 "DisabledForeground", DEF_LISTBOX_DISABLED_FG, TCL_INDEX_NONE,
	 offsetof(Listbox, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0},
	DEF_LISTBOX_CURSOR, TCL_INDEX_NONE, offsetof(Listbox, cursor),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_COLOR, "-disabledcolor", "disabledColor",
	"DisabledColor", DEF_LISTBOX_DISABLED_FG, TCL_INDEX_NONE,
	offsetof(Listbox, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-disabledforeground", "disabledcolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-disabledcolor", 0},
#endif
    {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection",
	 "ExportSelection", DEF_LISTBOX_EXPORT_SELECTION, TCL_INDEX_NONE,
	 offsetof(Listbox, exportSelection), 0, 0, 0},
    {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
	 NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0},
	"ExportSelection", DEF_LISTBOX_EXPORT_SELECTION, TCL_INDEX_NONE,
	offsetof(Listbox, exportSelection), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-fg", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_FONT, "-font", "font", "Font",
	 DEF_LISTBOX_FONT, TCL_INDEX_NONE, offsetof(Listbox, tkfont), 0, 0, 0},
    {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
	 DEF_LISTBOX_FG, TCL_INDEX_NONE, offsetof(Listbox, fgColorPtr), 0, 0, 0},
	DEF_LISTBOX_FONT, TCL_INDEX_NONE, offsetof(Listbox, tkfont), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_INT, "-height", "height", "Height",
	 DEF_LISTBOX_HEIGHT, TCL_INDEX_NONE, offsetof(Listbox, height), 0, 0, 0},
	DEF_LISTBOX_HEIGHT, TCL_INDEX_NONE, offsetof(Listbox, height), 0, 0, 0},
    {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground",
	 "HighlightBackground", DEF_LISTBOX_HIGHLIGHT_BG, TCL_INDEX_NONE,
	 offsetof(Listbox, highlightBgColorPtr), 0, 0, 0},
	"HighlightBackground", DEF_LISTBOX_HIGHLIGHT_BG, TCL_INDEX_NONE,
	offsetof(Listbox, highlightBgColorPtr), 0, 0, 0},
    {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
	 DEF_LISTBOX_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Listbox, highlightColorPtr),
	 0, 0, 0},
	DEF_LISTBOX_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Listbox, highlightColorPtr),
	0, 0, 0},
    {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
	 "HighlightThickness", DEF_LISTBOX_HIGHLIGHT_WIDTH, TCL_INDEX_NONE,
	 offsetof(Listbox, highlightWidth), 0, 0, 0},
	"HighlightThickness", DEF_LISTBOX_HIGHLIGHT_WIDTH, TCL_INDEX_NONE,
	offsetof(Listbox, highlightWidth), 0, 0, 0},
    {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
	DEF_LISTBOX_JUSTIFY, TCL_INDEX_NONE, offsetof(Listbox, justify), 0, 0, 0},
    {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
	 DEF_LISTBOX_RELIEF, TCL_INDEX_NONE, offsetof(Listbox, relief), 0, 0, 0},
    {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground",
	 DEF_LISTBOX_SELECT_COLOR, TCL_INDEX_NONE, offsetof(Listbox, selBorder),
	 0, DEF_LISTBOX_SELECT_MONO, 0},
	DEF_LISTBOX_RELIEF, TCL_INDEX_NONE, offsetof(Listbox, relief), 0, 0, 0},
    {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "SelectBackground",
	DEF_LISTBOX_SELECT_COLOR, TCL_INDEX_NONE, offsetof(Listbox, selBorder),
	0, DEF_LISTBOX_SELECT_MONO, 0},
    {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth",
	 "BorderWidth", DEF_LISTBOX_SELECT_BD, TCL_INDEX_NONE,
	"SelectBorderWidth", DEF_LISTBOX_SELECT_BD, TCL_INDEX_NONE,
	 offsetof(Listbox, selBorderWidth), 0, 0, 0},
    {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background",
	 DEF_LISTBOX_SELECT_FG_COLOR, TCL_INDEX_NONE, offsetof(Listbox, selFgColorPtr),
	 TK_OPTION_NULL_OK, DEF_LISTBOX_SELECT_FG_MONO, 0},
    {TK_OPTION_COLOR, "-selectcolor", "selectColor", "SelectColor",
	DEF_LISTBOX_SELECT_FG_COLOR, TCL_INDEX_NONE, offsetof(Listbox, selFgColorPtr),
	TK_OPTION_NULL_OK, DEF_LISTBOX_SELECT_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-selectforeground", "selectcolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-selectcolor", 0},
#endif
    {TK_OPTION_STRING, "-selectmode", "selectMode", "SelectMode",
	 DEF_LISTBOX_SELECT_MODE, TCL_INDEX_NONE, offsetof(Listbox, selectMode),
	 TK_OPTION_NULL_OK, 0, 0},
	DEF_LISTBOX_SELECT_MODE, TCL_INDEX_NONE, offsetof(Listbox, selectMode),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_BOOLEAN, "-setgrid", "setGrid", "SetGrid",
	 DEF_LISTBOX_SET_GRID, TCL_INDEX_NONE, offsetof(Listbox, setGrid), 0, 0, 0},
	DEF_LISTBOX_SET_GRID, TCL_INDEX_NONE, offsetof(Listbox, setGrid), 0, 0, 0},
    {TK_OPTION_STRING_TABLE, "-state", "state", "State",
	DEF_LISTBOX_STATE, TCL_INDEX_NONE, offsetof(Listbox, state),
	0, stateStrings, 0},
    {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
	 DEF_LISTBOX_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(Listbox, takeFocus),
	 TK_OPTION_NULL_OK, 0, 0},
	DEF_LISTBOX_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(Listbox, takeFocus),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_INT, "-width", "width", "Width",
	 DEF_LISTBOX_WIDTH, TCL_INDEX_NONE, offsetof(Listbox, width), 0, 0, 0},
    {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
	 DEF_LISTBOX_SCROLL_COMMAND, TCL_INDEX_NONE, offsetof(Listbox, xScrollCmd),
	 TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand",
	 DEF_LISTBOX_SCROLL_COMMAND, TCL_INDEX_NONE, offsetof(Listbox, yScrollCmd),
	 TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-listvariable", "listVariable", "Variable",
	 DEF_LISTBOX_LIST_VARIABLE, TCL_INDEX_NONE, offsetof(Listbox, listVarName),
	 TK_OPTION_NULL_OK, 0, 0},
	DEF_LISTBOX_WIDTH, TCL_INDEX_NONE, offsetof(Listbox, width), 0, 0, 0},
    {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "XScrollCommand",
	DEF_LISTBOX_SCROLL_COMMAND, TCL_INDEX_NONE, offsetof(Listbox, xScrollCmd),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-yscrollcommand", "yScrollCommand", "YScrollCommand",
	DEF_LISTBOX_SCROLL_COMMAND, TCL_INDEX_NONE, offsetof(Listbox, yScrollCmd),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-listvariable", "listVariable", "ListVariable",
	DEF_LISTBOX_LIST_VARIABLE, TCL_INDEX_NONE, offsetof(Listbox, listVarName),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0}
};

/*
 * The itemAttrOptionSpecs table defines the valid configuration options for
 * listbox items.
 */

static const Tk_OptionSpec itemAttrOptionSpecs[] = {
    {TK_OPTION_BORDER, "-background", "background", "Background",
     NULL, TCL_INDEX_NONE, offsetof(ItemAttr, border),
     TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT,
     DEF_LISTBOX_BG_MONO, 0},
	NULL, TCL_INDEX_NONE, offsetof(ItemAttr, border),
	TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT,
	DEF_LISTBOX_BG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
     NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
    {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
     NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0},
    {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
     NULL, TCL_INDEX_NONE, offsetof(ItemAttr, fgColor),
	NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
#endif
    {TK_OPTION_COLOR, "-color", "color", "Color",
	NULL, TCL_INDEX_NONE, offsetof(ItemAttr, fgColor),
	TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-fg", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
     TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0},
    {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground",
     NULL, TCL_INDEX_NONE, offsetof(ItemAttr, selBorder),
     TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT,
     DEF_LISTBOX_SELECT_MONO, 0},
    {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background",
     NULL, TCL_INDEX_NONE, offsetof(ItemAttr, selFgColor),
     TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT,
     DEF_LISTBOX_SELECT_FG_MONO, 0},
#endif
    {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "SelectBackground",
	NULL, TCL_INDEX_NONE, offsetof(ItemAttr, selBorder),
	TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT,
	DEF_LISTBOX_SELECT_MONO, 0},
    {TK_OPTION_COLOR, "-selectcolor", "selectColor", "SelectColor",
	NULL, TCL_INDEX_NONE, offsetof(ItemAttr, selFgColor),
	TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT,
	DEF_LISTBOX_SELECT_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-selectfg", "selectcolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-selectcolor", 0},
    {TK_OPTION_SYNONYM, "-selectforeground", "selectcolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-selectcolor", 0},
#endif
    {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0}
};

/*
 * The following tables define the listbox widget commands (and sub-commands)
 * and map the indexes into the string tables into enumerated types used to
 * dispatch the listbox widget command.
Changes to generic/tkMenu.c.
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128










129

130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147

148
149




150
151
152
153
154
155
156
113
114
115
116
117
118
119






120
121
122
123
124
125
126
127
128
129
130
131
132

133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150

151
152
153
154
155
156
157
158
159
160
161
162
163
164







-
-
-
-
-
-



+
+
+
+
+
+
+
+
+
+
-
+

















-
+


+
+
+
+







 */

static const char *const compoundStrings[] = {
    "bottom", "center", "left", "none", "right", "top", NULL
};

static const Tk_OptionSpec tkBasicMenuEntryConfigSpecs[] = {
    {TK_OPTION_BORDER, "-activebackground", NULL, NULL,
	DEF_MENU_ENTRY_ACTIVE_BG, offsetof(TkMenuEntry, activeBorderPtr), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK, NULL, 0},
    {TK_OPTION_COLOR, "-activeforeground", NULL, NULL,
	DEF_MENU_ENTRY_ACTIVE_FG,
	offsetof(TkMenuEntry, activeFgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
    {TK_OPTION_STRING, "-accelerator", NULL, NULL,
	DEF_MENU_ENTRY_ACCELERATOR,
	offsetof(TkMenuEntry, accelPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
    {TK_OPTION_BORDER, "-activebackground", "activeBackground", "ActiveBackground",
	DEF_MENU_ENTRY_ACTIVE_BG, offsetof(TkMenuEntry, activeBorderPtr), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK, NULL, 0},
    {TK_OPTION_COLOR, "-activecolor", "activeColor", "ActiveColor",
	DEF_MENU_ENTRY_ACTIVE_FG,
	offsetof(TkMenuEntry, activeFgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-activeforeground", NULL , NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-activecolor", 0},
#endif
    {TK_OPTION_BORDER, "-background", NULL, NULL,
    {TK_OPTION_BORDER, "-background", "background", "Background",
	DEF_MENU_ENTRY_BG,
	offsetof(TkMenuEntry, borderPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
    {TK_OPTION_BITMAP, "-bitmap", NULL, NULL,
	DEF_MENU_ENTRY_BITMAP,
	offsetof(TkMenuEntry, bitmapPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
    {TK_OPTION_BOOLEAN, "-columnbreak", NULL, NULL,
	DEF_MENU_ENTRY_COLUMN_BREAK,
	TCL_INDEX_NONE, offsetof(TkMenuEntry, columnBreak), 0, NULL, 0},
    {TK_OPTION_STRING, "-command", NULL, NULL,
	DEF_MENU_ENTRY_COMMAND,
	offsetof(TkMenuEntry, commandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
    {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
	DEF_MENU_ENTRY_COMPOUND, TCL_INDEX_NONE, offsetof(TkMenuEntry, compound), 0,
	(ClientData) compoundStrings, 0},
    {TK_OPTION_FONT, "-font", NULL, NULL,
	DEF_MENU_ENTRY_FONT,
	offsetof(TkMenuEntry, fontPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
    {TK_OPTION_COLOR, "-foreground", NULL, NULL,
    {TK_OPTION_COLOR, "-color", "color", "Color",
	DEF_MENU_ENTRY_FG,
	offsetof(TkMenuEntry, fgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-foreground", "color" , NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_BOOLEAN, "-hidemargin", NULL, NULL,
	DEF_MENU_ENTRY_HIDE_MARGIN,
	TCL_INDEX_NONE, offsetof(TkMenuEntry, hideMargin), 0, NULL, 0},
    {TK_OPTION_STRING, "-image", NULL, NULL,
	DEF_MENU_ENTRY_IMAGE,
	offsetof(TkMenuEntry, imagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
    {TK_OPTION_STRING, "-label", NULL, NULL,
245
246
247
248
249
250
251
252

253
254
255
256

257
258
259


260
261




262
263
264
265
266
267

268
269
270
271

272
273
274


275
276
277
278
279


280
281



282
283



284
285

286
287



288
289
290
291
292
293
294
253
254
255
256
257
258
259

260
261
262
263

264
265


266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293


294
295
296
297
298
299
300


301
302
303
304
305
306


307
308
309
310
311
312
313
314
315
316







-
+



-
+

-
-
+
+


+
+
+
+






+




+



+
+



-
-
+
+


+
+
+
-
-
+
+
+


+
-
-
+
+
+








static const char *const menuTypeStrings[] = {
    "normal", "tearoff", "menubar", NULL
};

static const Tk_OptionSpec tkMenuConfigSpecs[] = {
    {TK_OPTION_BORDER, "-activebackground", "activeBackground",
	"Foreground", DEF_MENU_ACTIVE_BG_COLOR,
	"ActiveBackground", DEF_MENU_ACTIVE_BG_COLOR,
	offsetof(TkMenu, activeBorderPtr), TCL_INDEX_NONE, 0,
	(ClientData) DEF_MENU_ACTIVE_BG_MONO, 0},
    {TK_OPTION_PIXELS, "-activeborderwidth", "activeBorderWidth",
	"BorderWidth", DEF_MENU_ACTIVE_BORDER_WIDTH,
	"ActiveBorderWidth", DEF_MENU_ACTIVE_BORDER_WIDTH,
	offsetof(TkMenu, activeBorderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0},
    {TK_OPTION_COLOR, "-activeforeground", "activeForeground",
	"Background", DEF_MENU_ACTIVE_FG_COLOR,
    {TK_OPTION_COLOR, "-activecolor", "activeColor",
	"ActiveColor", DEF_MENU_ACTIVE_FG_COLOR,
	offsetof(TkMenu, activeFgPtr), TCL_INDEX_NONE, 0,
	(ClientData) DEF_MENU_ACTIVE_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-activeforeground", NULL , NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-activecolor", 0},
#endif
    {TK_OPTION_RELIEF, "-activerelief", "activeRelief", "Relief",
	DEF_MENU_ACTIVE_RELIEF, offsetof(TkMenu, activeReliefPtr),
	TCL_INDEX_NONE, 0, NULL, 0},
    {TK_OPTION_BORDER, "-background", "background", "Background",
	DEF_MENU_BG_COLOR, offsetof(TkMenu, borderPtr), TCL_INDEX_NONE, 0,
	(ClientData) DEF_MENU_BG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
#endif
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	DEF_MENU_BORDER_WIDTH,
	offsetof(TkMenu, borderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0},
    {TK_OPTION_COLOR, "-color", "color", "Color",
	DEF_MENU_FG, offsetof(TkMenu, fgPtr), TCL_INDEX_NONE, 0, NULL, 0},
    {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
	DEF_MENU_CURSOR,
	offsetof(TkMenu, cursorPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
    {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
	"DisabledForeground", DEF_MENU_DISABLED_FG_COLOR,
    {TK_OPTION_COLOR, "-disabledcolor", "disabledColor",
	"DisabledColor", DEF_MENU_DISABLED_FG_COLOR,
	offsetof(TkMenu, disabledFgPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK,
	(ClientData) DEF_MENU_DISABLED_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-disabledforeground", NULL , NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-disabledcolor", 0},
    {TK_OPTION_SYNONYM, "-fg", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0},
    {TK_OPTION_SYNONYM, "-fg", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_FONT, "-font", "font", "Font",
	DEF_MENU_FONT, offsetof(TkMenu, fontPtr), TCL_INDEX_NONE, 0, NULL, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
	DEF_MENU_FG, offsetof(TkMenu, fgPtr), TCL_INDEX_NONE, 0, NULL, 0},
    {TK_OPTION_SYNONYM, "-foreground", "color" , NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_STRING, "-postcommand", "postCommand", "Command",
	DEF_MENU_POST_COMMAND,
	offsetof(TkMenu, postCommandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
    {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
	DEF_MENU_RELIEF, offsetof(TkMenu, reliefPtr), TCL_INDEX_NONE, 0, NULL, 0},
    {TK_OPTION_COLOR, "-selectcolor", "selectColor", "Background",
	DEF_MENU_SELECT_COLOR, offsetof(TkMenu, indicatorFgPtr), TCL_INDEX_NONE, 0,
Changes to generic/tkMenubutton.c.
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
94



95
96



97
98

99
100



101
102
103
104
105
106
107
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
94
95
96
97
98


99
100
101
102
103
104
105


106
107
108
109
110
111


112
113
114
115
116
117
118
119
120
121







-
+



-
+



+
+
+
+






+




+






+
+






-
-
+
+


+
+
+
-
-
+
+
+


+
-
-
+
+
+







};

/*
 * Information used for parsing configuration specs:
 */

static const Tk_OptionSpec optionSpecs[] = {
    {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground",
    {TK_OPTION_BORDER, "-activebackground", "activeBackground", "ActiveBackground",
	DEF_MENUBUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE,
	offsetof(TkMenuButton, activeBorder), 0,
	(ClientData) DEF_MENUBUTTON_ACTIVE_BG_MONO, 0},
    {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background",
    {TK_OPTION_COLOR, "-activecolor", "activeColor", "ActiveColor",
	DEF_MENUBUTTON_ACTIVE_FG_COLOR, TCL_INDEX_NONE,
	 offsetof(TkMenuButton, activeFg),
	 0, DEF_MENUBUTTON_ACTIVE_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-activeforeground", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0,
	(ClientData) "-activecolor", 0},
#endif
    {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor",
	DEF_MENUBUTTON_ANCHOR, TCL_INDEX_NONE,
	offsetof(TkMenuButton, anchor), 0, 0, 0},
    {TK_OPTION_BORDER, "-background", "background", "Background",
	DEF_MENUBUTTON_BG_COLOR, TCL_INDEX_NONE, offsetof(TkMenuButton, normalBorder),
	0, DEF_MENUBUTTON_BG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0,
	(ClientData) "-borderwidth", 0},
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0,
	(ClientData) "-background", 0},
#endif
    {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap",
	DEF_MENUBUTTON_BITMAP, TCL_INDEX_NONE, offsetof(TkMenuButton, bitmap),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	DEF_MENUBUTTON_BORDER_WIDTH, TCL_INDEX_NONE,
	offsetof(TkMenuButton, borderWidth), 0, 0, 0},
    {TK_OPTION_COLOR, "-color", "color", "Color",
	DEF_MENUBUTTON_FG, TCL_INDEX_NONE, offsetof(TkMenuButton, normalFg), 0, 0, 0},
    {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
	DEF_MENUBUTTON_CURSOR, TCL_INDEX_NONE, offsetof(TkMenuButton, cursor),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING_TABLE, "-direction", "direction", "Direction",
	DEF_MENUBUTTON_DIRECTION, TCL_INDEX_NONE, offsetof(TkMenuButton, direction),
	0, directionStrings, 0},
    {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
	"DisabledForeground", DEF_MENUBUTTON_DISABLED_FG_COLOR,
    {TK_OPTION_COLOR, "-disabledcolor", "disabledColor",
	"DisabledColor", DEF_MENUBUTTON_DISABLED_FG_COLOR,
	TCL_INDEX_NONE, offsetof(TkMenuButton, disabledFg), TK_OPTION_NULL_OK,
	(ClientData) DEF_MENUBUTTON_DISABLED_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-disabledforeground", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0,
	(ClientData) "-disabledcolor", 0},
    {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, TCL_INDEX_NONE, 0,
	(ClientData) "-foreground", 0},
    {TK_OPTION_SYNONYM, "-fg", "color", NULL, NULL, 0, TCL_INDEX_NONE, 0,
	(ClientData) "-color", 0},
#endif
    {TK_OPTION_FONT, "-font", "font", "Font",
	DEF_MENUBUTTON_FONT, TCL_INDEX_NONE, offsetof(TkMenuButton, tkfont), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
	DEF_MENUBUTTON_FG, TCL_INDEX_NONE, offsetof(TkMenuButton, normalFg), 0, 0, 0},
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL, NULL, 0, TCL_INDEX_NONE, 0,
	(ClientData) "-color", 0},
#endif
    {TK_OPTION_STRING, "-height", "height", "Height",
	DEF_MENUBUTTON_HEIGHT, TCL_INDEX_NONE, offsetof(TkMenuButton, heightString),
	0, 0, 0},
    {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground",
	"HighlightBackground", DEF_MENUBUTTON_HIGHLIGHT_BG_COLOR,
	TCL_INDEX_NONE, offsetof(TkMenuButton, highlightBgColorPtr), 0, 0, 0},
    {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
117
118
119
120
121
122
123
124

125
126
127

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144

145
146
147
148
149
150
151
131
132
133
134
135
136
137

138
139
140

141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157

158
159
160
161
162
163
164
165







-
+


-
+
















-
+







	DEF_MENUBUTTON_INDICATOR, TCL_INDEX_NONE, offsetof(TkMenuButton, indicatorOn),
	0, 0, 0},
    {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
	DEF_MENUBUTTON_JUSTIFY, TCL_INDEX_NONE, offsetof(TkMenuButton, justify), 0, 0, 0},
    {TK_OPTION_STRING, "-menu", "menu", "Menu",
	DEF_MENUBUTTON_MENU, TCL_INDEX_NONE, offsetof(TkMenuButton, menuName),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_PIXELS, "-padx", "padX", "Pad",
    {TK_OPTION_PIXELS, "-padx", "padX", "PadX",
	DEF_MENUBUTTON_PADX, TCL_INDEX_NONE, offsetof(TkMenuButton, padX),
	0, 0, 0},
    {TK_OPTION_PIXELS, "-pady", "padY", "Pad",
    {TK_OPTION_PIXELS, "-pady", "padY", "PadY",
	DEF_MENUBUTTON_PADY, TCL_INDEX_NONE, offsetof(TkMenuButton, padY),
	0, 0, 0},
    {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
	DEF_MENUBUTTON_RELIEF, TCL_INDEX_NONE, offsetof(TkMenuButton, relief),
	0, 0, 0},
    {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
	 DEF_BUTTON_COMPOUND, TCL_INDEX_NONE, offsetof(TkMenuButton, compound), 0,
	 compoundStrings, 0},
    {TK_OPTION_STRING_TABLE, "-state", "state", "State",
	DEF_MENUBUTTON_STATE, TCL_INDEX_NONE, offsetof(TkMenuButton, state),
	0, stateStrings, 0},
    {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
	DEF_MENUBUTTON_TAKE_FOCUS, TCL_INDEX_NONE,
	offsetof(TkMenuButton, takeFocus), TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-text", "text", "Text",
	DEF_MENUBUTTON_TEXT, TCL_INDEX_NONE, offsetof(TkMenuButton, text), 0, 0, 0},
    {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable",
    {TK_OPTION_STRING, "-textvariable", "textVariable", "TextVariable",
	DEF_MENUBUTTON_TEXT_VARIABLE, TCL_INDEX_NONE,
	offsetof(TkMenuButton, textVarName), TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_INT, "-underline", "underline", "Underline",
	DEF_MENUBUTTON_UNDERLINE, TCL_INDEX_NONE, offsetof(TkMenuButton, underline),
	 0, 0, 0},
    {TK_OPTION_STRING, "-width", "width", "Width",
	DEF_MENUBUTTON_WIDTH, TCL_INDEX_NONE, offsetof(TkMenuButton, widthString),
Changes to generic/tkMessage.c.
105
106
107
108
109
110
111
112

113
114

115
116
117



118
119

120
121


122
123
124




125
126
127
128
129






130
131

132
133



134
135
136


137
138
139


140
141
142
143
144
145
146
147


148
149
150


151
152
153
154
155
156
157
105
106
107
108
109
110
111

112
113

114
115


116
117
118
119

120
121

122
123
124


125
126
127
128
129




130
131
132
133
134
135
136
137
138


139
140
141
142


143
144
145


146
147
148
149
150
151
152
153


154
155
156


157
158
159
160
161
162
163
164
165







-
+

-
+

-
-
+
+
+

-
+

-
+
+

-
-
+
+
+
+

-
-
-
-
+
+
+
+
+
+


+
-
-
+
+
+

-
-
+
+

-
-
+
+






-
-
+
+

-
-
+
+








/*
 * Information used for argv parsing.
 */

static const Tk_OptionSpec optionSpecs[] = {
    {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MESSAGE_ANCHOR,
	 TCL_INDEX_NONE, offsetof(Message, anchor), 0, 0, 0},
	TCL_INDEX_NONE, offsetof(Message, anchor), 0, 0, 0},
    {TK_OPTION_INT, "-aspect", "aspect", "Aspect", DEF_MESSAGE_ASPECT,
	 TCL_INDEX_NONE, offsetof(Message, aspect), 0, 0, 0},
	TCL_INDEX_NONE, offsetof(Message, aspect), 0, 0, 0},
    {TK_OPTION_BORDER, "-background", "background", "Background",
	 DEF_MESSAGE_BG_COLOR, TCL_INDEX_NONE, offsetof(Message, border), 0,
	 DEF_MESSAGE_BG_MONO, 0},
	DEF_MESSAGE_BG_COLOR, TCL_INDEX_NONE, offsetof(Message, border), 0,
	DEF_MESSAGE_BG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL,
	 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
	0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL,
	 0, TCL_INDEX_NONE, 0, "-background", 0},
	0, TCL_INDEX_NONE, 0, "-background", 0},
#endif
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	 DEF_MESSAGE_BORDER_WIDTH, TCL_INDEX_NONE,
	 offsetof(Message, borderWidth), 0, 0, 0},
	DEF_MESSAGE_BORDER_WIDTH, TCL_INDEX_NONE,
	offsetof(Message, borderWidth), 0, 0, 0},
    {TK_OPTION_COLOR, "-color", "color", "Color",
	DEF_MESSAGE_FG, TCL_INDEX_NONE, offsetof(Message, fgColorPtr), 0, 0, 0},
    {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
	 DEF_MESSAGE_CURSOR, TCL_INDEX_NONE, offsetof(Message, cursor),
	 TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL,
	 0, TCL_INDEX_NONE, 0, "-foreground", 0},
	DEF_MESSAGE_CURSOR, TCL_INDEX_NONE, offsetof(Message, cursor),
	TK_OPTION_NULL_OK, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-fg", "color", NULL, NULL,
	0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_FONT, "-font", "font", "Font",
	DEF_MESSAGE_FONT, TCL_INDEX_NONE, offsetof(Message, tkfont), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
	DEF_MESSAGE_FG, TCL_INDEX_NONE, offsetof(Message, fgColorPtr), 0, 0, 0},
    {TK_OPTION_SYNONYM, "-foreground", "color" , NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground",
	 "HighlightBackground", DEF_MESSAGE_HIGHLIGHT_BG, TCL_INDEX_NONE,
	 offsetof(Message, highlightBgColorPtr), 0, 0, 0},
	"HighlightBackground", DEF_MESSAGE_HIGHLIGHT_BG, TCL_INDEX_NONE,
	offsetof(Message, highlightBgColorPtr), 0, 0, 0},
    {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
	 DEF_MESSAGE_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Message, highlightColorPtr),
	 0, 0, 0},
	DEF_MESSAGE_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Message, highlightColorPtr),
	0, 0, 0},
    {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
	"HighlightThickness", DEF_MESSAGE_HIGHLIGHT_WIDTH, TCL_INDEX_NONE,
	 offsetof(Message, highlightWidth), 0, 0, 0},
    {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
	DEF_MESSAGE_JUSTIFY, TCL_INDEX_NONE, offsetof(Message, justify), 0, 0, 0},
    {TK_OPTION_PIXELS, "-padx", "padX", "Pad",
	 DEF_MESSAGE_PADX, offsetof(Message, padXPtr),
	 offsetof(Message, padX), 0, 0, 0},
	DEF_MESSAGE_PADX, offsetof(Message, padXPtr),
	offsetof(Message, padX), 0, 0, 0},
    {TK_OPTION_PIXELS, "-pady", "padY", "Pad",
	 DEF_MESSAGE_PADY, offsetof(Message, padYPtr),
	 offsetof(Message, padY), 0, 0, 0},
	DEF_MESSAGE_PADY, offsetof(Message, padYPtr),
	offsetof(Message, padY), 0, 0, 0},
    {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
	DEF_MESSAGE_RELIEF, TCL_INDEX_NONE, offsetof(Message, relief), 0, 0, 0},
    {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
	DEF_MESSAGE_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(Message, takeFocus),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-text", "text", "Text",
	DEF_MESSAGE_TEXT, TCL_INDEX_NONE, offsetof(Message, string), 0, 0, 0},
Changes to generic/tkOption.c.
435
436
437
438
439
440
441
442

443
444
445
446
447
448
449
435
436
437
438
439
440
441

442
443
444
445
446
447
448
449







-
+







     * it; this button ought to pick up the *Button.background, etc., options.
     * But because the class of the widget is Combobox, our normal search
     * won't get that option.
     *
     * To work around this, the option name field syntax was extended to allow
     * for a "." in the name; if this character occurs in the name, then it
     * indicates that this name contains a new window class and an option
     * name, ie, "Button.foreground". If we see this form in the name field,
     * name, ie, "Button.color". If we see this form in the name field,
     * we query the option database directly (since the option stacks will not
     * have the information we need).
     */

    masqName = strchr(name, (int)'.');
    if (masqName != NULL) {
	/*
Changes to generic/tkPanedWindow.c.
273
274
275
276
277
278
279

280
281
282
283

284
285
286
287
288
289
290
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292







+




+







    0
};

static const Tk_OptionSpec optionSpecs[] = {
    {TK_OPTION_BORDER, "-background", "background", "Background",
	 DEF_PANEDWINDOW_BG_COLOR, TCL_INDEX_NONE, offsetof(PanedWindow, background), 0,
	 DEF_PANEDWINDOW_BG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
	 NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
	 NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
#endif
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	 DEF_PANEDWINDOW_BORDERWIDTH, TCL_INDEX_NONE, offsetof(PanedWindow, borderWidth),
	 0, 0, GEOMETRY},
    {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
	 DEF_PANEDWINDOW_CURSOR, TCL_INDEX_NONE, offsetof(PanedWindow, cursor),
	 TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_PIXELS, "-handlepad", "handlePad", "HandlePad",
Changes to generic/tkScale.c.
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
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







+




+



+
+
+









+
-
-
+
+
+


+
-
-
-
+
+
+







	0, DEF_SCALE_ACTIVE_BG_MONO, 0},
    {TK_OPTION_BORDER, "-background", "background", "Background",
	DEF_SCALE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkScale, bgBorder),
	0, DEF_SCALE_BG_MONO, 0},
    {TK_OPTION_DOUBLE, "-bigincrement", "bigIncrement", "BigIncrement",
	DEF_SCALE_BIG_INCREMENT, TCL_INDEX_NONE, offsetof(TkScale, bigIncrement),
	0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0},
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
#endif
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	DEF_SCALE_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(TkScale, borderWidth),
	0, 0, 0},
    {TK_OPTION_COLOR, "-color", "color", "Color",
	DEF_SCALE_FG_COLOR, TCL_INDEX_NONE, offsetof(TkScale, textColorPtr), 0,
	(ClientData) DEF_SCALE_FG_MONO, 0},
    {TK_OPTION_STRING, "-command", "command", "Command",
	DEF_SCALE_COMMAND, TCL_INDEX_NONE, offsetof(TkScale, command),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
	DEF_SCALE_CURSOR, TCL_INDEX_NONE, offsetof(TkScale, cursor),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_INT, "-digits", "digits", "Digits",
	DEF_SCALE_DIGITS, TCL_INDEX_NONE, offsetof(TkScale, digits),
	0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0},
    {TK_OPTION_SYNONYM, "-fg", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_FONT, "-font", "font", "Font",
	DEF_SCALE_FONT, TCL_INDEX_NONE, offsetof(TkScale, tkfont), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
	DEF_SCALE_FG_COLOR, TCL_INDEX_NONE, offsetof(TkScale, textColorPtr), 0,
	(ClientData) DEF_SCALE_FG_MONO, 0},
    {TK_OPTION_SYNONYM, "-foreground", "color" , NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_DOUBLE, "-from", "from", "From", DEF_SCALE_FROM, TCL_INDEX_NONE,
	offsetof(TkScale, fromValue), 0, 0, 0},
    {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground",
	"HighlightBackground", DEF_SCALE_HIGHLIGHT_BG_COLOR,
	TCL_INDEX_NONE, offsetof(TkScale, highlightBorder),
	0, DEF_SCALE_HIGHLIGHT_BG_MONO, 0},
    {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
Changes to generic/tkScrollbar.c.
42
43
44
45
46
47
48

49
50

51
52
53
54
55
56
57
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59







+


+







	DEF_SCROLLBAR_ACTIVE_RELIEF, offsetof(TkScrollbar, activeRelief), 0, NULL},
    {TK_CONFIG_BORDER, "-background", "background", "Background",
	DEF_SCROLLBAR_BG_COLOR, offsetof(TkScrollbar, bgBorder),
	TK_CONFIG_COLOR_ONLY, NULL},
    {TK_CONFIG_BORDER, "-background", "background", "Background",
	DEF_SCROLLBAR_BG_MONO, offsetof(TkScrollbar, bgBorder),
	TK_CONFIG_MONO_ONLY, NULL},
#ifndef TK_NO_DEPRECATED
    {TK_CONFIG_SYNONYM, "-bd", "borderWidth", NULL, NULL, 0, 0, NULL},
    {TK_CONFIG_SYNONYM, "-bg", "background", NULL, NULL, 0, 0, NULL},
#endif
    {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	DEF_SCROLLBAR_BORDER_WIDTH, offsetof(TkScrollbar, borderWidth), 0, NULL},
    {TK_CONFIG_STRING, "-command", "command", "Command",
	DEF_SCROLLBAR_COMMAND, offsetof(TkScrollbar, command),
	TK_CONFIG_NULL_OK, NULL},
    {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
	DEF_SCROLLBAR_CURSOR, offsetof(TkScrollbar, cursor), TK_CONFIG_NULL_OK, NULL},
Changes to generic/tkSquare.c.
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
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
94
95
96







+




+


+
+
+


+
-
-
-
-
+
+
+
+
-
+







 * Information used for argv parsing.
 */

static const Tk_OptionSpec optionSpecs[] = {
    {TK_OPTION_BORDER, "-background", "background", "Background",
	    "#d9d9d9", offsetof(Square, bgBorderPtr), TCL_INDEX_NONE, 0,
	    "white", 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0,
	    "-borderwidth", 0},
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0,
	    "-background", 0},
#endif
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	    "2", offsetof(Square, borderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0},
    {TK_OPTION_BORDER, "-color", "color", "Color",
	    "#b03060", offsetof(Square, fgBorderPtr), TCL_INDEX_NONE, 0,
	    "black", 0},
    {TK_OPTION_BOOLEAN, "-dbl", "doubleBuffer", "DoubleBuffer",
	    "1", offsetof(Square, doubleBufferPtr), TCL_INDEX_NONE, 0 , NULL, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0,
	    "-foreground", 0},
    {TK_OPTION_BORDER, "-foreground", "foreground", "Foreground",
	    "#b03060", offsetof(Square, fgBorderPtr), TCL_INDEX_NONE, 0,
    {TK_OPTION_SYNONYM, "-fg", "color", NULL, NULL, 0, TCL_INDEX_NONE, 0,
	    "-color", 0},
    {TK_OPTION_SYNONYM, "-foreground", "color" , NULL,
	    NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
	    "black", 0},
#endif
    {TK_OPTION_PIXELS, "-posx", "posx", "PosX", "0",
	    offsetof(Square, xPtr), TCL_INDEX_NONE, 0, NULL, 0},
    {TK_OPTION_PIXELS, "-posy", "posy", "PosY", "0",
	    offsetof(Square, yPtr), TCL_INDEX_NONE, 0, NULL, 0},
    {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
	    "raised", offsetof(Square, reliefPtr), TCL_INDEX_NONE, 0, NULL, 0},
    {TK_OPTION_PIXELS, "-size", "size", "Size", "20",
Changes to generic/tkText.c.
123
124
125
126
127
128
129

130
131
132
133
134

135
136
137
138
139
140



141
142
143
144
145
146
147
148
149

150
151



152
153
154

155
156


157

158
159
160
161
162
163
164
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155


156
157
158
159
160
161
162


163
164

165
166
167
168
169
170
171
172







+





+






+
+
+









+
-
-
+
+
+



+
-
-
+
+
-
+







    {TK_OPTION_BOOLEAN, "-autoseparators", "autoSeparators",
	"AutoSeparators", DEF_TEXT_AUTO_SEPARATORS, TCL_INDEX_NONE,
	offsetof(TkText, autoSeparators),
	TK_OPTION_DONT_SET_DEFAULT, 0, 0},
    {TK_OPTION_BORDER, "-background", "background", "Background",
	DEF_TEXT_BG_COLOR, TCL_INDEX_NONE, offsetof(TkText, border),
	0, DEF_TEXT_BG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth",
	TK_TEXT_LINE_GEOMETRY},
    {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-background", 0},
#endif
    {TK_OPTION_BOOLEAN, "-blockcursor", "blockCursor",
	"BlockCursor", DEF_TEXT_BLOCK_CURSOR, TCL_INDEX_NONE,
	offsetof(TkText, insertCursorType), 0, 0, 0},
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	DEF_TEXT_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(TkText, borderWidth),
	0, 0, TK_TEXT_LINE_GEOMETRY},
    {TK_OPTION_COLOR, "-color", "color", "Color",
	DEF_TEXT_FG, TCL_INDEX_NONE, offsetof(TkText, fgColor), 0,
	0, 0},
    {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
	DEF_TEXT_CURSOR, TCL_INDEX_NONE, offsetof(TkText, cursor),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_CUSTOM, "-endline", NULL, NULL,
	 NULL, TCL_INDEX_NONE, offsetof(TkText, end), TK_OPTION_NULL_OK,
	 &lineOption, TK_TEXT_LINE_RANGE},
    {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection",
	"ExportSelection", DEF_TEXT_EXPORT_SELECTION, TCL_INDEX_NONE,
	offsetof(TkText, exportSelection), 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0},
    {TK_OPTION_SYNONYM, "-fg", "color" , NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_FONT, "-font", "font", "Font",
	DEF_TEXT_FONT, TCL_INDEX_NONE, offsetof(TkText, tkfont), 0, 0,
	TK_TEXT_LINE_GEOMETRY},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
	DEF_TEXT_FG, TCL_INDEX_NONE, offsetof(TkText, fgColor), 0,
    {TK_OPTION_SYNONYM, "-foreground", "color" , NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
	0, 0},
#endif
    {TK_OPTION_PIXELS, "-height", "height", "Height",
	DEF_TEXT_HEIGHT, TCL_INDEX_NONE, offsetof(TkText, height), 0, 0, 0},
    {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground",
	"HighlightBackground", DEF_TEXT_HIGHLIGHT_BG,
	TCL_INDEX_NONE, offsetof(TkText, highlightBgColorPtr),
	0, 0, 0},
    {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
199
200
201
202
203
204
205
206

207
208
209
210

211
212
213
214

215
216




217
218
219
220
221
222
223
207
208
209
210
211
212
213

214
215
216
217

218
219
220
221

222
223
224
225
226
227
228
229
230
231
232
233
234
235







-
+



-
+



-
+


+
+
+
+







    {TK_OPTION_PIXELS, "-padx", "padX", "Pad",
	DEF_TEXT_PADX, TCL_INDEX_NONE, offsetof(TkText, padX), 0, 0,
	TK_TEXT_LINE_GEOMETRY},
    {TK_OPTION_PIXELS, "-pady", "padY", "Pad",
	DEF_TEXT_PADY, TCL_INDEX_NONE, offsetof(TkText, padY), 0, 0, 0},
    {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
	DEF_TEXT_RELIEF, TCL_INDEX_NONE, offsetof(TkText, relief), 0, 0, 0},
    {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground",
    {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "SelectBackground",
	DEF_TEXT_SELECT_COLOR, TCL_INDEX_NONE, offsetof(TkText, selBorder),
	0, DEF_TEXT_SELECT_MONO, 0},
    {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth",
	"BorderWidth", DEF_TEXT_SELECT_BD_COLOR,
	"SelectBorderWidth", DEF_TEXT_SELECT_BD_COLOR,
	offsetof(TkText, selBorderWidthPtr),
	offsetof(TkText, selBorderWidth),
	TK_OPTION_NULL_OK, DEF_TEXT_SELECT_BD_MONO, 0},
    {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background",
    {TK_OPTION_COLOR, "-selectcolor", "selectColor", "SelectColor",
	DEF_TEXT_SELECT_FG_COLOR, TCL_INDEX_NONE, offsetof(TkText, selFgColorPtr),
	TK_OPTION_NULL_OK, DEF_TEXT_SELECT_FG_MONO, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-selectforeground", NULL , NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-selectcolor", 0},
#endif
    {TK_OPTION_BOOLEAN, "-setgrid", "setGrid", "SetGrid",
	DEF_TEXT_SET_GRID, TCL_INDEX_NONE, offsetof(TkText, setGrid), 0, 0, 0},
    {TK_OPTION_PIXELS, "-spacing1", "spacing1", "Spacing",
	DEF_TEXT_SPACING1, TCL_INDEX_NONE, offsetof(TkText, spacing1),
	0, 0 , TK_TEXT_LINE_GEOMETRY },
    {TK_OPTION_PIXELS, "-spacing2", "spacing2", "Spacing",
	DEF_TEXT_SPACING2, TCL_INDEX_NONE, offsetof(TkText, spacing2),
Changes to generic/tkTextTag.c.
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
94
95
96
97
98

99
100





101
102
103
104
105
106
107
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
94
95

96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117

118
119

120
121
122
123
124
125
126
127
128
129
130
131







-
+

+
+
+
+



+
+



+
-
-
+
+
+


+
-
-
+
+
+













-
+

-
+
+
+
+
+








-
+

+
+
+
+






+
+








-
+

-
+
+
+
+
+







static const char *const tabStyleStrings[] = {
    "tabular", "wordprocessor", "", NULL
};

static const Tk_OptionSpec tagOptionSpecs[] = {
    {TK_OPTION_BORDER, "-background", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, border), TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_BITMAP, "-bgstipple", NULL, NULL,
    {TK_OPTION_BITMAP, "-backgroundstipple", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, bgStipple), TK_OPTION_NULL_OK, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-bgstipple", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-backgroundstipple", 0},
#endif
    {TK_OPTION_PIXELS, "-borderwidth", NULL, NULL,
	NULL, offsetof(TkTextTag, borderWidthPtr), offsetof(TkTextTag, borderWidth),
	TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0},
    {TK_OPTION_COLOR, "-color", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, fgColor), TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-elide", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, elideString),
	TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_BITMAP, "-fgstipple", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, fgStipple), TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_SYNONYM, "-fgstipple", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-stipple", 0},
#endif
    {TK_OPTION_FONT, "-font", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, tkfont), TK_OPTION_NULL_OK, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_COLOR, "-foreground", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, fgColor), TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_STRING, "-justify", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, justifyString), TK_OPTION_NULL_OK, 0,0},
    {TK_OPTION_STRING, "-lmargin1", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, lMargin1String), TK_OPTION_NULL_OK,0,0},
    {TK_OPTION_STRING, "-lmargin2", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, lMargin2String), TK_OPTION_NULL_OK,0,0},
    {TK_OPTION_BORDER, "-lmargincolor", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, lMarginColor), TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-offset", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, offsetString), TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-overstrike", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, overstrikeString),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_COLOR, "-overstrikefg", NULL, NULL,
    {TK_OPTION_COLOR, "-overstrikecolor", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, overstrikeColor),
        TK_OPTION_NULL_OK, 0, 0},
	TK_OPTION_NULL_OK, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-overstrikefg", "overstrikecolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-overstrikecolor", 0},
#endif
    {TK_OPTION_STRING, "-relief", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, reliefString), TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-rmargin", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, rMarginString), TK_OPTION_NULL_OK, 0,0},
    {TK_OPTION_BORDER, "-rmargincolor", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, rMarginColor), TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_BORDER, "-selectbackground", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_COLOR, "-selectforeground", NULL, NULL,
    {TK_OPTION_COLOR, "-selectcolor", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, selFgColor), TK_OPTION_NULL_OK, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-selectforeground", NULL, NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-selectcolor", 0},
#endif
    {TK_OPTION_STRING, "-spacing1", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, spacing1String), TK_OPTION_NULL_OK,0,0},
    {TK_OPTION_STRING, "-spacing2", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, spacing2String), TK_OPTION_NULL_OK,0,0},
    {TK_OPTION_STRING, "-spacing3", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, spacing3String), TK_OPTION_NULL_OK,0,0},
    {TK_OPTION_BITMAP, "-stipple", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, fgStipple), TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING, "-tabs", NULL, NULL,
	NULL, offsetof(TkTextTag, tabStringPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_STRING_TABLE, "-tabstyle", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, tabStyle),
	TK_OPTION_NULL_OK, tabStyleStrings, 0},
    {TK_OPTION_STRING, "-underline", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, underlineString),
	TK_OPTION_NULL_OK, 0, 0},
    {TK_OPTION_COLOR, "-underlinefg", NULL, NULL,
    {TK_OPTION_COLOR, "-underlinecolor", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, underlineColor),
        TK_OPTION_NULL_OK, 0, 0},
	TK_OPTION_NULL_OK, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-underlinefg", "underlinecolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-underlinecolor", 0},
#endif
    {TK_OPTION_STRING_TABLE, "-wrap", NULL, NULL,
	NULL, TCL_INDEX_NONE, offsetof(TkTextTag, wrapMode),
	TK_OPTION_NULL_OK, wrapStrings, 0},
    {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0}
};

/*
Changes to generic/ttk/ttkButton.c.
242
243
244
245
246
247
248
249

250
251




252
253
254
255
256
257
258
242
243
244
245
246
247
248

249
250
251
252
253
254
255
256
257
258
259
260
261
262







-
+


+
+
+
+







} Label;

static const Tk_OptionSpec LabelOptionSpecs[] =
{
    {TK_OPTION_BORDER, "-background", "frameColor", "FrameColor",
	NULL, offsetof(Label,label.backgroundObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK,0,0 },
    {TK_OPTION_COLOR, "-foreground", "textColor", "TextColor",
    {TK_OPTION_COLOR, "-color", "color", "Color",
	NULL, offsetof(Label,label.foregroundObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK,0,0 },
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_FONT, "-font", "font", "Font",
	NULL, offsetof(Label,label.fontObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED },
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
	NULL, offsetof(Label,label.borderWidthObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED },
    {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
Changes to generic/ttk/ttkClamTheme.c.
295
296
297
298
299
300
301
302

303
304
305
306
307
308
309
295
296
297
298
299
300
301

302
303
304
305
306
307
308
309







-
+







static const Ttk_ElementOptionSpec IndicatorElementOptions[] = {
    { "-indicatorsize", TK_OPTION_PIXELS,
	offsetof(IndicatorElement,sizeObj), "10" },
    { "-indicatormargin", TK_OPTION_STRING,
	offsetof(IndicatorElement,marginObj), "1" },
    { "-indicatorbackground", TK_OPTION_COLOR,
	offsetof(IndicatorElement,backgroundObj), "white" },
    { "-indicatorforeground", TK_OPTION_COLOR,
    { "-indicatorcolor", TK_OPTION_COLOR,
	offsetof(IndicatorElement,foregroundObj), "black" },
    { "-upperbordercolor", TK_OPTION_COLOR,
	offsetof(IndicatorElement,upperColorObj), DARKEST_COLOR },
    { "-lowerbordercolor", TK_OPTION_COLOR,
	offsetof(IndicatorElement,lowerColorObj), DARK_COLOR },
    { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
Changes to generic/ttk/ttkDefaultTheme.c.
398
399
400
401
402
403
404
405
406


407
408
409
410
411
412
413
398
399
400
401
402
403
404


405
406
407
408
409
410
411
412
413







-
-
+
+







    /* colors */
    "A c #808000000000 s shadow",
    "B c #000080800000 s highlight",
    "C c #808080800000 s 3dlight",
    "D c #000000008080 s window",
    "E c #808000008080 s 3ddark",
    "F c #000080808080 s frame",
    "G c #000000000000 s foreground",
    "H c #000080800000 s disabledfg",
    "G c #000000000000 s color",
    "H c #000080800000 s disabledcolor",
};
#endif

static const Ttk_StateTable checkbutton_states[] = {
    { 0, 0, TTK_STATE_SELECTED|TTK_STATE_DISABLED },
    { 1, TTK_STATE_SELECTED, TTK_STATE_DISABLED },
    { 2, TTK_STATE_DISABLED, TTK_STATE_SELECTED },
476
477
478
479
480
481
482
483

484
485
486
487
488
489
490
476
477
478
479
480
481
482

483
484
485
486
487
488
489
490







-
+







    Tcl_Obj *borderColorObj;
    Tcl_Obj *marginObj;
} IndicatorElement;

static const Ttk_ElementOptionSpec IndicatorElementOptions[] = {
    { "-background", TK_OPTION_COLOR,
	    offsetof(IndicatorElement,backgroundObj), DEFAULT_BACKGROUND },
    { "-foreground", TK_OPTION_COLOR,
    { "-color", TK_OPTION_COLOR,
	    offsetof(IndicatorElement,foregroundObj), DEFAULT_FOREGROUND },
    { "-indicatorcolor", TK_OPTION_COLOR,
	    offsetof(IndicatorElement,colorObj), "#FFFFFF" },
    { "-lightcolor", TK_OPTION_COLOR,
	    offsetof(IndicatorElement,lightColorObj), "#DDDDDD" },
    { "-shadecolor", TK_OPTION_COLOR,
	    offsetof(IndicatorElement,shadeColorObj), "#888888" },
1099
1100
1101
1102
1103
1104
1105
1106

1107
1108
1109
1110
1111
1112
1113
1099
1100
1101
1102
1103
1104
1105

1106
1107
1108
1109
1110
1111
1112
1113







-
+







typedef struct {
    Tcl_Obj *colorObj;
    Tcl_Obj *marginObj;
    Tcl_Obj *diameterObj;
} TreeitemIndicator;

static const Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = {
    { "-foreground", TK_OPTION_COLOR,
    { "-color", TK_OPTION_COLOR,
	offsetof(TreeitemIndicator,colorObj), DEFAULT_FOREGROUND },
    { "-diameter", TK_OPTION_PIXELS,
	offsetof(TreeitemIndicator,diameterObj), "9" },
    { "-indicatormargins", TK_OPTION_STRING,
	offsetof(TreeitemIndicator,marginObj), "2 2 4 2" },
    { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
Changes to generic/ttk/ttkEntry.c.
193
194
195
196
197
198
199
200

201
202




203
204


205
206
207




208
209
210
211
212
213
214
193
194
195
196
197
198
199

200
201
202
203
204
205
206


207
208
209
210

211
212
213
214
215
216
217
218
219
220
221







-
+


+
+
+
+
-
-
+
+


-
+
+
+
+







	TK_OPTION_NULL_OK, 0, SCROLLCMD_CHANGED},

    /* EntryStyleData options:
     */
    {TK_OPTION_COLOR, "-background", "windowColor", "WindowColor",
	NULL, offsetof(Entry, entry.styleData.backgroundObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK,0,0},
    {TK_OPTION_COLOR, "-foreground", "textColor", "TextColor",
    {TK_OPTION_COLOR, "-color", "color", "Color",
	NULL, offsetof(Entry, entry.styleData.foregroundObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK,0,0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_COLOR, "-placeholderforeground", "placeholderForeground",
        "PlaceholderForeground", NULL,
    {TK_OPTION_COLOR, "-placeholdercolor", "placeholderColor",
        "PlaceholderColor", NULL,
        offsetof(Entry, entry.styleData.placeholderForegroundObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK,0,0},

#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-placeholderforeground", "placeholdercolor", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-placeholdercolor", 0},
#endif
    WIDGET_TAKEFOCUS_TRUE,
    WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs)
};

/*------------------------------------------------------------------------
 * +++ EntryStyleData management.
 * 	This is still more awkward than it should be;
258
259
260
261
262
263
264
265
266


267
268
269

270
271
272
273
274
275
276
265
266
267
268
269
270
271


272
273
274
275

276
277
278
279
280
281
282
283







-
-
+
+


-
+







    /* Initialize to fallback values:
     */
    *es = entryPtr->entry.styleDefaults;

#   define INIT(member, name) \
    if ((tmp=Ttk_QueryOption(entryPtr->core.layout,name,state))) \
    	es->member=tmp;
    INIT(placeholderForegroundObj, "-placeholderforeground");
    INIT(foregroundObj, "-foreground");
    INIT(placeholderForegroundObj, "-placeholdercolor");
    INIT(foregroundObj, "-color");
    INIT(selBorderObj, "-selectbackground")
    INIT(selBorderWidthObj, "-selectborderwidth")
    INIT(selForegroundObj, "-selectforeground")
    INIT(selForegroundObj, "-selectcolor")
    INIT(insertColorObj, "-insertcolor")
    INIT(insertWidthObj, "-insertwidth")
#undef INIT

    /* Reacquire color & border resources from resource cache.
     */
    es->placeholderForegroundObj = Ttk_UseColor(cache, tkwin, es->placeholderForegroundObj);
Changes to generic/ttk/ttkLabel.c.
47
48
49
50
51
52
53
54

55
56
57
58
59
60
61
47
48
49
50
51
52
53

54
55
56
57
58
59
60
61







-
+







 * NB: Keep in sync with label element option table.
 */
static const Ttk_ElementOptionSpec TextElementOptions[] = {
    { "-text", TK_OPTION_STRING,
	offsetof(TextElement,textObj), "" },
    { "-font", TK_OPTION_FONT,
	offsetof(TextElement,fontObj), DEFAULT_FONT },
    { "-foreground", TK_OPTION_COLOR,
    { "-color", TK_OPTION_COLOR,
	offsetof(TextElement,foregroundObj), "black" },
    { "-underline", TK_OPTION_INT,
	offsetof(TextElement,underlineObj), "-1"},
    { "-width", TK_OPTION_INT,
	offsetof(TextElement,widthObj), "-1"},
    { "-anchor", TK_OPTION_ANCHOR,
	offsetof(TextElement,anchorObj), "w"},
457
458
459
460
461
462
463
464

465
466
467
468
469
470
471
457
458
459
460
461
462
463

464
465
466
467
468
469
470
471







-
+







    /* Text element part:
     * NB: Keep in sync with TextElementOptions.
     */
    { "-text", TK_OPTION_STRING,
	offsetof(LabelElement,text.textObj), "" },
    { "-font", TK_OPTION_FONT,
	offsetof(LabelElement,text.fontObj), DEFAULT_FONT },
    { "-foreground", TK_OPTION_COLOR,
    { "-color", TK_OPTION_COLOR,
	offsetof(LabelElement,text.foregroundObj), "black" },
    { "-underline", TK_OPTION_INT,
	offsetof(LabelElement,text.underlineObj), "-1"},
    { "-width", TK_OPTION_INT,
	offsetof(LabelElement,text.widthObj), ""},
    { "-anchor", TK_OPTION_ANCHOR,
	offsetof(LabelElement,text.anchorObj), "w"},
Changes to generic/ttk/ttkProgress.c.
52
53
54
55
56
57
58
59

60
61




62
63
64
65
66
67
68
52
53
54
55
56
57
58

59
60
61
62
63
64
65
66
67
68
69
70
71
72







-
+


+
+
+
+







{
    {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor",
	"w", offsetof(Progressbar,progress.anchorObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK, 0, GEOMETRY_CHANGED},
    {TK_OPTION_FONT, "-font", "font", "Font",
	DEFAULT_FONT, offsetof(Progressbar,progress.fontObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED },
    {TK_OPTION_COLOR, "-foreground", "textColor", "TextColor",
    {TK_OPTION_COLOR, "-color", "color", "Color",
	"black", offsetof(Progressbar,progress.foregroundObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK,0,0 },
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
	"left", offsetof(Progressbar,progress.justifyObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED },
    {TK_OPTION_PIXELS, "-length", "length", "Length",
        DEF_PROGRESSBAR_LENGTH, offsetof(Progressbar,progress.lengthObj), TCL_INDEX_NONE,
	0, 0, GEOMETRY_CHANGED },
    {TK_OPTION_DOUBLE, "-maximum", "maximum", "Maximum",
Changes to generic/ttk/ttkSquare.c.
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
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







-
-
-
-
-
-
+
+
+
+
+
+
+
+
+

-
-
+
+

-
-
+
+


-
-
+
+


-
+


-
+







 * default values. At the bottom we bring in the standard widget option
 * defined for all widgets.
 */

static const Tk_OptionSpec SquareOptionSpecs[] =
{
    {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
     DEFAULT_BORDERWIDTH, offsetof(Square,square.borderWidthObj), TCL_INDEX_NONE,
     0,0,GEOMETRY_CHANGED },
    {TK_OPTION_BORDER, "-foreground", "foreground", "Foreground",
     DEFAULT_BACKGROUND, offsetof(Square,square.foregroundObj),
     TCL_INDEX_NONE, 0, 0, 0},

	DEFAULT_BORDERWIDTH, offsetof(Square,square.borderWidthObj), TCL_INDEX_NONE,
	0,0,GEOMETRY_CHANGED },
    {TK_OPTION_BORDER, "-color", "color", "Color",
	DEFAULT_BACKGROUND, offsetof(Square,square.foregroundObj),
	TCL_INDEX_NONE, 0, 0, 0},
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_PIXELS, "-width", "width", "Width",
     "50", offsetof(Square,square.widthObj), TCL_INDEX_NONE, 0, 0,
     GEOMETRY_CHANGED},
	"50", offsetof(Square,square.widthObj), TCL_INDEX_NONE, 0, 0,
	GEOMETRY_CHANGED},
    {TK_OPTION_PIXELS, "-height", "height", "Height",
     "50", offsetof(Square,square.heightObj), TCL_INDEX_NONE, 0, 0,
     GEOMETRY_CHANGED},
	"50", offsetof(Square,square.heightObj), TCL_INDEX_NONE, 0, 0,
	GEOMETRY_CHANGED},

    {TK_OPTION_STRING, "-padding", "padding", "Pad", NULL,
     offsetof(Square,square.paddingObj), TCL_INDEX_NONE,
     TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED },
	offsetof(Square,square.paddingObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED },

    {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
     NULL, offsetof(Square,square.reliefObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0},
	NULL, offsetof(Square,square.reliefObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0},

    {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor",
     NULL, offsetof(Square,square.anchorObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0},
	NULL, offsetof(Square,square.anchorObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0},

    WIDGET_TAKEFOCUS_TRUE,
    WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs)
};

/*
 * Almost all of the widget functionality is handled by the default Ttk
176
177
178
179
180
181
182
183

184
185
186
187
188
189
190
179
180
181
182
183
184
185

186
187
188
189
190
191
192
193







-
+







    Tcl_Obj *heightObj;
} SquareElement;

static const Ttk_ElementOptionSpec SquareElementOptions[] =
{
    { "-background", TK_OPTION_BORDER, offsetof(SquareElement,borderObj),
    	DEFAULT_BACKGROUND },
    { "-foreground", TK_OPTION_BORDER, offsetof(SquareElement,foregroundObj),
    { "-color", TK_OPTION_BORDER, offsetof(SquareElement,foregroundObj),
    	DEFAULT_BACKGROUND },
    { "-borderwidth", TK_OPTION_PIXELS, offsetof(SquareElement,borderWidthObj),
    	DEFAULT_BORDERWIDTH },
    { "-relief", TK_OPTION_RELIEF, offsetof(SquareElement,reliefObj),
    	"raised" },
    { "-width",  TK_OPTION_PIXELS, offsetof(SquareElement,widthObj), "20"},
    { "-height", TK_OPTION_PIXELS, offsetof(SquareElement,heightObj), "20"},
Changes to generic/ttk/ttkTreeview.c.
199
200
201
202
203
204
205
206

207
208




209
210
211
212
213
214
215
199
200
201
202
203
204
205

206
207
208
209
210
211
212
213
214
215
216
217
218
219







-
+


+
+
+
+







	TK_OPTION_NULL_OK,0,0 },
    {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor",
	NULL, offsetof(DisplayItem,anchorObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK, 0, GEOMETRY_CHANGED},	/* <<NOTE-ANCHOR>> */
    {TK_OPTION_COLOR, "-background", "windowColor", "WindowColor",
	NULL, offsetof(DisplayItem,backgroundObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK,0,0 },
    {TK_OPTION_COLOR, "-foreground", "textColor", "TextColor",
    {TK_OPTION_COLOR, "-color", "color", "Color",
	NULL, offsetof(DisplayItem,foregroundObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK,0,0 },
#ifndef TK_NO_DEPRECATED
    {TK_OPTION_SYNONYM, "-foreground", "color", NULL,
	NULL, 0, TCL_INDEX_NONE, 0, "-color", 0},
#endif
    {TK_OPTION_FONT, "-font", "font", "Font",
	NULL, offsetof(DisplayItem,fontObj), TCL_INDEX_NONE,
	TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED },

    {TK_OPTION_END, 0,0,0, NULL, TCL_INDEX_NONE,TCL_INDEX_NONE, 0,0,0}
};

3371
3372
3373
3374
3375
3376
3377
3378

3379
3380
3381
3382
3383
3384
3385
3375
3376
3377
3378
3379
3380
3381

3382
3383
3384
3385
3386
3387
3388
3389







-
+







typedef struct {
    Tcl_Obj *colorObj;
    Tcl_Obj *sizeObj;
    Tcl_Obj *marginsObj;
} TreeitemIndicator;

static const Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = {
    { "-foreground", TK_OPTION_COLOR,
    { "-color", TK_OPTION_COLOR,
	offsetof(TreeitemIndicator,colorObj), DEFAULT_FOREGROUND },
    { "-indicatorsize", TK_OPTION_PIXELS,
	offsetof(TreeitemIndicator,sizeObj), "12" },
    { "-indicatormargins", TK_OPTION_STRING,
	offsetof(TreeitemIndicator,marginsObj), "2 2 4 2" },
    { NULL, TK_OPTION_BOOLEAN, 0, NULL }
};
Changes to library/clrpick.tcl.
205
206
207
208
209
210
211
212

213
214
215
216
217
218
219
205
206
207
208
209
210
211

212
213
214
215
216
217
218
219







-
+







#	Build the dialog.
#
proc ::tk::dialog::color::BuildDialog {w} {
    upvar ::tk::dialog::color::[winfo name $w] data

    # TopFrame contains the color strips and the color selection
    #
    set topFrame [frame $w.top -relief raised -bd 1]
    set topFrame [frame $w.top -relief raised -borderwidth 1]

    # StripsFrame contains the colorstrips and the individual RGB entries
    set stripsFrame [frame $topFrame.colorStrip]

    set maxWidth [::tk::mcmaxamp &Red &Green &Blue]
    set maxWidth [expr {$maxWidth<6 ? 6 : $maxWidth}]
    set colorList {
237
238
239
240
241
242
243
244

245
246
247
248

249
250
251
252
253
254
255
237
238
239
240
241
242
243

244
245
246
247

248
249
250
251
252
253
254
255







-
+



-
+







		-width 4
	pack $box.label -side left -fill y -padx 2 -pady 3
	pack $box.entry -side left -anchor n -pady 0
	pack $box -side left -fill both

	set height [expr {
	    [winfo reqheight $box.entry] -
	    2*([$box.entry cget -highlightthickness] + [$box.entry cget -bd])
	    2*([$box.entry cget -highlightthickness] + [$box.entry cget -borderwidth])
	}]

	canvas $f.color -height $height \
		-width $data(BARS_WIDTH) -relief sunken -bd 2
		-width $data(BARS_WIDTH) -relief sunken -borderwidth 2
	canvas $f.sel -height $data(PLGN_HEIGHT) \
		-width $data(canvasWidth) -highlightthickness 0
	pack $f.color -expand yes -fill both
	pack $f.sel -expand yes -fill both

	pack $f -side top -fill x -padx 0 -pady 2

279
280
281
282
283
284
285
286
287


288
289
290
291
292
293
294
295
296
297
298
299
300

301
302
303
304
305
306
307
279
280
281
282
283
284
285


286
287
288
289
290
291
292
293
294
295
296
297
298
299

300
301
302
303
304
305
306
307







-
-
+
+












-
+







    #
    set selFrame [frame $topFrame.sel]
    set lab [::tk::AmpWidget label $selFrame.lab \
	    -text [mc "&Selection:"] -anchor sw]
    set ent [entry $selFrame.ent \
	    -textvariable ::tk::dialog::color::[winfo name $w](selection) \
	    -width 16]
    set f1  [frame $selFrame.f1 -relief sunken -bd 2]
    set data(finalCanvas) [frame $f1.demo -bd 0 -width 100 -height 70]
    set f1  [frame $selFrame.f1 -relief sunken -borderwidth 2]
    set data(finalCanvas) [frame $f1.demo -borderwidth 0 -width 100 -height 70]

    pack $lab $ent -side top -fill x -padx 4 -pady 2
    pack $f1 -expand yes -anchor nw -fill both -padx 6 -pady 10
    pack $data(finalCanvas) -expand yes -fill both

    bind $ent <Return> [list tk::dialog::color::HandleSelEntry $w]

    pack $selFrame -side left -fill none -anchor nw
    pack $topFrame -side top -expand yes -fill both -anchor nw

    # the botFrame frame contains the buttons
    #
    set botFrame [frame $w.bot -relief raised -bd 1]
    set botFrame [frame $w.bot -relief raised -borderwidth 1]

    ::tk::AmpWidget button $botFrame.ok     -text [mc "&OK"]		\
	    -command [list tk::dialog::color::OkCmd $w]
    ::tk::AmpWidget button $botFrame.cancel -text [mc "&Cancel"]	\
	    -command [list tk::dialog::color::CancelCmd $w]

    set data(okBtn)      $botFrame.ok
424
425
426
427
428
429
430
431

432
433
434
435
436
437
438
424
425
426
427
428
429
430

431
432
433
434
435
436
437
438







-
+







		[list tk::dialog::color::ReleaseMouse $w $sel $c %x $data(selPad)]
    } else {
	# l is the canvas index of the first colorbar.
	set l $data(lines,$c,start)
    }

    # Draw the color bars.
    set highlightW [expr {[$col cget -highlightthickness] + [$col cget -bd]}]
    set highlightW [expr {[$col cget -highlightthickness] + [$col cget -borderwidth]}]
    for {set i 0} { $i < $data(NUM_COLORBARS)} { incr i} {
	set intensity [expr {$i * $data(intensityIncr)}]
	set startx [expr {$i * $data(colorbarWidth) + $highlightW}]
	if {$c eq "red"} {
	    set color [format "#%02x%02x%02x" \
		    $intensity $data(green,intensity) $data(blue,intensity)]
	} elseif {$c eq "green"} {
484
485
486
487
488
489
490
491

492
493
494
495
496
497
498
484
485
486
487
488
489
490

491
492
493
494
495
496
497
498







-
+







#
proc ::tk::dialog::color::RedrawFinalColor {w} {
    upvar ::tk::dialog::color::[winfo name $w] data

    set color [format "#%02x%02x%02x" $data(red,intensity) \
	    $data(green,intensity) $data(blue,intensity)]

    $data(finalCanvas) configure -bg $color
    $data(finalCanvas) configure -background $color
    set data(finalColor) $color
    set data(selection) $color
    set data(finalRGB) [list \
	    $data(red,intensity) \
	    $data(green,intensity) \
	    $data(blue,intensity)]
}
Changes to library/console.tcl.
154
155
156
157
158
159
160
161
162
163
164




165
166
167
168
169
170
171
154
155
156
157
158
159
160




161
162
163
164
165
166
167
168
169
170
171







-
-
-
-
+
+
+
+







    }
    pack .sb  -in .consoleframe -fill both -side right -padx 1 -pady 1
    pack $con -in .consoleframe -fill both -expand 1 -side left -padx 1 -pady 1
    pack .consoleframe -fill both -expand 1 -side left

    ConsoleBind $con

    $con tag configure stderr	-foreground red
    $con tag configure stdin	-foreground blue
    $con tag configure prompt	-foreground \#8F4433
    $con tag configure proc	-foreground \#008800
    $con tag configure stderr	-color red
    $con tag configure stdin	-color blue
    $con tag configure prompt	-color \#8F4433
    $con tag configure proc	-color \#008800
    $con tag configure var	-background \#FFC0D0
    $con tag raise sel
    $con tag configure blink	-background \#FFFF00
    $con tag configure find	-background \#FFFF00

    focus $con

Changes to library/demos/anilabel.tcl.
108
109
110
111
112
113
114
115
116
117



118
119
120

121
122
123
124
125
126
127
108
109
110
111
112
113
114



115
116
117
118
119

120
121
122
123
124
125
126
127







-
-
-
+
+
+


-
+








# Make some widgets to contain the animations
labelframe $w.left -text "Scrolling Texts"
labelframe $w.right -text "GIF Image"
pack $w.left $w.right -side left -padx 10 -pady 10 -expand yes

# This method of scrolling text looks far better with a fixed-width font
label $w.left.l1 -bd 4 -relief ridge -font fixedFont
label $w.left.l2 -bd 4 -relief groove -font fixedFont
label $w.left.l3 -bd 4 -relief flat -font fixedFont -width 18
label $w.left.l1 -borderwidth 4 -relief ridge -font fixedFont
label $w.left.l2 -borderwidth 4 -relief groove -font fixedFont
label $w.left.l3 -borderwidth 4 -relief flat -font fixedFont -width 18
pack $w.left.l1 $w.left.l2 $w.left.l3 -side top -expand yes -padx 10 -pady 10 -anchor w
# Don't need to do very much with this label except turn off the border
label $w.right.l -bd 0
label $w.right.l -borderwidth 0
pack $w.right.l -side top -expand yes -padx 10 -pady 10

# This is a base-64-encoded animated GIF file.
set tclPoweredData {
    R0lGODlhKgBAAPQAAP//////zP//AP/MzP/Mmf/MAP+Zmf+ZZv+ZAMz//8zM
    zMyZmcyZZsxmZsxmAMwzAJnMzJmZzJmZmZlmmZlmZplmM5kzM2aZzGZmzGZm
    mWZmZmYzZmYzMzNmzDMzZgAzmSH+IE1hZGUgd2l0aCBHSU1QIGJ5IExARGVt
Changes to library/demos/bind.tcl.
28
29
30
31
32
33
34
35
36


37
38
39
40
41
42
43
28
29
30
31
32
33
34


35
36
37
38
39
40
41
42
43







-
-
+
+








# Set up display styles.

if {[winfo depth $w] > 1} {
    set bold "-background #43ce80 -relief raised -borderwidth 1"
    set normal "-background {} -relief flat"
} else {
    set bold "-foreground white -background black"
    set normal "-foreground {} -background {}"
    set bold "-color white -background black"
    set normal "-color {} -background {}"
}

# Add text to widget.

$w.text insert 0.0 {\
The same tag mechanism that controls display styles in text widgets can also be used to associate Tcl commands with regions of text, so that mouse or keyboard actions on the text cause particular Tcl commands to be invoked.  For example, in the text below the descriptions of the canvas demonstrations have been tagged.  When you move the mouse over a demo description the description lights up, and when you press button 1 over a description then that particular demonstration is invoked.

Changes to library/demos/button.tcl.
19
20
21
22
23
24
25
26

27
28
29
30
31
32
33
19
20
21
22
23
24
25

26
27
28
29
30
31
32
33







-
+







label $w.msg -font $font -wraplength 4i -justify left -text "If you click on any of the four buttons below, the background of the button area will change to the color indicated in the button.  You can press Tab to move among the buttons, then press Space to invoke the current button."
pack $w.msg -side top

## See Code / Dismiss buttons
pack [addSeeDismiss $w.buttons $w] -side bottom -fill x

proc colorrefresh {w col} {
    $w configure -bg $col
    $w configure -background $col
    if {[tk windowingsystem] eq "aqua"} {
	# set highlightbackground of all buttons in $w
	set l [list $w]
	while {[llength $l]} {
	    set l [concat [lassign $l b] [winfo children $b]]
	    if {[winfo class $b] eq "Button"} {
		$b configure -highlightbackground $col
Changes to library/demos/clrpick.tcl.
23
24
25
26
27
28
29
30

31
32
33
34
35
36
37
23
24
25
26
27
28
29

30
31
32
33
34
35
36
37







-
+







pack $btns -side bottom -fill x

button $w.back -text "Set background color ..." \
    -command \
    "setColor $w $w.back background {-background -highlightbackground}"
button $w.fore -text "Set foreground color ..." \
    -command \
    "setColor $w $w.back foreground -foreground"
    "setColor $w $w.back foreground -color"

pack $w.back $w.fore -side top -anchor c -pady 2m

proc setColor {w button name options} {
    grab $w
    set initialColor [$button cget -$name]
    set color [tk_chooseColor -title "Choose a $name color" -parent $w \
Changes to library/demos/combo.tcl.
40
41
42
43
44
45
46
47

48
49
50
51
52
53
54
40
41
42
43
44
45
46

47
48
49
50
51
52
53
54







-
+







    Hobart Darwin "Alice Springs"
}
set secondValue unchangable
set ozCity Sydney

ttk::labelframe $w.c1 -text "Fully Editable"
ttk::combobox $w.c1.c -textvariable firstValue -placeholder {Enter text here}
ttk::style configure TEntry -placeholderforeground gray50
ttk::style configure TEntry -placeholdercolor gray50
ttk::labelframe $w.c2 -text Disabled
ttk::combobox $w.c2.c -textvariable secondValue -state disabled
ttk::labelframe $w.c3 -text "Defined List Only"
ttk::combobox $w.c3.c -textvariable ozCity -state readonly \
	-values $australianCities
bind $w.c1.c <Return> {
    if {[%W get] ni [%W cget -values]} {
Changes to library/demos/cscroll.tcl.
38
39
40
41
42
43
44
45

46
47
48
49
50
51
52
38
39
40
41
42
43
44

45
46
47
48
49
50
51
52







-
+







    -row 0 -column 0 -rowspan 1 -columnspan 1 -sticky news
grid $w.vscroll -in $w.grid -padx 1 -pady 1 \
    -row 0 -column 1 -rowspan 1 -columnspan 1 -sticky news
grid $w.hscroll -in $w.grid -padx 1 -pady 1 \
    -row 1 -column 0 -rowspan 1 -columnspan 1 -sticky news


set bg [lindex [$c config -bg] 4]
set bg [lindex [$c config -background] 4]
for {set i 0} {$i < 20} {incr i} {
    set x [expr {-10 + 3*$i}]
    for {set j 0; set y -10} {$j < 10} {incr j; incr y 3} {
	$c create rect ${x}c ${y}c [expr {$x+2}]c [expr {$y+2}]c \
		-fill $bg -tags rect
	$c create text [expr {$x+1}]c [expr {$y+1}]c -text "$i,$j" \
	    -anchor center -tags text
Changes to library/demos/entry1.tcl.
21
22
23
24
25
26
27
28

29
30
31
32
33
34
21
22
23
24
25
26
27

28
29
30
31
32
33
34







-
+







## See Code / Dismiss buttons
set btns [addSeeDismiss $w.buttons $w]
pack $btns -side bottom -fill x

entry $w.e1
entry $w.e2
entry $w.e3 -placeholder {Enter text here} -placeholderforeground gray75
entry $w.e3 -placeholder {Enter text here} -placeholdercolor gray75
pack $w.e1 $w.e2 $w.e3 -side top -pady 5 -padx 10 -fill x

$w.e1 insert 0 "Initial value"
$w.e2 insert end "This entry contains a long value, much too long "
$w.e2 insert end "to fit in the window at one time, so long in fact "
$w.e2 insert end "that you'll have to scan or scroll to see the end."
Changes to library/demos/entry2.tcl.
40
41
42
43
44
45
46
47

40
41
42
43
44
45
46

47







-
+
pack $w.frame.e1 $w.frame.s1 $w.frame.spacer1 $w.frame.e2 $w.frame.s2 \
	$w.frame.spacer2 $w.frame.e3 $w.frame.s3 -side top -fill x

$w.frame.e1 insert 0 "Initial value"
$w.frame.e2 insert end "This entry contains a long value, much too long "
$w.frame.e2 insert end "to fit in the window at one time, so long in fact "
$w.frame.e2 insert end "that you'll have to scan or scroll to see the end."
$w.frame.e3 configure -placeholder {Enter text here} -placeholderforeground gray75
$w.frame.e3 configure -placeholder {Enter text here} -placeholdercolor gray75
Changes to library/demos/entry3.tcl.
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
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







-
+


-
+

-
+








-
+

-
+



-
+







# fg -		Initial foreground colour
# bg -		Initial background colour
# count -	Counter to control the number of times flashed

proc focusAndFlash {W fg bg {count 9}} {
    focus -force $W
    if {$count<1} {
	$W configure -foreground $fg -background $bg
	$W configure -color $fg -background $bg
    } else {
	if {$count%2} {
	    $W configure -foreground $bg -background $fg
	    $W configure -color $bg -background $fg
	} else {
	    $W configure -foreground $fg -background $bg
	    $W configure -color $fg -background $bg
	}
	after 200 [list focusAndFlash $W $fg $bg [expr {$count-1}]]
    }
}

labelframe $w.l1 -text "Integer Entry"
# Alternatively try using {string is digit} for arbitrary length numbers,
# and not just 32-bit ones.
entry $w.l1.e -validate focus -vcmd {string is integer %P}
entry $w.l1.e -validate focus -validatecommand {string is integer %P}
$w.l1.e configure -invalidcommand \
	"focusAndFlash %W [$w.l1.e cget -fg] [$w.l1.e cget -bg]"
	"focusAndFlash %W [$w.l1.e cget -fg] [$w.l1.e cget -background]"
pack $w.l1.e -fill x -expand 1 -padx 1m -pady 1m

labelframe $w.l2 -text "Length-Constrained Entry"
entry $w.l2.e -validate key -invcmd bell -vcmd {expr {[string length %P]<10}}
entry $w.l2.e -validate key -invalidcmd bell -validatecommand {expr {[string length %P]<10}}
pack $w.l2.e -fill x -expand 1 -padx 1m -pady 1m

### PHONE NUMBER ENTRY ###
# Note that the source to this is quite a bit longer as the behaviour
# demonstrated is a lot more ambitious than with the others.

# Initial content for the third entry widget
99
100
101
102
103
104
105
106

107
108
109
110
111
112
113
99
100
101
102
103
104
105

106
107
108
109
110
111
112
113







-
+







# idx -	  The index where replacement is to occur
# char -  The character (or string, though that will always be
#	  refused) to be overwritten at that point.

proc validatePhoneChange {W vmode idx char} {
    global phoneNumberMap entry3content
    if {$idx < 0} {return 1}
    after idle [list $W configure -validate $vmode -invcmd bell]
    after idle [list $W configure -validate $vmode -invalidcmd bell]
    if {
	!($idx<3 || $idx==6 || $idx==7 || $idx==11 || $idx>15) &&
	[string match {[0-9A-Za-z]} $char]
    } then {
	$W delete $idx
	$W insert $idx [string map $phoneNumberMap $char]
	after idle [list phoneSkipRight $W -1]
156
157
158
159
160
161
162
163
164


165
166
167
168
169
170
171
172
173
174
175
176
177

178
179
180
181
182
183
184
185
156
157
158
159
160
161
162


163
164
165
166
167
168
169
170
171
172
173
174
175
176

177
178
179
180
181
182
183
184
185







-
-
+
+












-
+








	# Can't move any further
	bell
	return -code break
    }
}

labelframe $w.l3 -text "US Phone-Number Entry"
entry $w.l3.e -validate key  -invcmd bell  -textvariable entry3content \
	-vcmd {validatePhoneChange %W %v %i %S}
entry $w.l3.e -validate key  -invalidcmd bell  -textvariable entry3content \
	-validatecommand {validatePhoneChange %W %v %i %S}
# Click to focus goes to the first editable character...
bind $w.l3.e <FocusIn> {
    if {"%d" ne "NotifyAncestor"} {
	%W icursor 3
	after idle {%W selection clear}
    }
}
bind $w.l3.e <<PrevChar>> {phoneSkipLeft  %W}
bind $w.l3.e <<NextChar>> {phoneSkipRight %W}
pack $w.l3.e -fill x -expand 1 -padx 1m -pady 1m

labelframe $w.l4 -text "Password Entry"
entry $w.l4.e -validate key -show "*" -vcmd {expr {[string length %P]<=8}}
entry $w.l4.e -validate key -show "*" -validatecommand {expr {[string length %P]<=8}}
pack $w.l4.e -fill x -expand 1 -padx 1m -pady 1m

lower [frame $w.mid]
grid $w.l1 $w.l2 -in $w.mid -padx 3m -pady 1m -sticky ew
grid $w.l3 $w.l4 -in $w.mid -padx 3m -pady 1m -sticky ew
grid columnconfigure $w.mid {0 1} -uniform 1
pack $w.msg -side top
pack $w.mid -fill both -expand 1
Changes to library/demos/form.tcl.
20
21
22
23
24
25
26
27

28
29
30
31
32
33
34
20
21
22
23
24
25
26

27
28
29
30
31
32
33
34







-
+







pack $w.msg -side top

## See Code / Dismiss buttons
set btns [addSeeDismiss $w.buttons $w]
pack $btns -side bottom -fill x

foreach i {f1 f2 f3 f4 f5} {
    frame $w.$i -bd 2
    frame $w.$i -borderwidth 2
    entry $w.$i.entry -relief sunken -width 40
    label $w.$i.label
    pack $w.$i.entry -side right
    pack $w.$i.label -side left
}
$w.f1.label config -text Name:
$w.f2.label config -text Address:
Changes to library/demos/goldberg.tcl.
93
94
95
96
97
98
99
100

101
102
103

104
105
106
107
108
109
110
93
94
95
96
97
98
99

100
101
102

103
104
105
106
107
108
109
110







-
+


-
+







set C(23a) blue;	set C(23b) red;		set C(23c) yellow
set C(24a) red;		set C(24b) white;

proc DoDisplay {w} {
    global S C

    ttk::frame $w.ctrl -relief ridge -borderwidth 2 -padding 5
    pack [frame $w.screen -bd 2 -relief raised] \
    pack [frame $w.screen -borderwidth 2 -relief raised] \
	    -side left -fill both -expand 1

    canvas $w.c -width 860 -height 730 -bg $C(bg) -highlightthickness 0
    canvas $w.c -width 860 -height 730 -background $C(bg) -highlightthickness 0
    $w.c config -scrollregion {0 0 1000 1000}	;# Kludge: move everything up
    $w.c yview moveto .05
    pack $w.c -in $w.screen -side top -fill both -expand 1

    bind $w.c <Button-3> [list $w.pause invoke]
    bind $w.c <Destroy> {
	after cancel $animationCallbacks(goldberg)
403
404
405
406
407
408
409
410

411
412

413
414
415
416
417
418
419
403
404
405
406
407
408
409

410
411

412
413
414
415
416
417
418
419







-
+

-
+







    set xy  {750 369 740 392 760 392}		;# Fulcrum
    $w.c create poly $xy -fill $::C(fg) -outline $::C(fg)
    set xy {628 335 660 383}			;# Strike box
    $w.c create rect $xy -fill {} -outline $::C(fg)
    for {set y 0} {$y < 3} {incr y} {
	set yy [expr {335+$y*16}]
	$w.c create bitmap 628 $yy -bitmap gray25 -anchor nw \
		-foreground $::C(fg)
		-color $::C(fg)
	$w.c create bitmap 644 $yy -bitmap gray25 -anchor nw \
		-foreground $::C(fg)
		-color $::C(fg)
    }

    set xy {702 366 798 366}			;# Lever
    $w.c create line $xy -fill $::C(fg) -width 6 -tag I2_0
    set xy {712 363 712 355}			;# R strap
    $w.c create line $xy -fill $::C(fg) -width 3 -tag I2_1
    set xy {705 363 705 355}			;# L strap
Changes to library/demos/hscale.tcl.
21
22
23
24
25
26
27
28

29
30
31
32
33
34
35
21
22
23
24
25
26
27

28
29
30
31
32
33
34
35







-
+







## See Code / Dismiss buttons
set btns [addSeeDismiss $w.buttons $w]
pack $btns -side bottom -fill x

frame $w.frame -borderwidth 10
pack $w.frame -side top -fill x

canvas $w.frame.canvas -width 50 -height 50 -bd 0 -highlightthickness 0
canvas $w.frame.canvas -width 50 -height 50 -borderwidth 0 -highlightthickness 0
$w.frame.canvas create polygon 0 0 1 1 2 2 -fill DeepSkyBlue3 -tags poly
$w.frame.canvas create line 0 0 1 1 2 2 0 0 -fill black -tags line
scale $w.frame.scale -orient horizontal -length 284 -from 0 -to 250 \
	-command "setWidth $w.frame.canvas" -tickinterval 50
pack $w.frame.canvas -side top -expand yes -anchor s -fill x  -padx 15
pack $w.frame.scale -side bottom -expand yes -anchor n
$w.frame.scale set 75
Changes to library/demos/image1.tcl.
21
22
23
24
25
26
27
28

29
30
31
32
33

34
35
21
22
23
24
25
26
27

28
29
30
31
32

33
34
35







-
+




-
+


## See Code / Dismiss buttons
set btns [addSeeDismiss $w.buttons $w]
pack $btns -side bottom -fill x

# Main widget program sets variable tk_demoDirectory
catch {image delete image1a}
image create photo image1a -file [file join $tk_demoDirectory images earth.gif]
label $w.l1 -image image1a -bd 1 -relief sunken
label $w.l1 -image image1a -borderwidth 1 -relief sunken

catch {image delete image1b}
image create photo image1b \
	-file [file join $tk_demoDirectory images earthris.gif]
label $w.l2 -image image1b -bd 1 -relief sunken
label $w.l2 -image image1b -borderwidth 1 -relief sunken

pack $w.l1 $w.l2 -side top -padx .5m -pady .5m
Changes to library/demos/image2.tcl.
55
56
57
58
59
60
61
62

63
64
65
66
67
68
69
55
56
57
58
59
60
61

62
63
64
65
66
67
68
69







-
+







    global dirName

    set file [file join $dirName [$w.f.list get @$x,$y]]
    if {[catch {
	image2a configure -file $file
    }]} then {
	# Mark the file as not loadable
	$w.f.list itemconfigure @$x,$y -bg \#c00000 -selectbackground \#ff0000
	$w.f.list itemconfigure @$x,$y -background \#c00000 -selectbackground \#ff0000
    }
}

set w .image2
catch {destroy $w}
toplevel $w
wm title $w "Image Demonstration #2"
Changes to library/demos/menu.tcl.
23
24
25
26
27
28
29
30

31
32
33
34
35
36
37
23
24
25
26
27
28
29

30
31
32
33
34
35
36
37







-
+







} else {
    $w.msg configure -text "This window contains a menubar with cascaded menus.  You can post a menu from the keyboard by typing Alt+x, where \"x\" is the character underlined on the menu.  You can then traverse among the menus using the arrow keys.  When a menu is posted, you can invoke the current entry by typing space, or you can invoke any entry by typing its underlined character.  If a menu entry has an accelerator, you can invoke the entry without posting the menu just by typing the accelerator. The rightmost menu can be torn off into a palette by selecting the first item in the menu."
}
pack $w.msg -side top

set menustatus "    "
frame $w.statusBar
label $w.statusBar.label -textvariable menustatus -relief sunken -bd 1 -font "Helvetica 10" -anchor w
label $w.statusBar.label -textvariable menustatus -relief sunken -borderwidth 1 -font "Helvetica 10" -anchor w
pack $w.statusBar.label -side left -padx 2 -expand yes -fill both
pack $w.statusBar -side bottom -fill x -pady 2

## See Code / Dismiss buttons
set btns [addSeeDismiss $w.buttons $w]
pack $btns -side bottom -fill x

Changes to library/demos/msgbox.tcl.
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
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







-
+











-
+







#pack $w.buttons.dismiss $w.buttons.code $w.buttons.vars -side left -expand 1

frame $w.left
frame $w.right
pack $w.left $w.right -side left -expand yes -fill y  -pady .5c -padx .5c

label $w.left.label -text "Icon"
frame $w.left.sep -relief ridge -bd 1 -height 2
frame $w.left.sep -relief ridge -borderwidth 1 -height 2
pack $w.left.label -side top
pack $w.left.sep -side top -fill x -expand no

set msgboxIcon info
foreach i {error info question warning} {
    radiobutton $w.left.b$i -text $i -variable msgboxIcon \
	-relief flat -value $i -width 16 -anchor w
    pack $w.left.b$i  -side top -pady 2 -anchor w -fill x
}

label $w.right.label -text "Type"
frame $w.right.sep -relief ridge -bd 1 -height 2
frame $w.right.sep -relief ridge -borderwidth 1 -height 2
pack $w.right.label -side top
pack $w.right.sep -side top -fill x -expand no

set msgboxType ok
foreach t {abortretryignore ok okcancel retrycancel yesno yesnocancel} {
    radiobutton $w.right.$t -text $t -variable msgboxType \
	-relief flat -value $t -width 16 -anchor w
Changes to library/demos/paned1.tcl.
22
23
24
25
26
27
28
29
30


31
32
22
23
24
25
26
27
28


29
30
31
32







-
-
+
+


## See Code / Dismiss buttons
set btns [addSeeDismiss $w.buttons $w]
pack $btns -side bottom -fill x

panedwindow $w.pane
pack $w.pane -side top -expand yes -fill both -pady 2 -padx 2m

label $w.pane.left  -text "This is the\nleft side"  -fg black -bg yellow
label $w.pane.right -text "This is the\nright side" -fg black -bg cyan
label $w.pane.left  -text "This is the\nleft side"  -fg black -background yellow
label $w.pane.right -text "This is the\nright side" -fg black -background cyan

$w.pane add $w.pane.left $w.pane.right
Changes to library/demos/paned2.tcl.
49
50
51
52
53
54
55
56

57
58
59
60
61
62
63
49
50
51
52
53
54
55

56
57
58
59
60
61
62
63







-
+







    text
    toplevel
}
set f [frame $w.pane.top]
listbox $f.list -listvariable paneList -yscrollcommand "$f.scr set"
# Invert the first item to highlight it
$f.list itemconfigure 0 \
	-background [$f.list cget -fg] -foreground [$f.list cget -bg]
	-background [$f.list cget -fg] -color [$f.list cget -background]
ttk::scrollbar $f.scr -orient vertical -command "$f.list yview"
pack $f.scr -side right -fill y
pack $f.list -fill both -expand 1

# The bottom window is a text widget with scrollbar
set f [frame $w.pane.bottom]
text $f.text -xscrollcommand "$f.xscr set" -yscrollcommand "$f.yscr set" \
Changes to library/demos/pendulum.tcl.
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
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







-
+











-
+







# Create some structural widgets
pack [panedwindow $w.p] -fill both -expand 1
$w.p add [labelframe $w.p.l1 -text "Pendulum Simulation"]
$w.p add [labelframe $w.p.l2 -text "Phase Space"]

# Create the canvas containing the graphical representation of the
# simulated system.
canvas $w.c -width 320 -height 200 -background white -bd 2 -relief sunken
canvas $w.c -width 320 -height 200 -background white -borderwidth 2 -relief sunken
$w.c create text 5 5 -anchor nw -text "Click to Adjust Bob Start Position"
# Coordinates of these items don't matter; they will be set properly below
$w.c create line 0 25 320 25   -tags plate -fill grey50 -width 2
$w.c create oval 155 20 165 30 -tags pivot -fill grey50 -outline {}
$w.c create line 1 1 1 1       -tags rod   -fill black  -width 3
$w.c create oval 1 1 2 2       -tags bob   -fill yellow -outline black
pack $w.c -in $w.p.l1 -fill both -expand true

# Create the canvas containing the phase space graph; this consists of
# a line that gets gradually paler as it ages, which is an extremely
# effective visual trick.
canvas $w.k -width 320 -height 200 -background white -bd 2 -relief sunken
canvas $w.k -width 320 -height 200 -background white -borderwidth 2 -relief sunken
$w.k create line 160 200 160 0 -fill grey75 -arrow last -tags y_axis
$w.k create line 0 100 320 100 -fill grey75 -arrow last -tags x_axis
for {set i 90} {$i>=0} {incr i -10} {
    # Coordinates of these items don't matter; they will be set properly below
    $w.k create line 0 0 1 1 -smooth true -tags graph$i -fill grey$i
}

Changes to library/demos/puzzle.tcl.
60
61
62
63
64
65
66
67

68
69
70
71
72
73
74
75
76

77
78
79
80
81
82
60
61
62
63
64
65
66

67
68
69
70
71
72
73
74
75

76
77
78
79
80
81
82







-
+








-
+






if {[tk windowingsystem] eq "aqua"} {
    set frameSize 168
} else {
    set frameSize 120
}

frame $w.frame -width $frameSize -height $frameSize -borderwidth 2\
	-relief sunken -bg [$w.s cget -troughcolor]
	-relief sunken -background [$w.s cget -troughcolor]
pack $w.frame -side top -pady 1c -padx 1c
destroy $w.s

set order {3 1 6 2 5 7 15 13 4 11 8 9 14 10 12}
for {set i 0} {$i < 15} {set i [expr {$i+1}]} {
    set num [lindex $order $i]
    set xpos($num) [expr {($i%4)*.25}]
    set ypos($num) [expr {($i/4)*.25}]
    button $w.frame.$num -relief raised -text $num -bd 0 -highlightthickness 0 \
    button $w.frame.$num -relief raised -text $num -borderwidth 0 -highlightthickness 0 \
	    -command "puzzleSwitch $w $num"
    place $w.frame.$num -relx $xpos($num) -rely $ypos($num) \
	-relwidth .25 -relheight .25
}
set xpos(space) .75
set ypos(space) .75
Changes to library/demos/ruler.tcl.
69
70
71
72
73
74
75
76

77
78
79
80
81
82
83
69
70
71
72
73
74
75

76
77
78
79
80
81
82
83







-
+







    $c create line ${x}c 1c ${x}c 0.6c -width 1
    $c create line $x.25c 1c $x.25c 0.8c -width 1
    $c create line $x.5c 1c $x.5c 0.7c -width 1
    $c create line $x.75c 1c $x.75c 0.8c -width 1
    $c create text $x.15c .75c -text $i -anchor sw
}
$c addtag well withtag [$c create rect 13.2c 1c 13.8c 0.5c \
	-fill [lindex [$c config -bg] 4]]
	-fill [lindex [$c config -background] 4]]
$c addtag well withtag [rulerMkTab $c [winfo pixels $c 13.5c] \
	[winfo pixels $c .65c]]

$c bind well <Button-1> "rulerNewTab $c %x %y"
$c bind tab <Button-1> "rulerSelectTab $c %x %y"
bind $c <B1-Motion> "rulerMoveTab $c %x %y"
bind $c <ButtonRelease-1> "rulerReleaseTab $c"
Changes to library/demos/search.tcl.
114
115
116
117
118
119
120
121
122


123
124
125
126


127
128
129
130
131
132
133
114
115
116
117
118
119
120


121
122
123
124


125
126
127
128
129
130
131
132
133







-
-
+
+


-
-
+
+







pack $w.scroll -side right -fill y
pack $w.text -expand yes -fill both

# Set up display styles for text highlighting.

if {[winfo depth $w] > 1} {
    textToggle "$w.text tag configure search -background \
	    #ce5555 -foreground white" 800 "$w.text tag configure \
	    search -background {} -foreground {}" 200
	    #ce5555 -color white" 800 "$w.text tag configure \
	    search -background {} -color {}" 200
} else {
    textToggle "$w.text tag configure search -background \
	    black -foreground white" 800 "$w.text tag configure \
	    search -background {} -foreground {}" 200
	    black -color white" 800 "$w.text tag configure \
	    search -background {} -color {}" 200
}
$w.text insert 1.0 \
{This window demonstrates how to use the tagging facilities in text
widgets to implement a searching mechanism.  First, type a file name
in the top entry, then type <Return> or click on "Load File".  Then
type a string in the lower entry and type <Return> or click on
"Load File".  This will cause all of the instances of the string to
Changes to library/demos/spin.tcl.
34
35
36
37
38
39
40
41

42
43
44
45
46
47
48
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48







-
+








set australianCities {
    Canberra Sydney Melbourne Perth Adelaide Brisbane
    Hobart Darwin "Alice Springs"
}

spinbox $w.s1 -from 1 -to 10 -width 10 -validate key \
	-vcmd {string is integer %P}
	-validatecommand {string is integer %P}
spinbox $w.s2 -from 0 -to 3 -increment .5 -format %05.2f -width 10
spinbox $w.s3 -values $australianCities -width 10

#entry $w.e1
#entry $w.e2
#entry $w.e3
pack $w.s1 $w.s2 $w.s3 -side top -pady 5 -padx 10 ;#-fill x
Changes to library/demos/style.tcl.
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
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







-
+



-
-
+
+





-
-
-
+
+
+








$w.text tag configure bold -font "$family 12 bold italic"
$w.text tag configure big -font "$family 14 bold"
$w.text tag configure verybig -font "Helvetica 24 bold"
$w.text tag configure tiny -font "Times 8 bold"
if {[winfo depth $w] > 1} {
    $w.text tag configure color1 -background #a0b7ce
    $w.text tag configure color2 -foreground red
    $w.text tag configure color2 -color red
    $w.text tag configure raised -relief raised -borderwidth 1
    $w.text tag configure sunken -relief sunken -borderwidth 1
} else {
    $w.text tag configure color1 -background black -foreground white
    $w.text tag configure color2 -background black -foreground white
    $w.text tag configure color1 -background black -color white
    $w.text tag configure color2 -background black -color white
    $w.text tag configure raised -background white -relief raised \
	    -borderwidth 1
    $w.text tag configure sunken -background white -relief sunken \
	    -borderwidth 1
}
$w.text tag configure bgstipple -background black -borderwidth 0 \
	-bgstipple gray12
$w.text tag configure fgstipple -fgstipple gray50
$w.text tag configure backgroundstipple -background black -borderwidth 0 \
	-backgroundstipple gray12
$w.text tag configure stipple -stipple gray50
$w.text tag configure underline -underline on
$w.text tag configure overstrike -overstrike on
$w.text tag configure right -justify right
$w.text tag configure center -justify center
$w.text tag configure super -offset 4p -font "$family 10"
$w.text tag configure sub -offset -2p -font "$family 10"
$w.text tag configure margins -lmargin1 12m -lmargin2 6m -rmargin 10m
83
84
85
86
87
88
89
90

91
92

93
94
95
96
97
98
99
83
84
85
86
87
88
89

90
91

92
93
94
95
96
97
98
99







-
+

-
+







$w.text insert end " or "
$w.text insert end foreground color2
$w.text insert end "\ncolor, or "
$w.text insert end both {color1 color2}
$w.text insert end ".\n"
$w.text insert end "\n3. Stippling." big
$w.text insert end "  You can cause either the "
$w.text insert end background bgstipple
$w.text insert end background backgroundstipple
$w.text insert end " or "
$w.text insert end foreground fgstipple
$w.text insert end foreground stipple
$w.text insert end {
information to be drawn with a stipple fill instead of a solid fill.
}
$w.text insert end "\n4. Underlining." big
$w.text insert end "  You can "
$w.text insert end underline underline
$w.text insert end " ranges of text.\n"
Changes to library/demos/tcolor.
160
161
162
163
164
165
166
167

168
169
170
171
172
173
174
160
161
162
163
164
165
166

167
168
169
170
171
172
173
174







-
+







		    [expr {[.scale3 get]/1000.0}]]
	    set red [lindex $list 0]
	    set green [lindex $list 1]
	    set blue [lindex $list 2]
	}
    }
    set color [format "#%04x%04x%04x" $red $green $blue]
    .sample.swatch config -bg $color
    .sample.swatch config -background $color
    if {$autoUpdate} doUpdate
    update idletasks
}

# The procedure below is invoked to update the scales from the
# current red, green, and blue intensities.  It's invoked after
# a change in the color space and after a named color value has
223
224
225
226
227
228
229
230

231
232
233
234
235
236
237
223
224
225
226
227
228
229

230
231
232
233
234
235
236
237







-
+







	}
	set red   [expr {$red<<$shift}]
	set green [expr {$green<<$shift}]
	set blue  [expr {$blue<<$shift}]
    }
    tc_setScales
    set color [format "#%04x%04x%04x" $red $green $blue]
    .sample.swatch config -bg $color
    .sample.swatch config -background $color
    if {$autoUpdate} doUpdate
}

# The procedure below is invoked when a new color space is selected.
# It changes the labels on the scales and re-loads the scales with
# the appropriate values for the current color in the new color space

Changes to library/demos/ttkscale.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
20












-
+







# ttkscale.tcl --
#
# This demonstration script shows an example with a horizontal scale.

if {![info exists widgetDemo]} {
    error "This script should be run from the \"widget\" demo."
}

package require Tk

set w .ttkscale
catch {destroy $w}
toplevel $w -bg [ttk::style lookup TLabel -background]
toplevel $w -background [ttk::style lookup TLabel -background]
wm title $w "Themed Scale Demonstration"
wm iconname $w "ttkscale"
positionWindow $w

pack [ttk::frame [set w $w.contents]] -fill both -expand 1

ttk::label $w.msg -font $font -wraplength 3.5i -justify left -text "A label tied to a horizontal scale is displayed below.  If you click or drag mouse button 1 in the scale, you can change the contents of the label; a callback command is used to couple the slider to both the text and the coloring of the label."
28
29
30
31
32
33
34
35

36
37
38
39
28
29
30
31
32
33
34

35
36
37
38
39







-
+




pack $w.frame -side top -fill x

# List of colors from rainbox; "Indigo" is not a standard color
set colorList {Red Orange Yellow Green Blue Violet}
ttk::label $w.frame.label
ttk::scale $w.frame.scale -from 0 -to 5 -command [list apply {{w idx} {
    set c [lindex $::colorList [tcl::mathfunc::int $idx]]
    $w.frame.label configure -foreground $c -text "Color: $c"
    $w.frame.label configure -color $c -text "Color: $c"
}} $w]
# Trigger the setting of the label's text
$w.frame.scale set 0
pack $w.frame.label $w.frame.scale
Changes to library/demos/vscale.tcl.
23
24
25
26
27
28
29
30

31
32
33
34
35
36
37
23
24
25
26
27
28
29

30
31
32
33
34
35
36
37







-
+







pack $btns -side bottom -fill x

frame $w.frame -borderwidth 10
pack $w.frame

scale $w.frame.scale -orient vertical -length 284 -from 0 -to 250 \
	-command "setHeight $w.frame.canvas" -tickinterval 50
canvas $w.frame.canvas -width 50 -height 50 -bd 0 -highlightthickness 0
canvas $w.frame.canvas -width 50 -height 50 -borderwidth 0 -highlightthickness 0
$w.frame.canvas create polygon 0 0 1 1 2 2 -fill SeaGreen3 -tags poly
$w.frame.canvas create line 0 0 1 1 2 2 0 0 -fill black -tags line
frame $w.frame.right -borderwidth 15
pack $w.frame.scale -side left -anchor ne
pack $w.frame.canvas -side left -anchor nw -fill y
$w.frame.scale set 75

Changes to library/dialog.tcl.
70
71
72
73
74
75
76
77
78


79
80
81
82
83
84
85
70
71
72
73
74
75
76


77
78
79
80
81
82
83
84
85







-
-
+
+







    } elseif {$windowingsystem eq "x11"} {
	wm attributes $w -type dialog
    }

    frame $w.bot
    frame $w.top
    if {$windowingsystem eq "x11"} {
	$w.bot configure -relief raised -bd 1
	$w.top configure -relief raised -bd 1
	$w.bot configure -relief raised -borderwidth 1
	$w.top configure -relief raised -borderwidth 1
    }
    pack $w.bot -side bottom -fill both
    pack $w.top -side top -fill both -expand 1
    grid anchor $w.bot center

    # 2. Fill the top part with bitmap and message (use the option
    # database for -wraplength and -font so that they can be
Changes to library/iconlist.tcl.
262
263
264
265
266
267
268
269

270
271
272
273
274
275
276
262
263
264
265
266
267
268

269
270
271
272
273
274
275
276







-
+







	}

	if {$rTag < 0 || $rTag >= [llength $list]} {
	    return
	}

	set bbox [$canvas bbox item$rTag]
	set pad [expr {[$canvas cget -highlightthickness]+[$canvas cget -bd]}]
	set pad [expr {[$canvas cget -highlightthickness]+[$canvas cget -borderwidth]}]

	set x1 [lindex $bbox 0]
	set x2 [lindex $bbox 2]
	incr x1 [expr {$pad * -2}]
	incr x2 [expr {$pad * -1}]

	set cW [expr {[winfo width $canvas] - $pad*2}]
307
308
309
310
311
312
313
314

315
316
317
318
319
320
321
307
308
309
310
311
312
313

314
315
316
317
318
319
320
321







-
+







		$sbar configure -command ""
	    }
	    return
	}

	set W [winfo width  $canvas]
	set H [winfo height $canvas]
	set pad [expr {[$canvas cget -highlightthickness]+[$canvas cget -bd]}]
	set pad [expr {[$canvas cget -highlightthickness]+[$canvas cget -borderwidth]}]
	if {$pad < 2} {
	    set pad 2
	}

	incr W [expr {$pad*-2}]
	incr H [expr {$pad*-2}]

376
377
378
379
380
381
382
383

384
385
386
387
388
389
390
376
377
378
379
380
381
382

383
384
385
386
387
388
389
390







-
+







    }

    method DrawSelection {} {
	$canvas delete selection
	$canvas itemconfigure selectionText -fill black
	$canvas dtag selectionText
	set cbg [ttk::style lookup TEntry -selectbackground focus]
	set cfg [ttk::style lookup TEntry -selectforeground focus]
	set cfg [ttk::style lookup TEntry -selectcolor focus]
	foreach item $selection {
	    set rTag [lindex $list $item 2]
	    foreach {iTag tTag text serial} $itemList($rTag) {
		break
	    }

	    set bbox [$canvas bbox $tTag]
Changes to library/msgbox.tcl.
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
94
95
96
97
98
99
100

101
102
103
104
105
106
107
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
94
95
96
97
98
99

100
101
102
103
104
105
106
107







-
+













-
+













-
+













-
+













-
+













-
+













-
+







# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

# Ensure existence of ::tk::dialog namespace
#
namespace eval ::tk::dialog {}

image create bitmap ::tk::dialog::b1 -foreground black \
image create bitmap ::tk::dialog::b1 -color black \
-data "#define b1_width 32\n#define b1_height 32
static unsigned char q1_bits[] = {
   0x00, 0xf8, 0x1f, 0x00, 0x00, 0x07, 0xe0, 0x00, 0xc0, 0x00, 0x00, 0x03,
   0x20, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x10,
   0x04, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40,
   0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80,
   0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80,
   0x01, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40,
   0x04, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x08,
   0x60, 0x00, 0x00, 0x04, 0x80, 0x03, 0x80, 0x03, 0x00, 0x0c, 0x78, 0x00,
   0x00, 0x30, 0x04, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x40, 0x04, 0x00,
   0x00, 0x80, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};"
image create bitmap ::tk::dialog::b2 -foreground white \
image create bitmap ::tk::dialog::b2 -color white \
-data "#define b2_width 32\n#define b2_height 32
static unsigned char b2_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x00,
   0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x0f,
   0xf8, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
   0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f,
   0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f,
   0xfe, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
   0xf8, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0x07,
   0x80, 0xff, 0xff, 0x03, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xf0, 0x07, 0x00,
   0x00, 0xc0, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00,
   0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};"
image create bitmap ::tk::dialog::q -foreground blue \
image create bitmap ::tk::dialog::q -color blue \
-data "#define q_width 32\n#define q_height 32
static unsigned char q_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00,
   0x00, 0x10, 0x0f, 0x00, 0x00, 0x18, 0x1e, 0x00, 0x00, 0x38, 0x1e, 0x00,
   0x00, 0x38, 0x1e, 0x00, 0x00, 0x10, 0x0f, 0x00, 0x00, 0x80, 0x07, 0x00,
   0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00,
   0x00, 0xe0, 0x01, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};"
image create bitmap ::tk::dialog::i -foreground blue \
image create bitmap ::tk::dialog::i -color blue \
-data "#define i_width 32\n#define i_height 32
static unsigned char i_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0xe0, 0x01, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0x03, 0x00,
   0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0xf8, 0x03, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xe0, 0x03, 0x00,
   0x00, 0xe0, 0x03, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xe0, 0x03, 0x00,
   0x00, 0xe0, 0x03, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xf0, 0x07, 0x00,
   0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};"
image create bitmap ::tk::dialog::w1 -foreground black \
image create bitmap ::tk::dialog::w1 -color black \
-data "#define w1_width 32\n#define w1_height 32
static unsigned char w1_bits[] = {
   0x00, 0x80, 0x01, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x20, 0x04, 0x00,
   0x00, 0x10, 0x04, 0x00, 0x00, 0x10, 0x08, 0x00, 0x00, 0x08, 0x08, 0x00,
   0x00, 0x08, 0x10, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x04, 0x20, 0x00,
   0x00, 0x02, 0x20, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x01, 0x40, 0x00,
   0x00, 0x01, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x01,
   0x40, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00, 0x02,
   0x20, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x08,
   0x08, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x10,
   0x04, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x40,
   0x01, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x20,
   0xfc, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00};"
image create bitmap ::tk::dialog::w2 -foreground yellow \
image create bitmap ::tk::dialog::w2 -color yellow \
-data "#define w2_width 32\n#define w2_height 32
static unsigned char w2_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00,
   0x00, 0xe0, 0x03, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xf0, 0x07, 0x00,
   0x00, 0xf0, 0x0f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf8, 0x1f, 0x00,
   0x00, 0xfc, 0x1f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xfe, 0x3f, 0x00,
   0x00, 0xfe, 0x7f, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0xff, 0xff, 0x00,
   0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0x01,
   0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07,
   0xf0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0x0f,
   0xf8, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x1f, 0xfe, 0xff, 0xff, 0x3f,
   0xfe, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x1f,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};"
image create bitmap ::tk::dialog::w3 -foreground black \
image create bitmap ::tk::dialog::w3 -color black \
-data "#define w3_width 32\n#define w3_height 32
static unsigned char w3_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0xc0, 0x03, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,
   0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,
247
248
249
250
251
252
253
254

255
256
257
258
259
260
261
247
248
249
250
251
252
253

254
255
256
257
258
259
260
261







-
+







    # There is only one background colour for the whole dialog
    set bg [ttk::style lookup . -background]

    # 3. Create the top-level window and divide it into top
    # and bottom parts.

    catch {destroy $w}
    toplevel $w -class Dialog -bg $bg
    toplevel $w -class Dialog -background $bg
    wm title $w $data(-title)
    wm iconname $w Dialog
    wm protocol $w WM_DELETE_WINDOW [list $w.$cancel invoke]

    # Message boxes should be transient with respect to their parent so that
    # they always stay on top of the parent window.  But some window managers
    # will simply create the child window as withdrawn if the parent is not
Changes to library/palette.tcl.
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
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







-
+




















-
+





-
+

-
+


-
+




-
+


-
+


-
-
+
+







# color options for existing widgets that have the default value.
#
# Arguments:
# The arguments consist of either a single color name, which
# will be used as the new background color (all other colors will
# be computed from this) or an even number of values consisting of
# option names and values.  The name for an option is the one used
# for the option database, such as activeForeground, not -activeforeground.
# for the option database, such as activeColor, not -activecolor.

proc ::tk_setPalette {args} {
    if {[winfo depth .] == 1} {
	# Just return on monochrome displays, otherwise errors will occur
	return
    }

    # Create an array that has the complete new palette.  If some colors
    # aren't specified, compute them from other colors that are specified.

    if {[llength $args] == 1} {
	set new(background) [lindex $args 0]
    } else {
	array set new $args
    }
    if {![info exists new(background)]} {
	return -code error -errorcode {TK SET_PALETTE BACKGROUND} \
	    "must specify a background color"
    }
    set bg [winfo rgb . $new(background)]
    if {![info exists new(foreground)]} {
    if {![info exists new(color)]} {
	# Note that the range of each value in the triple returned by
	# [winfo rgb] is 0-65535, and your eyes are more sensitive to
	# green than to red, and more to red than to blue.
	foreach {r g b} $bg {break}
	if {$r+1.5*$g+0.5*$b > 100000} {
	    set new(foreground) black
	    set new(color) black
	} else {
	    set new(foreground) white
	    set new(color) white
	}
    }
    lassign [winfo rgb . $new(foreground)] fg_r fg_g fg_b
    lassign [winfo rgb . $new(color)] fg_r fg_g fg_b
    lassign $bg bg_r bg_g bg_b
    set darkerBg [format #%02x%02x%02x [expr {(9*$bg_r)/2560}] \
	    [expr {(9*$bg_g)/2560}] [expr {(9*$bg_b)/2560}]]

    foreach i {activeForeground insertBackground selectForeground \
    foreach i {activeColor insertBackground selectColor \
	    highlightColor} {
	if {![info exists new($i)]} {
	    set new($i) $new(foreground)
	    set new($i) $new(color)
	}
    }
    if {![info exists new(disabledForeground)]} {
	set new(disabledForeground) [format #%02x%02x%02x \
    if {![info exists new(disabledColor)]} {
	set new(disabledColor) [format #%02x%02x%02x \
		[expr {(3*$bg_r + $fg_r)/1024}] \
		[expr {(3*$bg_g + $fg_g)/1024}] \
		[expr {(3*$bg_b + $fg_b)/1024}]]
    }
    if {![info exists new(highlightBackground)]} {
	set new(highlightBackground) $new(background)
    }
231
232
233
234
235
236
237
238
239


240
241
242

243
244
231
232
233
234
235
236
237


238
239
240
241

242
243
244







-
-
+
+


-
+


# ::tk_bisque --
# Reset the Tk color palette to the old "bisque" colors.
#
# Arguments:
# None.

proc ::tk_bisque {} {
    tk_setPalette activeBackground #e6ceb1 activeForeground black \
	    background #ffe4c4 disabledForeground #b0b0b0 foreground black \
    tk_setPalette activeBackground #e6ceb1 activeColor black \
	    background #ffe4c4 disabledColor #b0b0b0 color black \
	    highlightBackground #ffe4c4 highlightColor black \
	    insertBackground black \
	    selectBackground #e6ceb1 selectForeground black \
	    selectBackground #e6ceb1 selectColor black \
	    troughColor #cdb79e
}
Changes to library/ttk/altTheme.tcl.
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
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












-
-
-
-
+
+
+
+







-
+


-
-
+
+




-
-
+
+







#
# Ttk widget set: Alternate theme
#

namespace eval ttk::theme::alt {

    variable colors
    array set colors {
	-frame 		"#d9d9d9"
	-window		"#ffffff"
	-darker 	"#c3c3c3"
	-border		"#414141"
	-activebg 	"#ececec"
	-disabledfg	"#a3a3a3"
	-selectbg	"#4a6984"
	-selectfg	"#ffffff"
	-activebackground	"#ececec"
	-disabledcolor	"#a3a3a3"
	-selectbackground	"#4a6984"
	-selectcolor	"#ffffff"
	-altindicator	"#aaaaaa"
    }

    ttk::style theme settings alt {

	ttk::style configure "." \
	    -background 	$colors(-frame) \
	    -foreground 	black \
	    -color 	black \
	    -troughcolor	$colors(-darker) \
	    -bordercolor	$colors(-border) \
	    -selectbackground 	$colors(-selectbg) \
	    -selectforeground 	$colors(-selectfg) \
	    -selectbackground 	$colors(-selectbackground) \
	    -selectcolor 	$colors(-selectcolor) \
	    -font 		TkDefaultFont \
	    ;

	ttk::style map "." -background \
	    [list disabled $colors(-frame)  active $colors(-activebg)] ;
	ttk::style map "." -foreground [list disabled $colors(-disabledfg)] ;
	    [list disabled $colors(-frame)  active $colors(-activebackground)] ;
	ttk::style map "." -color [list disabled $colors(-disabledcolor)] ;
        ttk::style map "." -embossed [list disabled 1] ;

	ttk::style configure TButton \
	    -anchor center -width -11 -padding "1 1" \
	    -relief raised -shiftrelief 1 \
	    -highlightthickness 1 -highlightcolor $colors(-frame)

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
94
95
96
97
98
99
100
101



102
103
104
105
106
107

108
109
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
94
95
96
97
98



99
100
101
102
103
104
105
106

107
108
109







-
+






-
+





-
+


















-
-
-
+
+
+





-
+



	ttk::style configure TEntry -padding 1
	ttk::style map TEntry -fieldbackground \
		[list readonly $colors(-frame) disabled $colors(-frame)]
	ttk::style configure TCombobox -padding 1
	ttk::style map TCombobox -fieldbackground \
		[list readonly $colors(-frame) disabled $colors(-frame)] \
		-arrowcolor [list disabled $colors(-disabledfg)]
		-arrowcolor [list disabled $colors(-disabledcolor)]
	ttk::style configure ComboboxPopdownFrame \
	    -relief solid -borderwidth 1

	ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0}
	ttk::style map TSpinbox -fieldbackground \
	    [list readonly $colors(-frame) disabled $colors(-frame)] \
	    -arrowcolor [list disabled $colors(-disabledfg)]
	    -arrowcolor [list disabled $colors(-disabledcolor)]

	ttk::style configure Toolbutton -relief flat -padding 2
	ttk::style map Toolbutton -relief \
	    {disabled flat selected sunken pressed sunken active raised}
	ttk::style map Toolbutton -background \
	    [list pressed $colors(-darker)  active $colors(-activebg)]
	    [list pressed $colors(-darker)  active $colors(-activebackground)]

	ttk::style configure TScrollbar -relief raised

	ttk::style configure TLabelframe -relief groove -borderwidth 2

	ttk::style configure TNotebook -tabmargins {2 2 1 0}
	ttk::style configure TNotebook.Tab \
	    -padding {4 2} -background $colors(-darker)
	ttk::style map TNotebook.Tab \
	    -background [list selected $colors(-frame)] \
	    -expand [list selected {2 2 1 0}] \
	    ;

	# Treeview:
	ttk::style configure Heading -font TkHeadingFont -relief raised
	ttk::style configure Treeview -background $colors(-window)
	ttk::style map Treeview \
	    -background [list disabled $colors(-frame)\
				selected $colors(-selectbg)] \
	    -foreground [list disabled $colors(-disabledfg) \
				selected $colors(-selectfg)]
				selected $colors(-selectbackground)] \
	    -color [list disabled $colors(-disabledcolor) \
				selected $colors(-selectcolor)]

	ttk::style configure TScale \
	    -groovewidth 4 -troughrelief sunken \
	    -sliderwidth raised -borderwidth 2
	ttk::style configure TProgressbar \
	    -background $colors(-selectbg) -borderwidth 0
	    -background $colors(-selectbackground) -borderwidth 0
    }
}
Changes to library/ttk/aquaTheme.tcl.
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
94
95

96
97
98
99
100
101
102
103
104
105
106
107

108
109
110
111

112
113
114
115
116
117
118
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
94

95
96
97
98
99
100
101
102
103
104
105
106

107
108
109
110

111
112
113
114
115
116
117
118










-
+

-
+




-
+





-
+





-
+

-
+







-
+


-
+


-
+
















-
+

-
+






-
+


-
+


-
+








-
+

-
+


-
+


-
+











-
+



-
+







#
# Aqua theme (OSX native look and feel)
#

namespace eval ttk::theme::aqua {
    ttk::style theme settings aqua {

	ttk::style configure . \
	    -font TkDefaultFont \
	    -background systemWindowBackgroundColor \
	    -foreground systemLabelColor \
	    -color systemLabelColor \
	    -selectbackground systemSelectedTextBackgroundColor \
	    -selectforeground systemSelectedTextColor \
	    -selectcolor systemSelectedTextColor \
	    -selectborderwidth 0 \
	    -insertwidth 1

	ttk::style map . \
	    -foreground {
	    -color {
		disabled systemDisabledControlTextColor
		background systemLabelColor} \
	    -selectbackground {
		background systemSelectedTextBackgroundColor
		!focus systemSelectedTextBackgroundColor} \
	    -selectforeground {
	    -selectcolor {
		background systemSelectedTextColor
		!focus systemSelectedTextColor}

	# Button
	ttk::style configure TButton -anchor center -width -6 \
	    -foreground systemControlTextColor
	    -color systemControlTextColor
	ttk::style map TButton \
	    -foreground {
	    -color {
		pressed white
	        {alternate !pressed !background} white}
	ttk::style configure TMenubutton -anchor center -padding {2 0 0 2}
	ttk::style configure Toolbutton -anchor center

	# Entry
	ttk::style configure TEntry \
	    -foreground systemTextColor \
	    -color systemTextColor \
	    -background systemTextBackgroundColor
	ttk::style map TEntry \
	    -foreground {
	    -color {
		disabled systemDisabledControlTextColor
	    } \
	    -selectforeground {
	    -selectcolor {
		background systemTextColor
	    } \
	    -selectbackground {
		background systemTextBackgroundColor
	    }


	# Workaround for #1100117:
	# Actually, on Aqua we probably shouldn't stipple images in
	# disabled buttons even if it did work...
	ttk::style configure . -stipple {}

	# Notebook
	ttk::style configure TNotebook -tabmargins {10 0} -tabposition n
	ttk::style configure TNotebook -padding {18 8 18 17}
	ttk::style configure TNotebook.Tab -padding {12 3 12 2}
	ttk::style configure TNotebook.Tab -foreground systemControlTextColor
	ttk::style configure TNotebook.Tab -color systemControlTextColor
	ttk::style map TNotebook.Tab \
	    -foreground {
	    -color {
		background systemControlTextColor
		disabled systemDisabledControlTextColor
		selected systemSelectedTabTextColor}

	# Combobox:
	ttk::style configure TCombobox \
	    -foreground systemTextColor \
	    -color systemTextColor \
	    -background systemTransparent
	ttk::style map TCombobox \
	    -foreground {
	    -color {
		disabled systemDisabledControlTextColor
	    } \
	    -selectforeground {
	    -selectcolor {
		background systemTextColor
	    } \
	    -selectbackground {
		background systemTransparent
	    }

	# Spinbox
	ttk::style configure TSpinbox \
	    -foreground systemTextColor \
	    -color systemTextColor \
	    -background systemTextBackgroundColor \
	    -selectforeground systemSelectedTextColor \
	    -selectcolor systemSelectedTextColor \
	    -selectbackground systemSelectedTextBackgroundColor
	ttk::style map TSpinbox \
	    -foreground {
	    -color {
		disabled systemDisabledControlTextColor
	    } \
	    -selectforeground {
	    -selectcolor {
		!active systemTextColor
	    } \
	    -selectbackground {
		!active systemTextBackgroundColor
		!focus systemTextBackgroundColor
		focus systemSelectedTextBackgroundColor
	    }

	# Treeview:
	ttk::style configure Heading \
	    -font TkHeadingFont \
	    -foreground systemTextColor \
	    -color systemTextColor \
	    -background systemWindowBackgroundColor
	ttk::style configure Treeview -rowheight 18 \
	    -background systemTextBackgroundColor \
	    -foreground systemTextColor \
	    -color systemTextColor \
	    -fieldbackground systemTextBackgroundColor
	ttk::style map Treeview \
	    -background {
		selected systemSelectedTextBackgroundColor
	    }

	# Enable animation for ttk::progressbar widget:
Changes to library/ttk/clamTheme.tcl.
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
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









-
+







-
-
+
+








-
+




-
-
+
+







-
+

-
+







#
# "Clam" theme.
#
# Inspired by the XFCE family of Gnome themes.
#

namespace eval ttk::theme::clam {
    variable colors
    array set colors {
	-disabledfg		"#999999"
	-disabledcolor		"#999999"
	-frame  		"#dcdad5"
	-window  		"#ffffff"
	-dark			"#cfcdc8"
	-darker 		"#bab5ab"
	-darkest		"#9e9a91"
	-lighter		"#eeebe7"
	-lightest 		"#ffffff"
	-selectbg		"#4a6984"
	-selectfg		"#ffffff"
	-selectbackground		"#4a6984"
	-selectcolor		"#ffffff"
	-altindicator		"#5895bc"
	-disabledaltindicator	"#a0a0a0"
    }

    ttk::style theme settings clam {

	ttk::style configure "." \
	    -background $colors(-frame) \
	    -foreground black \
	    -color black \
	    -bordercolor $colors(-darkest) \
	    -darkcolor $colors(-dark) \
	    -lightcolor $colors(-lighter) \
	    -troughcolor $colors(-darker) \
	    -selectbackground $colors(-selectbg) \
	    -selectforeground $colors(-selectfg) \
	    -selectbackground $colors(-selectbackground) \
	    -selectcolor $colors(-selectcolor) \
	    -selectborderwidth 0 \
	    -font TkDefaultFont \
	    ;

	ttk::style map "." \
	    -background [list disabled $colors(-frame) \
			     active $colors(-lighter)] \
	    -foreground [list disabled $colors(-disabledfg)] \
	    -color [list disabled $colors(-disabledcolor)] \
	    -selectbackground [list  !focus $colors(-darkest)] \
	    -selectforeground [list  !focus white] \
	    -selectcolor [list  !focus white] \
	    ;
	# -selectbackground [list  !focus "#847d73"]

	ttk::style configure TButton \
	    -anchor center -width -11 -padding 5 -relief raised
	ttk::style map TButton \
	    -background [list \
94
95
96
97
98
99
100
101

102
103
104
105
106
107
108
109
110

111
112
113


114
115
116
117
118
119
120

121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137



138
139
140
141
142
143
144
145
146
147
94
95
96
97
98
99
100

101
102
103
104
105
106
107
108
109

110
111


112
113
114
115
116
117
118
119

120
121
122
123
124
125
126
127
128
129
130
131
132
133
134



135
136
137
138
139
140
141
142
143
144
145
146
147







-
+








-
+

-
-
+
+






-
+














-
-
-
+
+
+











	ttk::style configure TMenubutton \
	    -width -11 -padding 5 -relief raised

	ttk::style configure TEntry -padding 1 -insertwidth 1
	ttk::style map TEntry \
	    -background [list  readonly $colors(-frame)] \
	    -bordercolor [list  focus $colors(-selectbg)] \
	    -bordercolor [list  focus $colors(-selectbackground)] \
	    -lightcolor [list  focus "#6f9dc6"] \
	    -darkcolor [list  focus "#6f9dc6"] \
	    ;

	ttk::style configure TCombobox -padding 1 -insertwidth 1
	ttk::style map TCombobox \
	    -background [list active $colors(-lighter) \
			     pressed $colors(-lighter)] \
	    -fieldbackground [list {readonly focus} $colors(-selectbg) \
	    -fieldbackground [list {readonly focus} $colors(-selectbackground) \
				  readonly $colors(-frame)] \
	    -foreground [list {readonly focus} $colors(-selectfg)] \
	    -arrowcolor [list disabled $colors(-disabledfg)]
	    -color [list {readonly focus} $colors(-selectcolor)] \
	    -arrowcolor [list disabled $colors(-disabledcolor)]
	ttk::style configure ComboboxPopdownFrame \
	    -relief solid -borderwidth 1

	ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0}
	ttk::style map TSpinbox \
	    -background [list  readonly $colors(-frame)] \
            -arrowcolor [list disabled $colors(-disabledfg)]
            -arrowcolor [list disabled $colors(-disabledcolor)]

	ttk::style configure TNotebook.Tab -padding {6 2 6 2}
	ttk::style map TNotebook.Tab \
	    -padding [list selected {6 4 6 2}] \
	    -background [list selected $colors(-frame) {} $colors(-darker)] \
	    -lightcolor [list selected $colors(-lighter) {} $colors(-dark)] \
	    ;

	# Treeview:
	ttk::style configure Heading \
	    -font TkHeadingFont -relief raised -padding {3}
	ttk::style configure Treeview -background $colors(-window)
	ttk::style map Treeview \
	    -background [list disabled $colors(-frame)\
				selected $colors(-selectbg)] \
	    -foreground [list disabled $colors(-disabledfg) \
				selected $colors(-selectfg)]
				selected $colors(-selectbackground)] \
	    -color [list disabled $colors(-disabledcolor) \
				selected $colors(-selectcolor)]

    	ttk::style configure TLabelframe \
	    -labeloutside true -labelmargins {0 0 0 4} \
	    -borderwidth 2 -relief raised

	ttk::style configure TProgressbar -background $colors(-frame)

	ttk::style configure Sash -sashthickness 6 -gripcount 10
    }
}
Changes to library/ttk/classicTheme.tcl.
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
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











-
-
-
-
-
+
+
+
+
+








-
-
-
-
+
+
+
+











-
-
-
+
+
+







#
# "classic" Tk theme.
#
# Implements Tk's traditional Motif-like look and feel.
#

namespace eval ttk::theme::classic {

    variable colors; array set colors {
	-frame		"#d9d9d9"
	-window		"#ffffff"
	-activebg	"#ececec"
	-troughbg	"#c3c3c3"
	-selectbg	"#c3c3c3"
	-selectfg	"#000000"
	-disabledfg	"#a3a3a3"
	-activebackground	"#ececec"
	-troughbackground	"#c3c3c3"
	-selectbackground	"#c3c3c3"
	-selectcolor	"#000000"
	-disabledcolor	"#a3a3a3"
	-indicator	"#b03060"
	-altindicator	"#b05e5e"
    }

    ttk::style theme settings classic {
	ttk::style configure "." \
	    -font		TkDefaultFont \
	    -background		$colors(-frame) \
	    -foreground		black \
	    -selectbackground	$colors(-selectbg) \
	    -selectforeground	$colors(-selectfg) \
	    -troughcolor	$colors(-troughbg) \
	    -color		black \
	    -selectbackground	$colors(-selectbackground) \
	    -selectcolor	$colors(-selectcolor) \
	    -troughcolor	$colors(-troughbackground) \
	    -indicatorcolor	$colors(-frame) \
	    -highlightcolor	$colors(-frame) \
	    -highlightthickness	1 \
	    -selectborderwidth	1 \
	    -insertwidth	2 \
	    ;

	# To match pre-Xft X11 appearance, use:
	#	ttk::style configure . -font {Helvetica 12 bold}

	ttk::style map "." -background \
	    [list disabled $colors(-frame) active $colors(-activebg)]
	ttk::style map "." -foreground \
	    [list disabled $colors(-disabledfg)]
	    [list disabled $colors(-frame) active $colors(-activebackground)]
	ttk::style map "." -color \
	    [list disabled $colors(-disabledcolor)]

	ttk::style map "." -highlightcolor [list focus black]

	ttk::style configure TButton \
	    -anchor center -padding "3m 1m" -relief raised -shiftrelief 1
	ttk::style map TButton -relief [list {!disabled pressed} sunken]

87
88
89
90
91
92
93
94

95
96
97
98
99
100
101
102
103
104



105
106
107
108
109
110
111
112
113

114
115
87
88
89
90
91
92
93

94
95
96
97
98
99
100
101



102
103
104
105
106
107
108
109
110
111
112

113
114
115







-
+







-
-
-
+
+
+








-
+



	ttk::style configure TScale -sliderrelief raised
	ttk::style map TScale -sliderrelief {{pressed !disabled} sunken}

	ttk::style configure TProgressbar -background SteelBlue
	ttk::style configure TNotebook.Tab \
	    -padding {3m 1m} \
	    -background $colors(-troughbg)
	    -background $colors(-troughbackground)
	ttk::style map TNotebook.Tab -background [list selected $colors(-frame)]

	# Treeview:
	ttk::style configure Heading -font TkHeadingFont -relief raised
	ttk::style configure Treeview -background $colors(-window)
	ttk::style map Treeview \
	    -background [list disabled $colors(-frame)\
				selected $colors(-selectbg)] \
	    -foreground [list disabled $colors(-disabledfg) \
				selected $colors(-selectfg)]
				selected $colors(-selectbackground)] \
	    -color [list disabled $colors(-disabledcolor) \
				selected $colors(-selectcolor)]

	#
	# Toolbar buttons:
	#
	ttk::style configure Toolbutton -padding 2 -relief flat -shiftrelief 2
	ttk::style map Toolbutton -relief \
	    {disabled flat selected sunken pressed sunken active raised}
	ttk::style map Toolbutton -background \
	    [list pressed $colors(-troughbg)  active $colors(-activebg)]
	    [list pressed $colors(-troughbackground)  active $colors(-activebackground)]
    }
}
Changes to library/ttk/defaults.tcl.
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
94

95
96
97
98
99

100
101
102
103
104
105
106
107
108
109
110
111

112
113
114
115
116



117
118
119
120
121
122
123
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

94
95
96
97
98

99
100
101
102
103
104
105
106
107
108
109
110

111
112
113



114
115
116
117
118
119
120
121
122
123








-
+


-
-
-
+
+
+

-
+











-
+



-
-
+
+





-
-
-
+
+
+









-
+










-
+


















-
+




-
+







-
+




-
+











-
+


-
-
-
+
+
+







#
# Settings for default theme.
#

namespace eval ttk::theme::default {
    variable colors
    array set colors {
	-frame			"#d9d9d9"
	-foreground		"#000000"
	-color		"#000000"
	-window			"#ffffff"
	-text   		"#000000"
	-activebg		"#ececec"
	-selectbg		"#4a6984"
	-selectfg		"#ffffff"
	-activebackground		"#ececec"
	-selectbackground		"#4a6984"
	-selectcolor		"#ffffff"
	-darker 		"#c3c3c3"
	-disabledfg		"#a3a3a3"
	-disabledcolor		"#a3a3a3"
	-indicator		"#4a6984"
	-disabledindicator	"#a3a3a3"
	-altindicator		"#9fbdd8"
	-disabledaltindicator	"#c0c0c0"
    }

    ttk::style theme settings default {

	ttk::style configure "." \
	    -borderwidth 	1 \
	    -background 	$colors(-frame) \
	    -foreground 	$colors(-foreground) \
	    -color 	$colors(-color) \
	    -troughcolor 	$colors(-darker) \
	    -font 		TkDefaultFont \
	    -selectborderwidth	1 \
	    -selectbackground	$colors(-selectbg) \
	    -selectforeground	$colors(-selectfg) \
	    -selectbackground	$colors(-selectbackground) \
	    -selectcolor	$colors(-selectcolor) \
	    -insertwidth 	1 \
	    -indicatordiameter	10 \
	    ;

	ttk::style map "." -background \
	    [list disabled $colors(-frame)  active $colors(-activebg)]
	ttk::style map "." -foreground \
	    [list disabled $colors(-disabledfg)]
	    [list disabled $colors(-frame)  active $colors(-activebackground)]
	ttk::style map "." -color \
	    [list disabled $colors(-disabledcolor)]

	ttk::style configure TButton \
	    -anchor center -padding "3 3" -width -9 \
	    -relief raised -shiftrelief 1
	ttk::style map TButton -relief [list {!disabled pressed} sunken]

	ttk::style configure TCheckbutton \
	    -indicatorcolor "#ffffff" -indicatorrelief sunken -padding 1
	ttk::style map TCheckbutton -indicatorcolor \
	    [list pressed $colors(-activebg)  \
	    [list pressed $colors(-activebackground)  \
			{!disabled alternate} $colors(-altindicator) \
			{disabled alternate} $colors(-disabledaltindicator) \
			{!disabled selected} $colors(-indicator) \
			{disabled selected} $colors(-disabledindicator)]
	ttk::style map TCheckbutton -indicatorrelief \
	    [list alternate raised]

	ttk::style configure TRadiobutton \
	    -indicatorcolor "#ffffff" -indicatorrelief sunken -padding 1
	ttk::style map TRadiobutton -indicatorcolor \
	    [list pressed $colors(-activebg)  \
	    [list pressed $colors(-activebackground)  \
			{!disabled alternate} $colors(-altindicator) \
			{disabled alternate} $colors(-disabledaltindicator) \
			{!disabled selected} $colors(-indicator) \
			{disabled selected} $colors(-disabledindicator)]
	ttk::style map TRadiobutton -indicatorrelief \
	    [list alternate raised]

	ttk::style configure TMenubutton \
	    -relief raised -padding "10 3"

	ttk::style configure TEntry \
	    -relief sunken -fieldbackground white -padding 1
	ttk::style map TEntry -fieldbackground \
	    [list readonly $colors(-frame) disabled $colors(-frame)]

	ttk::style configure TCombobox -arrowsize 12 -padding 1
	ttk::style map TCombobox -fieldbackground \
	    [list readonly $colors(-frame) disabled $colors(-frame)] \
	    -arrowcolor [list disabled $colors(-disabledfg)]
	    -arrowcolor [list disabled $colors(-disabledcolor)]

	ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0}
	ttk::style map TSpinbox -fieldbackground \
	    [list readonly $colors(-frame) disabled $colors(-frame)] \
	    -arrowcolor [list disabled $colors(-disabledfg)]
	    -arrowcolor [list disabled $colors(-disabledcolor)]

	ttk::style configure TLabelframe \
	    -relief groove -borderwidth 2

	ttk::style configure TScrollbar \
	    -width 12 -arrowsize 12
	ttk::style map TScrollbar \
	    -arrowcolor [list disabled $colors(-disabledfg)]
	    -arrowcolor [list disabled $colors(-disabledcolor)]

	ttk::style configure TScale \
	    -sliderrelief raised
	ttk::style configure TProgressbar \
	    -background $colors(-selectbg)
	    -background $colors(-selectbackground)

	ttk::style configure TNotebook.Tab \
	    -padding {4 2} -background $colors(-darker)
	ttk::style map TNotebook.Tab \
	    -background [list selected $colors(-frame)]

	# Treeview.
	#
	ttk::style configure Heading -font TkHeadingFont -relief raised
	ttk::style configure Treeview \
	    -background $colors(-window) \
	    -foreground $colors(-text) ;
	    -color $colors(-text) ;
	ttk::style map Treeview \
	    -background [list disabled $colors(-frame)\
				selected $colors(-selectbg)] \
	    -foreground [list disabled $colors(-disabledfg) \
				selected $colors(-selectfg)]
				selected $colors(-selectbackground)] \
	    -color [list disabled $colors(-disabledcolor) \
				selected $colors(-selectcolor)]

	# Combobox popdown frame
	ttk::style layout ComboboxPopdownFrame {
	    ComboboxPopdownFrame.border -sticky nswe
	}
 	ttk::style configure ComboboxPopdownFrame \
	    -borderwidth 1 -relief solid
134
135
136
137
138
139
140
141

142
143
134
135
136
137
138
139
140

141
142
143







-
+


	}

	ttk::style configure Toolbutton \
	    -padding 2 -relief flat
	ttk::style map Toolbutton -relief \
	    [list disabled flat selected sunken pressed sunken active raised]
	ttk::style map Toolbutton -background \
	    [list pressed $colors(-darker)  active $colors(-activebg)]
	    [list pressed $colors(-darker)  active $colors(-activebackground)]
    }
}
Changes to library/ttk/vistaTheme.tcl.
14
15
16
17
18
19
20
21
22


23
24
25
26
27
28
29

30
31
32
33
34
35
36
14
15
16
17
18
19
20


21
22
23
24
25
26
27
28

29
30
31
32
33
34
35
36







-
-
+
+






-
+








namespace eval ttk::theme::vista {

    ttk::style theme settings vista {

 	ttk::style configure . \
	    -background SystemButtonFace \
	    -foreground SystemWindowText \
	    -selectforeground SystemHighlightText \
	    -color SystemWindowText \
	    -selectcolor SystemHighlightText \
	    -selectbackground SystemHighlight \
	    -insertcolor SystemWindowText \
	    -font TkDefaultFont \
	    ;

	ttk::style map "." \
	    -foreground [list disabled SystemGrayText] \
	    -color [list disabled SystemGrayText] \
	    ;

	ttk::style configure TButton -anchor center -padding {1 1} -width -11
	ttk::style configure TRadiobutton -padding 2
	ttk::style configure TCheckbutton -padding 2
	ttk::style configure TMenubutton -padding {8 4}

45
46
47
48
49
50
51
52

53
54
55
56

57
58
59
60
61
62
63
45
46
47
48
49
50
51

52
53
54
55

56
57
58
59
60
61
62
63







-
+



-
+








	# Treeview:
	ttk::style configure Heading -font TkHeadingFont
	ttk::style configure Treeview -background SystemWindow
	ttk::style map Treeview \
	    -background [list   disabled SystemButtonFace \
				selected SystemHighlight] \
	    -foreground [list   disabled SystemGrayText \
	    -color [list   disabled SystemGrayText \
				selected SystemHighlightText]

        # Label and Toolbutton
	ttk::style configure TLabelframe.Label -foreground SystemButtonText
	ttk::style configure TLabelframe.Label -color SystemButtonText

	ttk::style configure Toolbutton -padding {4 4}

        # Combobox
	ttk::style configure TCombobox -padding 2
        ttk::style element create Combobox.border vsapi \
            COMBOBOX 4 {disabled 4 focus 3 active 2 hover 2 {} 1}
84
85
86
87
88
89
90
91
92


93
94
95
96
97
98
99
84
85
86
87
88
89
90


91
92
93
94
95
96
97
98
99







-
-
+
+







        ttk::style layout ComboboxPopdownFrame {
            ComboboxPopdownFrame.background -sticky news -border 1 -children {
                ComboboxPopdownFrame.padding -sticky news
            }
        }
	ttk::style map TCombobox \
	    -selectbackground [list !focus SystemWindow] \
	    -selectforeground [list !focus SystemWindowText] \
	    -foreground	[list \
	    -selectcolor [list !focus SystemWindowText] \
	    -color	[list \
		disabled		SystemGrayText \
	    	{readonly focus}	SystemHighlightText \
	    ] \
	    -focusfill	[list {readonly focus} SystemHighlight] \
	    ;

        # Entry
109
110
111
112
113
114
115
116

117
118
119
120
121
122
123
109
110
111
112
113
114
115

116
117
118
119
120
121
122
123







-
+







                        Entry.textarea -sticky news
                    }
                }
            }
        }
	ttk::style map TEntry \
	    -selectbackground [list !focus SystemWindow] \
	    -selectforeground [list !focus SystemWindowText] \
	    -selectcolor [list !focus SystemWindowText] \
	    ;

        # Spinbox
        ttk::style configure TSpinbox -padding 0
        ttk::style element create Spinbox.field vsapi \
            EDIT 9 {disabled 4 focus 3 hover 2 {} 1} -padding {1 1 1 2}
        ttk::style element create Spinbox.background vsapi \
144
145
146
147
148
149
150
151

152
153
154
155
156
157
158
144
145
146
147
148
149
150

151
152
153
154
155
156
157
158







-
+







                    Spinbox.uparrow -side top -sticky ens
                    Spinbox.downarrow -side bottom -sticky ens
                }
            }
        }
	ttk::style map TSpinbox \
	    -selectbackground [list !focus SystemWindow] \
	    -selectforeground [list !focus SystemWindowText] \
	    -selectcolor [list !focus SystemWindowText] \
	    ;


        # SCROLLBAR elements (Vista includes a state for 'hover')
        ttk::style element create Vertical.Scrollbar.uparrow vsapi \
            SCROLLBAR 1 {disabled 4 pressed 3 active 2 hover 17 {} 1} \
            -syssize {SM_CXVSCROLL SM_CYVSCROLL}
Changes to library/ttk/winTheme.tcl.
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
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









-
-
+
+







-
+

















-
+





-
+



-
+







#
# Settings for 'winnative' theme.
#

namespace eval ttk::theme::winnative {
    ttk::style theme settings winnative {

	ttk::style configure "." \
	    -background SystemButtonFace \
	    -foreground SystemWindowText \
	    -selectforeground SystemHighlightText \
	    -color SystemWindowText \
	    -selectcolor SystemHighlightText \
	    -selectbackground SystemHighlight \
	    -fieldbackground SystemWindow \
	    -insertcolor SystemWindowText \
	    -troughcolor SystemScrollbar \
	    -font TkDefaultFont \
	    ;

	ttk::style map "." -foreground [list disabled SystemGrayText] ;
	ttk::style map "." -color [list disabled SystemGrayText] ;
        ttk::style map "." -embossed [list disabled 1] ;

	ttk::style configure TButton \
	    -anchor center -width -11 -relief raised -shiftrelief 1
	ttk::style configure TCheckbutton -padding "2 4"
	ttk::style configure TRadiobutton -padding "2 4"
	ttk::style configure TMenubutton \
	    -padding "8 4" -arrowsize 3 -relief raised

	ttk::style map TButton -relief {{!disabled pressed} sunken}

	ttk::style configure TEntry \
	    -padding 2 -selectborderwidth 0 -insertwidth 1
	ttk::style map TEntry \
	    -fieldbackground \
	    	[list readonly SystemButtonFace disabled SystemButtonFace] \
	    -selectbackground [list !focus SystemWindow] \
	    -selectforeground [list !focus SystemWindowText] \
	    -selectcolor [list !focus SystemWindowText] \
	    ;

	ttk::style configure TCombobox -padding 2
	ttk::style map TCombobox \
	    -selectbackground [list !focus SystemWindow] \
	    -selectforeground [list !focus SystemWindowText] \
	    -selectcolor [list !focus SystemWindowText] \
	    -fieldbackground [list \
	    	readonly SystemButtonFace \
		disabled SystemButtonFace] \
	    -foreground	[list \
	    -color	[list \
		disabled		SystemGrayText \
	    	{readonly focus}	SystemHighlightText \
	    ] \
	    -focusfill	[list {readonly focus} SystemHighlight] \
	    ;

	ttk::style element create ComboboxPopdownFrame.border from default
71
72
73
74
75
76
77
78

79
80
81
82
83
84
71
72
73
74
75
76
77

78
79
80
81
82
83
84







-
+







	# Treeview:
	ttk::style configure Heading -font TkHeadingFont -relief raised
	ttk::style configure Treeview -background SystemWindow
	ttk::style map Treeview \
	    -background [list   disabled SystemButtonFace \
				selected SystemHighlight] \
	    -foreground [list   disabled SystemGrayText \
	    -color [list   disabled SystemGrayText \
				selected SystemHighlightText]

        ttk::style configure TProgressbar \
	    -background SystemHighlight -borderwidth 0 ;
    }
}
Changes to library/ttk/xpTheme.tcl.
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
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










-
-
+
+






-
+











-
+





-
+




-
-
+
+









-
+










-
+



#
# Settings for 'xpnative' theme
#

namespace eval ttk::theme::xpnative {

    ttk::style theme settings xpnative {

	ttk::style configure . \
	    -background SystemButtonFace \
	    -foreground SystemWindowText \
	    -selectforeground SystemHighlightText \
	    -color SystemWindowText \
	    -selectcolor SystemHighlightText \
	    -selectbackground SystemHighlight \
	    -insertcolor SystemWindowText \
	    -font TkDefaultFont \
	    ;

	ttk::style map "." \
	    -foreground [list disabled SystemGrayText] \
	    -color [list disabled SystemGrayText] \
	    ;

	ttk::style configure TButton -anchor center -padding {1 1} -width -11
	ttk::style configure TRadiobutton -padding 2
	ttk::style configure TCheckbutton -padding 2
	ttk::style configure TMenubutton -padding {8 4}

	ttk::style configure TNotebook -tabmargins {2 2 2 0}
	ttk::style map TNotebook.Tab \
	    -expand [list selected {2 2 2 2}]

	ttk::style configure TLabelframe.Label -foreground "#0046d5"
	ttk::style configure TLabelframe.Label -color "#0046d5"

	# OR: -padding {3 3 3 6}, which some apps seem to use.
	ttk::style configure TEntry -padding {2 2 2 4}
	ttk::style map TEntry \
	    -selectbackground [list !focus SystemWindow] \
	    -selectforeground [list !focus SystemWindowText] \
	    -selectcolor [list !focus SystemWindowText] \
	    ;
	ttk::style configure TCombobox -padding 2
	ttk::style map TCombobox \
	    -selectbackground [list !focus SystemWindow] \
	    -selectforeground [list !focus SystemWindowText] \
	    -foreground	[list \
	    -selectcolor [list !focus SystemWindowText] \
	    -color	[list \
		disabled		SystemGrayText \
	    	{readonly focus}	SystemHighlightText \
	    ] \
	    -focusfill	[list {readonly focus} SystemHighlight] \
	    ;

	ttk::style configure TSpinbox -padding {2 0 14 0}
	ttk::style map TSpinbox \
	    -selectbackground [list !focus SystemWindow] \
	    -selectforeground [list !focus SystemWindowText] \
	    -selectcolor [list !focus SystemWindowText] \
	    ;

	ttk::style configure Toolbutton -padding {4 4}

	# Treeview:
	ttk::style configure Heading -font TkHeadingFont -relief raised
	ttk::style configure Treeview -background SystemWindow
	ttk::style map Treeview \
	    -background [list   disabled SystemButtonFace \
				selected SystemHighlight] \
	    -foreground [list   disabled SystemGrayText \
	    -color [list   disabled SystemGrayText \
				selected SystemHighlightText];
    }
}
Changes to library/xmfbox.tcl.
323
324
325
326
327
328
329
330
331


332
333
334
335
336
337
338
323
324
325
326
327
328
329


330
331
332
333
334
335
336
337
338







-
-
+
+







proc ::tk::MotifFDialog_BuildUI {w} {
    set dataName [lindex [split $w .] end]
    upvar ::tk::dialog::file::$dataName data

    # Create the dialog toplevel and internal frames.
    #
    toplevel $w -class TkMotifFDialog
    set top [frame $w.top -relief raised -bd 1]
    set bot [frame $w.bot -relief raised -bd 1]
    set top [frame $w.top -relief raised -borderwidth 1]
    set bot [frame $w.bot -relief raised -borderwidth 1]

    pack $w.bot -side bottom -fill x
    pack $w.top -side top -expand yes -fill both

    set f1 [frame $top.f1]
    set f2 [frame $top.f2]
    set f3 [frame $top.f3]
Changes to macosx/tkMacOSXDialog.c.
19
20
21
22
23
24
25
26

27
28
29
30
31
32
33
19
20
21
22
23
24
25

26
27
28
29
30
31
32
33







-
+







#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
#define modalOK     NSOKButton
#define modalCancel NSCancelButton
#else
#define modalOK     NSModalResponseOK
#define modalCancel NSModalResponseCancel
#endif // MAC_OS_X_VERSION_MIN_REQUIRED < 1090
#define modalOther  -1 // indicates that the -command option was used. 
#define modalOther  -1 // indicates that the -command option was used.
#define modalError  -2

/*
 * Vars for filtering in "open file" and "save file" dialogs.
 */

typedef struct {
371
372
373
374
375
376
377
378

379
380
381
382
383
384
385
371
372
373
374
375
376
377

378
379
380
381
382
383
384
385







-
+







	if ([NSApp macOSVersion] > 101400) {
	    modalReturnCode = [panel runModal];
	} else {
	    modalReturnCode = [NSApp runModalForWindow:panel];
	}
    } else {

	/* 
	/*
	 * For the standalone file dialog, completion handlers do not work
	 * at all on macOS 10.14 and earlier.
	 */

	if ([NSApp macOSVersion] > 101400) {
	    [panel beginWithCompletionHandler:^(NSModalResponse returnCode) {
		    [NSApp tkFilePanelDidEnd:panel
Changes to tests/bevel.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
20












-
+







# This file creates a visual test for bevels drawn around text in text
# widgets.  It is part of the Tk visual test suite, which is invoked
# via the "visual" script.

catch {destroy .t}
toplevel .t
wm title .t "Visual Tests for Borders in Text Widgets"
wm iconname .t "Text Borders"
wm geom .t +0+0

text .t.t -width 60 -height 30 -setgrid true -xscrollcommand {.t.h set} \
	-font {Courier 12} \
	-yscrollcommand {.t.v set} -wrap none -relief raised -bd 2
	-yscrollcommand {.t.v set} -wrap none -relief raised -borderwidth 2
scrollbar .t.v -orient vertical -command ".t.t yview"
scrollbar .t.h -orient horizontal -command ".t.t xview"
button .t.quit -text Quit -command {destroy .t}
pack .t.quit -side bottom -pady 3 -ipadx 4 -ipady 2
pack .t.h -side bottom -fill x
pack .t.v -side right -fill y
pack .t.t -expand yes -fill both
124
125
126
127
128
129
130
131

132
133

134
135
136
137
138
139
140
124
125
126
127
128
129
130

131
132

133
134
135
136
137
138
139
140







-
+

-
+







.t.t insert end \n
.t.t insert end rrr r1
.t.t insert end *****
.t.t insert end rrr r1

font configure TkFixedFont -size 20
.t.t tag configure sol100 -relief solid -borderwidth 100 \
                          -foreground red -font TkFixedFont
                          -color red -font TkFixedFont
.t.t tag configure sol12 -relief solid -borderwidth 12 \
                          -foreground red -font TkFixedFont
                          -color red -font TkFixedFont
.t.t tag configure big -font TkFixedFont
set ind [.t.t index end]

.t.t insert end "\n\nBorders do not leak on the neighbour chars"
.t.t insert end "\nOnly \"S\" is on dark background"
.t.t insert end {
 xxx
Changes to tests/bind.test.
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
11
12
13
14
15
16
17

18
19
20
21
22
23
24







-







namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
tk useinputmethods 0

testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}]


toplevel .t -width 100 -height 50
wm geom .t +0+0
update idletasks

foreach p [event info] {event delete $p}
foreach event [bind Test] {
    bind Test $event {}
7013
7014
7015
7016
7017
7018
7019
7020

7021
7022
7023
7024
7025
7026
7027
7012
7013
7014
7015
7016
7017
7018

7019
7020
7021
7022
7023
7024
7025
7026







-
+








test bind-36.1 {pointer warp with grab on toplevel, bug [e3888d5820]} -setup {
    event generate {} <Motion> -warp 1 -x 50 -y 50
    toplevel .top
    grab release .top
    wm geometry .top 200x200+300+300
    label .top.l -height 5 -width 20 -highlightthickness 2 \
            -highlightbackground black -bg yellow -text "My label"
            -highlightbackground black -background yellow -text "My label"
    pack .top.l -side bottom
    update
    # On KDE/Plasma _with_the_Aurorae_theme_ (at least), setting up the toplevel
    # and the label will not be finished after the above 'update'. The WM still
    # needs some time before the window is fully ready. For me 50 ms is enough,
    # but let's wait more (it depends on computer performance).
    after 100 ; update
Changes to tests/border.test.
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
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







-
+











-
+


-
+










-
+

-
+













-
+


-
+


-
+














-
+

-
+

-
+







tcltest::loadTestedCommands

test border-1.1 {Tk_AllocBorderFromObj - converting internal reps} -constraints {
    testborder
} -body {
    set x orange
    lindex $x 0
    button .b1 -bg $x -text .b1
    button .b1 -background $x -text .b1
    lindex $x 0
    testborder orange
} -cleanup {
    destroy .b1
} -result {{1 0}}
test border-1.2 {Tk_AllocBorderFromObj - discard stale border} -constraints {
    testborder
} -setup {
    set result {}
} -body {
    set x orange
    button .b1 -bg $x -text First
    button .b1 -background $x -text First
    destroy .b1
    lappend result [testborder orange]
    button .b2 -bg $x -text Second
    button .b2 -background $x -text Second
    lappend result [testborder orange]
} -cleanup {
    destroy .b1 .b2
} -result {{} {{1 1}}}
test border-1.3 {Tk_AllocBorderFromObj - reuse existing border} -constraints {
    testborder
} -setup {
    set result {}
} -body {
    set x orange
    button .b1 -bg $x -text First
    button .b1 -background $x -text First
    lappend result [testborder orange]
    button .b2 -bg $x -text Second
    button .b2 -background $x -text Second
    pack .b1 .b2 -side top
    lappend result [testborder orange]
} -cleanup {
    destroy .b1 .b2
} -result {{{1 1}} {{2 1}}}
test border-1.4 {Tk_AllocBorderFromObj - try other borders in list} -constraints {
    testborder pseudocolor8
} -setup {
    toplevel .t -visual {pseudocolor 8} -colormap new
    wm geom .t +0+0
    set result {}
} -body {
    set x purple
    button .b1 -bg $x -text First
    button .b1 -background $x -text First
    pack .b1 -side top
    lappend result [testborder purple]
    button .t.b -bg $x -text Second
    button .t.b -background $x -text Second
    pack .t.b -side top
    lappend result [testborder purple]
    button .b2 -bg $x -text Third
    button .b2 -background $x -text Third
    pack .b2 -side top
    lappend result [testborder purple]
} -cleanup {
    destroy .b1 .b2 .t
} -result {{{1 1}} {{1 1} {1 0}} {{1 0} {2 1}}}

test border-2.1 {Tk_Free3DBorder - reference counts} -constraints {
    testborder pseudocolor8
} -setup {
    toplevel .t -visual {pseudocolor 8} -colormap new
    wm geom .t +0+0
    set result {}
} -body {
    set x purple
    button .b1 -bg $x -text First
    button .b1 -background $x -text First
    pack .b1 -side top
    button .t.b -bg $x -text Second
    button .t.b -background $x -text Second
    pack .t.b -side top
    button .b2 -bg $x -text Third
    button .b2 -background $x -text Third
    pack .b2 -side top
    lappend result [testborder purple]
    destroy .b1
    lappend result [testborder purple]
    destroy .b2
    lappend result [testborder purple]
    destroy .t.b
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116










117
118
119
120
121
122
123
100
101
102
103
104
105
106










107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123







-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+







    toplevel .t -visual {pseudocolor 8} -colormap new
    wm geom .t +0+0
    toplevel .t2 -visual {pseudocolor 8} -colormap new
    toplevel .t3 -visual {pseudocolor 8} -colormap new
    set result {}
} -body {
    set x purple
    button .b -bg $x -text .b1
    button .t.b1 -bg $x -text .t.b1
    button .t.b2 -bg $x -text .t.b2
    button .t2.b1 -bg $x -text .t2.b1
    button .t2.b2 -bg $x -text .t2.b2
    button .t2.b3 -bg $x -text .t2.b3
    button .t3.b1 -bg $x -text .t3.b1
    button .t3.b2 -bg $x -text .t3.b2
    button .t3.b3 -bg $x -text .t3.b3
    button .t3.b4 -bg $x -text .t3.b4
    button .b -background $x -text .b1
    button .t.b1 -background $x -text .t.b1
    button .t.b2 -background $x -text .t.b2
    button .t2.b1 -background $x -text .t2.b1
    button .t2.b2 -background $x -text .t2.b2
    button .t2.b3 -background $x -text .t2.b3
    button .t3.b1 -background $x -text .t3.b1
    button .t3.b2 -background $x -text .t3.b2
    button .t3.b3 -background $x -text .t3.b3
    button .t3.b4 -background $x -text .t3.b4
    lappend result [testborder purple]
    destroy .t2
    lappend result [testborder purple]
    destroy .b
    lappend result [testborder purple]
    destroy .t3
    lappend result [testborder purple]
131
132
133
134
135
136
137
138

139
140

141
142

143
144
145
146
147
148
149
131
132
133
134
135
136
137

138
139

140
141

142
143
144
145
146
147
148
149







-
+

-
+

-
+







test border-3.1 {FreeBorderObjProc} -constraints {
    testborder
} -setup {
    set result {}
    proc copy {s} {return [string index $s 0][string range $s 1 end]}
} -body {
    set x [copy purple]
    button .b -bg $x -text .b1
    button .b -background $x -text .b1
    set y [copy purple]
    .b configure -bg $y
    .b configure -background $y
    set z [copy purple]
    .b configure -bg $z
    .b configure -background $z
    lappend result [testborder purple]
    set x red
    lappend result [testborder purple]
    set z 32
    lappend result [testborder purple]
    destroy .b
    lappend result [testborder purple]
Changes to tests/butGeom.tcl.
13
14
15
16
17
18
19
20

21
22
23
24
25
26
27
13
14
15
16
17
18
19

20
21
22
23
24
25
26
27







-
+








button .t.quit -text Quit -command {destroy .t}
pack .t.quit -side bottom -pady 2m

set sepId 1
proc sep {} {
    global sepId
    frame .t.sep$sepId -height 2 -bd 1 -relief sunken
    frame .t.sep$sepId -height 2 -borderwidth 1 -relief sunken
    pack .t.sep$sepId -side top -padx 2m -pady 2m -fill x
    incr sepId
}

# Create buttons that control configuration options.

frame .t.control
77
78
79
80
81
82
83
84
85
86



87
88
89
90
91
92
93
77
78
79
80
81
82
83



84
85
86
87
88
89
90
91
92
93







-
-
-
+
+
+







frame .t.f3
pack .t.f3 -side top -expand 1 -fill both
sep
frame .t.f4
pack .t.f4 -side top -expand 1 -fill both
sep

label .t.l1 -text Label -bd 2 -relief sunken
label .t.l2 -text "Explicit\nnewlines\n\nin the text" -bd 2 -relief sunken
label .t.l3 -text "This text is quite long, so it must be wrapped automatically by Tk" -wraplength 2i -bd 2 -relief sunken -underline 50
label .t.l1 -text Label -borderwidth 2 -relief sunken
label .t.l2 -text "Explicit\nnewlines\n\nin the text" -borderwidth 2 -relief sunken
label .t.l3 -text "This text is quite long, so it must be wrapped automatically by Tk" -wraplength 2i -borderwidth 2 -relief sunken -underline 50
pack .t.l1 .t.l2 .t.l3 -in .t.f1 -side left -padx 5m -pady 3m \
	-expand y -fill both

button .t.b1 -text Button
button .t.b2 -text "Explicit\nnewlines\n\nin the text"
button .t.b3 -text "This text is quite long, so it must be wrapped automatically by Tk" -wraplength 2i -underline 50
pack .t.b1 .t.b2 .t.b3 -in .t.f2 -side left -padx 5m -pady 3m \
Changes to tests/butGeom2.tcl.
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
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







-
+

















-
+








button .t.quit -text Quit -command {destroy .t}
pack .t.quit -side bottom -pady 2m

set sepId 1
proc sep {} {
    global sepId
    frame .t.sep$sepId -height 2 -bd 1 -relief sunken
    frame .t.sep$sepId -height 2 -borderwidth 1 -relief sunken
    pack .t.sep$sepId -side top -padx 2m -pady 2m -fill x
    incr sepId
}

# Create buttons that control configuration options.

frame .t.control
pack .t.control -side top -fill x -pady 3m
frame .t.control.left
frame .t.control.right
pack .t.control.left .t.control.right -side left -expand 1 -fill x
label .t.anchorLabel -text "Color:"
frame .t.control.left.f -width 6c -height 3c
pack .t.anchorLabel .t.control.left.f -in .t.control.left -side top -anchor w
foreach opt {activebackground activeforeground background disabledforeground foreground highlightbackground highlightcolor } {
    #button .t.color-$opt -text $opt -command "config -$opt \[tk_chooseColor]"
    menubutton .t.color-$opt -text $opt -menu .t.color-$opt.m -indicatoron 1 \
        -relief raised -bd 2
        -relief raised -borderwidth 2
    menu .t.color-$opt.m -tearoff 0
    .t.color-$opt.m add command -label Red -command "config -$opt red"
    .t.color-$opt.m add command -label Green -command "config -$opt green"
    .t.color-$opt.m add command -label Blue -command "config -$opt blue"
    .t.color-$opt.m add command -label Other... \
          -command "config -$opt \[tk_chooseColor]"
    pack .t.color-$opt -in .t.control.left.f -fill x
69
70
71
72
73
74
75
76
77
78



79
80
81
82
83
84
85
69
70
71
72
73
74
75



76
77
78
79
80
81
82
83
84
85







-
-
-
+
+
+







frame .t.f3
pack .t.f3 -side top -expand 1 -fill both
sep
frame .t.f4
pack .t.f4 -side top -expand 1 -fill both
sep

label .t.l1 -text Label -bd 2 -relief sunken
label .t.l2 -text "Explicit\nnewlines\n\nin the text" -bd 2 -relief sunken
label .t.l3 -text "This text is quite long, so it must be wrapped automatically by Tk" -wraplength 2i -bd 2 -relief sunken -underline 50
label .t.l1 -text Label -borderwidth 2 -relief sunken
label .t.l2 -text "Explicit\nnewlines\n\nin the text" -borderwidth 2 -relief sunken
label .t.l3 -text "This text is quite long, so it must be wrapped automatically by Tk" -wraplength 2i -borderwidth 2 -relief sunken -underline 50
pack .t.l1 .t.l2 .t.l3 -in .t.f1 -side left -padx 5m -pady 3m \
	-expand y -fill both

button .t.b1 -text Button
button .t.b2 -text "Explicit\nnewlines\n\nin the text"
button .t.b3 -text "This text is quite long, so it must be wrapped automatically by Tk" -wraplength 2i -underline 50
pack .t.b1 .t.b2 .t.b3 -in .t.f2 -side left -padx 5m -pady 3m \
Changes to tests/button.test.
9
10
11
12
13
14
15


16
17
18
19
20
21
22
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24







+
+








package require tcltest 2.2
namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
imageInit

testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}]

proc bogusTrace args {
    error "trace aborted"
}

test button-1.1 {configuration option: "activebackground" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
95
96
97
98
99
100
101
102
103


104
105
106
107
108
109
110
111
112

113
114
115
116
117
118
119
120
121
122


123
124
125
126
127
128
129
130
131

132
133
134
135
136
137
138
139
140
141


142
143
144
145
146
147
148
149
150

151
152
153
154
155
156
157
158
159
160


161
162
163
164
165
166
167
168
169

170
171
172
173
174
175
176
97
98
99
100
101
102
103


104
105
106
107
108
109
110
111
112
113

114
115
116
117
118
119
120
121
122


123
124
125
126
127
128
129
130
131
132

133
134
135
136
137
138
139
140
141


142
143
144
145
146
147
148
149
150
151

152
153
154
155
156
157
158
159
160


161
162
163
164
165
166
167
168
169
170

171
172
173
174
175
176
177
178







-
-
+
+








-
+








-
-
+
+








-
+








-
-
+
+








-
+








-
-
+
+








-
+







} -returnCodes {error} -result {unknown color name "non-existent"}

test button-1.9 {configuration option: "activeforeground" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
    update
} -body {
    .l configure -activeforeground #ff0000
    .l cget -activeforeground
    .l configure -activecolor #ff0000
    .l cget -activecolor
} -cleanup {
    destroy .l
} -result {#ff0000}
test button-1.10 {configuration option: "activeforeground" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
    update
} -body {
    .l configure -activeforeground non-existent
    .l configure -activecolor non-existent
} -cleanup {
    destroy .l
} -returnCodes {error} -result {unknown color name "non-existent"}
test button-1.11 {configuration option: "activeforeground" for button} -setup {
    button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .b
    update
} -body {
    .b configure -activeforeground #ff0000
    .b cget -activeforeground
    .b configure -activecolor #ff0000
    .b cget -activecolor
} -cleanup {
    destroy .b
} -result {#ff0000}
test button-1.12 {configuration option: "activeforeground" for button} -setup {
    button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .b
    update
} -body {
    .b configure -activeforeground non-existent
    .b configure -activecolor non-existent
} -cleanup {
    destroy .b
} -returnCodes {error} -result {unknown color name "non-existent"}
test button-1.13 {configuration option: "activeforeground" for checkbutton} -setup {
    checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .c
    update
} -body {
    .c configure -activeforeground #ff0000
    .c cget -activeforeground
    .c configure -activecolor #ff0000
    .c cget -activecolor
} -cleanup {
    destroy .c
} -result {#ff0000}
test button-1.14 {configuration option: "activeforeground" for checkbutton} -setup {
    checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .c
    update
} -body {
    .c configure -activeforeground non-existent
    .c configure -activecolor non-existent
} -cleanup {
    destroy .c
} -returnCodes {error} -result {unknown color name "non-existent"}
test button-1.15 {configuration option: "activeforeground" for radiobutton} -setup {
    radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .r
    update
} -body {
    .r configure -activeforeground #ff0000
    .r cget -activeforeground
    .r configure -activecolor #ff0000
    .r cget -activecolor
} -cleanup {
    destroy .r
} -result {#ff0000}
test button-1.16 {configuration option: "activeforeground" for radiobutton} -setup {
    radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .r
    update
} -body {
    .r configure -activeforeground non-existent
    .r configure -activecolor non-existent
} -cleanup {
    destroy .r
} -returnCodes {error} -result {unknown color name "non-existent"}

test button-1.17 {configuration option: "anchor" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
326
327
328
329
330
331
332
333
334


335
336
337
338
339
340
341
342
343

344
345
346
347
348
349
350
351
352
353


354
355
356
357
358
359
360
361
362

363
364
365
366
367
368
369
370
371
372


373
374
375
376
377
378
379
380
381

382
383
384
385
386
387
388
389
390
391


392
393
394
395
396
397
398
399
400

401
402
403
404
405
406
407
408
409
410
411


412
413
414
415
416
417
418
419
420

421
422
423
424
425
426
427
428
429
430


431
432
433
434
435
436
437
438
439

440
441
442
443
444
445
446
447
448
449


450
451
452
453
454
455
456
457
458

459
460
461
462
463
464
465
466
467
468


469
470
471
472
473
474
475
476
477

478
479
480
481
482
483
484
328
329
330
331
332
333
334


335
336
337
338
339
340
341
342
343
344

345
346
347
348
349
350
351
352
353


354
355
356
357
358
359
360
361
362
363

364
365
366
367
368
369
370
371
372


373
374
375
376
377
378
379
380
381
382

383
384
385
386
387
388
389
390
391


392
393
394
395
396
397
398
399
400
401

402
403
404
405
406
407
408
409
410
411


412
413
414
415
416
417
418
419
420
421

422
423
424
425
426
427
428
429
430


431
432
433
434
435
436
437
438
439
440

441
442
443
444
445
446
447
448
449


450
451
452
453
454
455
456
457
458
459

460
461
462
463
464
465
466
467
468


469
470
471
472
473
474
475
476
477
478

479
480
481
482
483
484
485
486







-
-
+
+








-
+








-
-
+
+








-
+








-
-
+
+








-
+








-
-
+
+








-
+









-
-
+
+








-
+








-
-
+
+








-
+








-
-
+
+








-
+








-
-
+
+








-
+







} -returnCodes {error} -result {unknown color name "non-existent"}

test button-1.33 {configuration option: "bd" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
    update
} -body {
    .l configure -bd 4
    .l cget -bd
    .l configure -borderwidth 4
    .l cget -borderwidth
} -cleanup {
    destroy .l
} -result 4
test button-1.34 {configuration option: "bd" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
    update
} -body {
    .l configure -bd badValue
    .l configure -borderwidth badValue
} -cleanup {
    destroy .l
} -returnCodes {error} -result {bad screen distance "badValue"}
test button-1.35 {configuration option: "bd" for button} -setup {
    button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .b
    update
} -body {
    .b configure -bd 4
    .b cget -bd
    .b configure -borderwidth 4
    .b cget -borderwidth
} -cleanup {
    destroy .b
} -result 4
test button-1.36 {configuration option: "bd" for button} -setup {
    button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .b
    update
} -body {
    .b configure -bd badValue
    .b configure -borderwidth badValue
} -cleanup {
    destroy .b
} -returnCodes {error} -result {bad screen distance "badValue"}
test button-1.37 {configuration option: "bd" for checkbutton} -setup {
    checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .c
    update
} -body {
    .c configure -bd 4
    .c cget -bd
    .c configure -borderwidth 4
    .c cget -borderwidth
} -cleanup {
    destroy .c
} -result 4
test button-1.38 {configuration option: "bd" for checkbutton} -setup {
    checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .c
    update
} -body {
    .c configure -bd badValue
    .c configure -borderwidth badValue
} -cleanup {
    destroy .c
} -returnCodes {error} -result {bad screen distance "badValue"}
test button-1.39 {configuration option: "bd" for radiobutton} -setup {
    radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .r
    update
} -body {
    .r configure -bd 4
    .r cget -bd
    .r configure -borderwidth 4
    .r cget -borderwidth
} -cleanup {
    destroy .r
} -result 4
test button-1.40 {configuration option: "bd" for radiobutton} -setup {
    radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .r
    update
} -body {
    .r configure -bd badValue
    .r configure -borderwidth badValue
} -cleanup {
    destroy .r
} -returnCodes {error} -result {bad screen distance "badValue"}

test button-1.41 {configuration option: "bg" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
    update
} -body {
    .l configure -bg #ff0000
    .l cget -bg
    .l configure -background #ff0000
    .l cget -background
} -cleanup {
    destroy .l
} -result {#ff0000}
test button-1.42 {configuration option: "bg" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
    update
} -body {
    .l configure -bg non-existent
    .l configure -background non-existent
} -cleanup {
    destroy .l
} -returnCodes {error} -result {unknown color name "non-existent"}
test button-1.43 {configuration option: "bg" for button} -setup {
    button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .b
    update
} -body {
    .b configure -bg #ff0000
    .b cget -bg
    .b configure -background #ff0000
    .b cget -background
} -cleanup {
    destroy .b
} -result {#ff0000}
test button-1.44 {configuration option: "bg" for button} -setup {
    button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .b
    update
} -body {
    .b configure -bg non-existent
    .b configure -background non-existent
} -cleanup {
    destroy .b
} -returnCodes {error} -result {unknown color name "non-existent"}
test button-1.45 {configuration option: "bg" for checkbutton} -setup {
    checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .c
    update
} -body {
    .c configure -bg #ff0000
    .c cget -bg
    .c configure -background #ff0000
    .c cget -background
} -cleanup {
    destroy .c
} -result {#ff0000}
test button-1.46 {configuration option: "bg" for checkbutton} -setup {
    checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .c
    update
} -body {
    .c configure -bg non-existent
    .c configure -background non-existent
} -cleanup {
    destroy .c
} -returnCodes {error} -result {unknown color name "non-existent"}
test button-1.47 {configuration option: "bg" for radiobutton} -setup {
    radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .r
    update
} -body {
    .r configure -bg #ff0000
    .r cget -bg
    .r configure -background #ff0000
    .r cget -background
} -cleanup {
    destroy .r
} -result {#ff0000}
test button-1.48 {configuration option: "bg" for radiobutton} -setup {
    radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .r
    update
} -body {
    .r configure -bg non-existent
    .r configure -background non-existent
} -cleanup {
    destroy .r
} -returnCodes {error} -result {unknown color name "non-existent"}

test button-1.49 {configuration option: "bitmap" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
849
850
851
852
853
854
855
856
857


858
859
860
861
862
863
864
865
866

867
868
869
870
871
872
873
874
875
876


877
878
879
880
881
882
883
884
885

886
887
888
889
890
891
892
893
894
895


896
897
898
899
900
901
902
903
904

905
906
907
908
909
910
911
912
913
914


915
916
917
918
919
920
921
922
923

924
925
926
927
928
929
930
931
932
933
934


935
936
937
938
939
940
941
942
943

944
945
946
947
948
949
950
951
952
953


954
955
956
957
958
959
960
961
962

963
964
965
966
967
968
969
970
971
972


973
974
975
976
977
978
979
980
981

982
983
984
985
986
987
988
989
990
991


992
993
994
995
996
997
998
999
1000

1001
1002
1003
1004
1005
1006
1007
851
852
853
854
855
856
857


858
859
860
861
862
863
864
865
866
867

868
869
870
871
872
873
874
875
876


877
878
879
880
881
882
883
884
885
886

887
888
889
890
891
892
893
894
895


896
897
898
899
900
901
902
903
904
905

906
907
908
909
910
911
912
913
914


915
916
917
918
919
920
921
922
923
924

925
926
927
928
929
930
931
932
933
934


935
936
937
938
939
940
941
942
943
944

945
946
947
948
949
950
951
952
953


954
955
956
957
958
959
960
961
962
963

964
965
966
967
968
969
970
971
972


973
974
975
976
977
978
979
980
981
982

983
984
985
986
987
988
989
990
991


992
993
994
995
996
997
998
999
1000
1001

1002
1003
1004
1005
1006
1007
1008
1009







-
-
+
+








-
+








-
-
+
+








-
+








-
-
+
+








-
+








-
-
+
+








-
+









-
-
+
+








-
+








-
-
+
+








-
+








-
-
+
+








-
+








-
-
+
+








-
+







} -returnCodes {error} -result {bad default "huh?": must be active, disabled, or normal}

test button-1.87 {configuration option: "disabledforeground" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
    update
} -body {
    .l configure -disabledforeground #00ff00
    .l cget -disabledforeground
    .l configure -disabledcolor #00ff00
    .l cget -disabledcolor
} -cleanup {
    destroy .l
} -result {#00ff00}
test button-1.88 {configuration option: "disabledforeground" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
    update
} -body {
    .l configure -disabledforeground non-existent
    .l configure -disabledcolor non-existent
} -cleanup {
    destroy .l
} -returnCodes {error} -result {unknown color name "non-existent"}
test button-1.89 {configuration option: "disabledforeground" for button} -setup {
    button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .b
    update
} -body {
    .b configure -disabledforeground #00ff00
    .b cget -disabledforeground
    .b configure -disabledcolor #00ff00
    .b cget -disabledcolor
} -cleanup {
    destroy .b
} -result {#00ff00}
test button-1.90 {configuration option: "disabledforeground" for button} -setup {
    button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .b
    update
} -body {
    .b configure -disabledforeground non-existent
    .b configure -disabledcolor non-existent
} -cleanup {
    destroy .b
} -returnCodes {error} -result {unknown color name "non-existent"}
test button-1.91 {configuration option: "disabledforeground" for checkbutton} -setup {
    checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .c
    update
} -body {
    .c configure -disabledforeground #00ff00
    .c cget -disabledforeground
    .c configure -disabledcolor #00ff00
    .c cget -disabledcolor
} -cleanup {
    destroy .c
} -result {#00ff00}
test button-1.92 {configuration option: "disabledforeground" for checkbutton} -setup {
    checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .c
    update
} -body {
    .c configure -disabledforeground non-existent
    .c configure -disabledcolor non-existent
} -cleanup {
    destroy .c
} -returnCodes {error} -result {unknown color name "non-existent"}
test button-1.93 {configuration option: "disabledforeground" for radiobutton} -setup {
    radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .r
    update
} -body {
    .r configure -disabledforeground #00ff00
    .r cget -disabledforeground
    .r configure -disabledcolor #00ff00
    .r cget -disabledcolor
} -cleanup {
    destroy .r
} -result {#00ff00}
test button-1.94 {configuration option: "disabledforeground" for radiobutton} -setup {
    radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .r
    update
} -body {
    .r configure -disabledforeground non-existent
    .r configure -disabledcolor non-existent
} -cleanup {
    destroy .r
} -returnCodes {error} -result {unknown color name "non-existent"}

test button-1.95 {configuration option: "fg" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
    update
} -body {
    .l configure -fg #110022
    .l cget -fg
    .l configure -color #110022
    .l cget -color
} -cleanup {
    destroy .l
} -result {#110022}
test button-1.96 {configuration option: "fg" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
    update
} -body {
    .l configure -fg non-existent
    .l configure -color non-existent
} -cleanup {
    destroy .l
} -returnCodes {error} -result {unknown color name "non-existent"}
test button-1.97 {configuration option: "fg" for button} -setup {
    button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .b
    update
} -body {
    .b configure -fg #110022
    .b cget -fg
    .b configure -color #110022
    .b cget -color
} -cleanup {
    destroy .b
} -result {#110022}
test button-1.98 {configuration option: "fg" for button} -setup {
    button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .b
    update
} -body {
    .b configure -fg non-existent
    .b configure -color non-existent
} -cleanup {
    destroy .b
} -returnCodes {error} -result {unknown color name "non-existent"}
test button-1.99 {configuration option: "fg" for checkbutton} -setup {
    checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .c
    update
} -body {
    .c configure -fg #110022
    .c cget -fg
    .c configure -color #110022
    .c cget -color
} -cleanup {
    destroy .c
} -result {#110022}
test button-1.100 {configuration option: "fg" for checkbutton} -setup {
    checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .c
    update
} -body {
    .c configure -fg non-existent
    .c configure -color non-existent
} -cleanup {
    destroy .c
} -returnCodes {error} -result {unknown color name "non-existent"}
test button-1.101 {configuration option: "fg" for radiobutton} -setup {
    radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .r
    update
} -body {
    .r configure -fg #110022
    .r cget -fg
    .r configure -color #110022
    .r cget -color
} -cleanup {
    destroy .r
} -result {#110022}
test button-1.102 {configuration option: "fg" for radiobutton} -setup {
    radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .r
    update
} -body {
    .r configure -fg non-existent
    .r configure -color non-existent
} -cleanup {
    destroy .r
} -returnCodes {error} -result {unknown color name "non-existent"}

test button-1.103 {configuration option: "font" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2
    pack .l
1080
1081
1082
1083
1084
1085
1086
1087
1088


1089
1090
1091
1092
1093
1094
1095
1096
1097

1098
1099
1100
1101
1102
1103
1104
1105
1106
1107


1108
1109
1110
1111
1112
1113
1114
1115
1116

1117
1118
1119
1120
1121
1122
1123
1124
1125
1126


1127
1128
1129
1130
1131
1132
1133
1134
1135

1136
1137
1138
1139
1140
1141
1142
1143
1144
1145


1146
1147
1148
1149
1150
1151
1152
1153
1154

1155
1156
1157
1158
1159
1160
1161
1082
1083
1084
1085
1086
1087
1088


1089
1090
1091
1092
1093
1094
1095
1096
1097
1098

1099
1100
1101
1102
1103
1104
1105
1106
1107


1108
1109
1110
1111
1112
1113
1114
1115
1116
1117

1118
1119
1120
1121
1122
1123
1124
1125
1126


1127
1128
1129
1130
1131
1132
1133
1134
1135
1136

1137
1138
1139
1140
1141
1142
1143
1144
1145


1146
1147
1148
1149
1150
1151
1152
1153
1154
1155

1156
1157
1158
1159
1160
1161
1162
1163







-
-
+
+








-
+








-
-
+
+








-
+








-
-
+
+








-
+








-
-
+
+








-
+







} -returnCodes {error} -result {font "" doesn't exist}

test button-1.111 {configuration option: "foreground" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
    update
} -body {
    .l configure -foreground #110022
    .l cget -foreground
    .l configure -color #110022
    .l cget -color
} -cleanup {
    destroy .l
} -result {#110022}
test button-1.112 {configuration option: "foreground" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
    update
} -body {
    .l configure -foreground non-existent
    .l configure -color non-existent
} -cleanup {
    destroy .l
} -returnCodes {error} -result {unknown color name "non-existent"}
test button-1.113 {configuration option: "foreground" for button} -setup {
    button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .b
    update
} -body {
    .b configure -foreground #110022
    .b cget -foreground
    .b configure -color #110022
    .b cget -color
} -cleanup {
    destroy .b
} -result {#110022}
test button-1.114 {configuration option: "foreground" for button} -setup {
    button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .b
    update
} -body {
    .b configure -foreground non-existent
    .b configure -color non-existent
} -cleanup {
    destroy .b
} -returnCodes {error} -result {unknown color name "non-existent"}
test button-1.115 {configuration option: "foreground" for checkbutton} -setup {
    checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .c
    update
} -body {
    .c configure -foreground #110022
    .c cget -foreground
    .c configure -color #110022
    .c cget -color
} -cleanup {
    destroy .c
} -result {#110022}
test button-1.116 {configuration option: "foreground" for checkbutton} -setup {
    checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .c
    update
} -body {
    .c configure -foreground non-existent
    .c configure -color non-existent
} -cleanup {
    destroy .c
} -returnCodes {error} -result {unknown color name "non-existent"}
test button-1.117 {configuration option: "foreground" for radiobutton} -setup {
    radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .r
    update
} -body {
    .r configure -foreground #110022
    .r cget -foreground
    .r configure -color #110022
    .r cget -color
} -cleanup {
    destroy .r
} -result {#110022}
test button-1.118 {configuration option: "foreground" for radiobutton} -setup {
    radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .r
    update
} -body {
    .r configure -foreground non-existent
    .r configure -color non-existent
} -cleanup {
    destroy .r
} -returnCodes {error} -result {unknown color name "non-existent"}

test button-1.119 {configuration option: "height" for label} -setup {
    label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .l
2781
2782
2783
2784
2785
2786
2787
2788

2789
2790
2791
2792
2793
2794

2795
2796
2797
2798
2799
2800
2801
2783
2784
2785
2786
2787
2788
2789

2790
2791
2792
2793
2794
2795

2796
2797
2798
2799
2800
2801
2802
2803







-
+





-
+







} -cleanup {
    destroy .b
} -returnCodes {error} -result {unknown option "-gorp"}

#ex 4.7
test button-3.6 {ButtonWidgetCmd procedure, "cget" option} -body {
    label .l
    .l cget -disabledforeground
    .l cget -disabledcolor
} -cleanup {
    destroy .l
} -returnCodes {ok} -match {glob} -result {*}
test button-3.7 {ButtonWidgetCmd procedure, "cget" option} -body {
    button .b
    .b cget -disabledforeground
    .b cget -disabledcolor
} -cleanup {
    destroy .b
} -returnCodes {ok} -match {glob} -result {*}
test button-3.8 {ButtonWidgetCmd procedure, "cget" option} -body {
    button .b
    .b cget -variable
} -cleanup {
2831
2832
2833
2834
2835
2836
2837
2838

2839
2840
2841
2842
2843

2844
2845
2846
2847
2848
2849
2850
2851
2852
2853

2854
2855
2856

2857
2858
2859
2860
2861
2862



2863
2864
2865
2866
2867
2868
2869
2833
2834
2835
2836
2837
2838
2839

2840
2841
2842
2843
2844

2845
2846
2847
2848
2849
2850
2851
2852
2853
2854

2855
2856
2857

2858
2859
2860
2861



2862
2863
2864
2865
2866
2867
2868
2869
2870
2871







-
+




-
+









-
+


-
+



-
-
-
+
+
+







# ex 4.6
test button-3.13 {ButtonWidgetCmd procedure, "configure" option} -body {
    button .b -highlightthickness 3
    lindex [.b configure -highlightthickness] 4
} -cleanup {
    destroy .b
}  -result 3
test button-3.14 {ButtonWidgetCmd procedure, "configure" option} -body {
test button-3.14 {ButtonWidgetCmd procedure, "configure" option} -constraints nodeprecated -body {
    checkbutton .c
    llength [.c configure]
} -cleanup {
    destroy .c
} -result 41
} -result 44
test button-3.15 {ButtonWidgetCmd procedure, "configure" option} -body {
    button .b
    .b configure -gorp
} -cleanup {
    destroy .b
} -returnCodes {error} -result {unknown option "-gorp"}
test button-3.16 {ButtonWidgetCmd procedure, "configure" option} -setup {
    button .b
} -body {
    .b co -bg #ffffff -fg
    .b co -background #ffffff -color
} -cleanup {
    destroy .b
} -returnCodes {error} -result {value for "-fg" missing}
} -returnCodes {error} -result {value for "-color" missing}
test button-3.17 {ButtonWidgetCmd procedure, "configure" option} -setup {
    button .b
} -body {
    .b configure -fg #123456
    .b configure -bg #654321
    lindex [.b configure -fg] 4
    .b configure -color #123456
    .b configure -background #654321
    lindex [.b configure -color] 4
} -cleanup {
    destroy .b
} -result {#123456}
test button-3.18 {ButtonWidgetCmd procedure, "deselect" option} -body {
    checkbutton .c
    .c deselect foo
} -cleanup {
3199
3200
3201
3202
3203
3204
3205
3206

3207
3208

3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221


3222
3223
3224
3225
3226
3227
3228



3229
3230
3231
3232
3233
3234
3235
3201
3202
3203
3204
3205
3206
3207

3208
3209

3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221


3222
3223
3224
3225
3226
3227



3228
3229
3230
3231
3232
3233
3234
3235
3236
3237







-
+

-
+











-
-
+
+




-
-
-
+
+
+







test button-4.1 {DestroyButton procedure} -constraints {
    testImageType
} -setup {
    image create test image1
    unset -nocomplain x
} -body {
    button .b1 -image image1
    button .b2 -fg #ff0000 -text "Button 2"
    button .b2 -color #ff0000 -text "Button 2"
    button .b3 -state active -text "Button 3"
    button .b4 -disabledforeground #0000ff -state disabled -text "Button 4"
    button .b4 -disabledcolor #0000ff -state disabled -text "Button 4"
    checkbutton .b5 -variable x -text "Checkbutton 5"
    set x 1
    pack .b1 .b2 .b3 .b4 .b5
    update
    deleteWindows
} -cleanup {
    destroy .b1 .b2 .b3 .b4 .b5
    image delete image1
} -result {}

test button-5.1 {ConfigureButton - textvariable trace} -body {
    button .b -bd 4 -bg green
    .b configure -bd 7 -bg red -fg bogus
    button .b -borderwidth 4 -background green
    .b configure -borderwidth 7 -background red -color bogus
} -cleanup {
    destroy .b
} -returnCodes {error} -result {unknown color name "bogus"}
test button-5.2 {ConfigureButton - textvariable trace} -body {
    button .b -bd 4 -bg green
    catch {.b configure -bd 7 -bg red -fg bogus}
    list [.b cget -bd] [.b cget -bg]
    button .b -borderwidth 4 -background green
    catch {.b configure -borderwidth 7 -background red -color bogus}
    list [.b cget -borderwidth] [.b cget -background]
} -cleanup {
    destroy .b
} -result {4 green}
test button-5.3 {ConfigureButton - textvariable trace} -body {
    button .b -textvariable x
    set x From-x
    set y From-y
3499
3500
3501
3502
3503
3504
3505
3506

3507
3508
3509

3510
3511
3512
3513
3514
3515
3516
3501
3502
3503
3504
3505
3506
3507

3508
3509
3510

3511
3512
3513
3514
3515
3516
3517
3518







-
+


-
+







} -cleanup {
    destroy .b
} -result {0 {}}

test button-6.2 {ButtonEventProc procedure} -setup {
    set x {}
} -body {
    button .b1 -bg #543210
    button .b1 -background #543210
    rename .b1 .b2
    lappend x [winfo children .]
    lappend x [.b2 cget -bg]
    lappend x [.b2 cget -background]
    destroy .b1
    lappend x [info command .b*] [winfo children .]
} -cleanup {
    destroy .b1
} -result {.b1 #543210 {} {}}

test button-7.1 {ButtonCmdDeletedProc procedure} -body {
3755
3756
3757
3758
3759
3760
3761
3762

3763
3764
3765
3766
3767
3768
3769
3757
3758
3759
3760
3761
3762
3763

3764
3765
3766
3767
3768
3769
3770
3771







-
+








test button-11.1 {ButtonImageProc procedure} -constraints {
    testImageType
} -setup {
    label .l -highlightthickness 0 -font {Helvetica -12 bold}
    image create test image1
} -body {
    .l configure -image image1 -padx 0 -pady 0 -bd 0
    .l configure -image image1 -padx 0 -pady 0 -borderwidth 0
    pack .l
    set result "[winfo reqwidth .l] [winfo reqheight .l]"
    image1 changed 0 0 0 0 80 100
    lappend result [winfo reqwidth .l] [winfo reqheight .l]
} -cleanup {
    destroy .l
    image delete image1
Changes to tests/canvMoveto.test.
1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
20












-
+







# This file is a Tcl script to test out the canvas "moveto" command. It is
# derived from canvRect.test.
#
# Copyright © 1994-1996 Sun Microsystems, Inc.
# Copyright © 1998-1999 by Scriptics Corporation.
# Copyright © 2004 Neil McKay.
# All rights reserved.

package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands

canvas .c -width 400 -height 300 -bd 2 -relief sunken
canvas .c -width 400 -height 300 -borderwidth 2 -relief sunken
.c create rectangle 20 20 80 80 -tag {test rect1}
.c create rectangle 40 40 90 100 -tag {test rect2}

test canvMoveto-1.1 {Bad args handling for "moveto" command} -body {
    .c moveto test
} -returnCodes error -result {wrong # args: should be ".c moveto tagOrId x y"}
test canvMoveto-1.2 {Bad args handling for "moveto" command} -body {
Changes to tests/canvPs.test.
9
10
11
12
13
14
15
16

17
18
19
20
21
22
23
9
10
11
12
13
14
15

16
17
18
19
20
21
22
23







-
+







package require tcltest 2.2
namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
imageInit

# canvas used in 1.* and 2.* test cases
canvas .c -width 400 -height 300 -bd 2 -relief sunken
canvas .c -width 400 -height 300 -borderwidth 2 -relief sunken
.c create rectangle 20 20 80 80 -fill red
pack .c
update

test canvPs-1.1 {test writing to a file} -constraints {
    unixOrWin
} -setup {
144
145
146
147
148
149
150
151

152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167

168
169
170
171
172
173
174
144
145
146
147
148
149
150

151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166

167
168
169
170
171
172
173
174







-
+















-
+







    .c create arc 0 50 200 200 -tags arc0 \
	    -dash {4 4} -stipple question -outline red -fill green

    image create photo logo \
	-file [file join [file dirname [info script]] pwrdLogo150.gif]
    .c create image 200 50 -image logo -anchor nw

    entry .c.e -background pink -foreground blue -width 14
    entry .c.e -background pink -color blue -width 14
    .c.e insert 0 "we gonna be postscripted"
    .c create window 50 180 -anchor nw -window .c.e
    update
    .c postscript -file $bar
    file exists $bar
} -cleanup {
    destroy .c
    imageCleanup
    removeFile bar.ps
} -result 1
test canvPs-3.2 {test ps generation with an embedded window not mapped} -setup {
    set bar [makeFile {} bar.ps]
    file delete $bar
} -body {
    pack [canvas .c -width 200 -height 200 -background white]
    entry .c.e -background pink -foreground blue -width 14
    entry .c.e -background pink -color blue -width 14
    .c.e insert 0 "we gonna be postscripted"
    .c create window 50 180 -anchor nw -window .c.e
    .c postscript -file $bar
    file exists $bar
} -cleanup {
    destroy .c
    removeFile bar.ps
Changes to tests/canvPsArc.tcl.
16
17
18
19
20
21
22
23

24
25
26
27
28
29
30
16
17
18
19
20
21
22

23
24
25
26
27
28
29
30







-
+








frame .t.bot
pack .t.bot -side bottom -fill both
button .t.bot.quit -text Quit -command {destroy .t}
button .t.bot.print -text Print -command "lpr $c"
pack .t.bot.print .t.bot.quit -side left -pady 1m -expand 1

canvas $c -width 6i -height 6i -bd 2 -relief sunken
canvas $c -width 6i -height 6i -borderwidth 2 -relief sunken
pack $c -expand yes -fill both -padx 2m -pady 2m

$c create arc .5i .5i 2i 2i -style pieslice -start 20 -extent 90 \
    -fill black -outline {}
$c create arc 2.5i 0 4.5i 1i -style pieslice -start -45 -extent -135 \
    -fill {} -outline black -outlinestipple gray50 -width 3m
$c create arc 5.0i .5i 6.5i 2i -style pieslice -start 45 -extent 315 \
Changes to tests/canvPsBmap.tcl.
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
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







-
+






-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+








frame .t.bot
pack .t.bot -side bottom -fill both
button .t.bot.quit -text Quit -command {destroy .t}
button .t.bot.print -text Print -command "lpr $c"
pack .t.bot.print .t.bot.quit -side left -pady 1m -expand 1

canvas $c -width 6i -height 6i -bd 2 -relief sunken
canvas $c -width 6i -height 6i -borderwidth 2 -relief sunken
pack $c -expand yes -fill both -padx 2m -pady 2m

set canvPsBmapImageDir [file join [file dirname [info script]] images]

$c create bitmap 0.5i 0.5i \
    -bitmap @[file join $canvPsBmapImageDir flagdown.xbm] \
    -background {} -foreground black -anchor nw
    -background {} -color black -anchor nw
$c create rect 0.47i 0.47i 0.53i 0.53i -fill {} -outline black

$c create bitmap 3.0i 0.5i \
    -bitmap @[file join $canvPsBmapImageDir flagdown.xbm] \
    -background {} -foreground black -anchor n
    -background {} -color black -anchor n
$c create rect 2.97i 0.47i 3.03i 0.53i -fill {} -outline black

$c create bitmap 5.5i 0.5i \
    -bitmap @[file join $canvPsBmapImageDir flagdown.xbm] \
    -background black -foreground white -anchor ne
    -background black -color white -anchor ne
$c create rect 5.47i 0.47i 5.53i 0.53i -fill {} -outline black

$c create bitmap 0.5i 3.0i \
    -bitmap @[file join $canvPsBmapImageDir face.xbm] \
    -background {} -foreground black -anchor w
    -background {} -color black -anchor w
$c create rect 0.47i 2.97i 0.53i 3.03i -fill {} -outline black

$c create bitmap 3.0i 3.0i \
    -bitmap @[file join $canvPsBmapImageDir face.xbm] \
    -background {} -foreground black -anchor center
    -background {} -color black -anchor center
$c create rect 2.97i 2.97i 3.03i 3.03i -fill {} -outline black

$c create bitmap 5.5i 3.0i \
    -bitmap @[file join $canvPsBmapImageDir face.xbm] \
    -background blue -foreground black -anchor e
    -background blue -color black -anchor e
$c create rect 5.47i 2.97i 5.53i 3.03i -fill {} -outline black

$c create bitmap 0.5i 5.5i \
    -bitmap @[file join $canvPsBmapImageDir flagup.xbm] \
    -background black -foreground white -anchor sw
    -background black -color white -anchor sw
$c create rect 0.47i 5.47i 0.53i 5.53i -fill {} -outline black

$c create bitmap 3.0i 5.5i \
    -bitmap @[file join $canvPsBmapImageDir flagup.xbm] \
    -background green -foreground white -anchor s
    -background green -color white -anchor s
$c create rect 2.97i 5.47i 3.03i 5.53i -fill {} -outline black

$c create bitmap 5.5i 5.5i \
    -bitmap @[file join $canvPsBmapImageDir flagup.xbm] \
    -background {} -foreground black -anchor se
    -background {} -color black -anchor se
$c create rect 5.47i 5.47i 5.53i 5.53i -fill {} -outline black






Changes to tests/canvPsGrph.tcl.
30
31
32
33
34
35
36
37

38
39

40
41
42
43
44
45
46
30
31
32
33
34
35
36

37
38

39
40
41
42
43
44
45
46







-
+

-
+








frame .t.bot
pack .t.bot -side bottom -fill both
button .t.bot.quit -text Quit -command {destroy .t}
button .t.bot.print -text Print -command "lpr $c"
pack .t.bot.print .t.bot.quit -side left -pady 1m -expand 1

frame .t.mid -relief sunken -bd 2
frame .t.mid -relief sunken -borderwidth 2
pack .t.mid -side top -expand yes -fill both -padx 2m -pady 2m
canvas $c -width 400 -height 350 -bd 0 -relief sunken
canvas $c -width 400 -height 350 -borderwidth 0 -relief sunken
pack $c -expand yes -fill both -padx 1 -pady 1

proc mkObjs c {
    global what
    $c delete all
    if {$what == "rect"} {
	$c create rect 0 0 400 350 -outline black
Changes to tests/canvPsImg.tcl.
65
66
67
68
69
70
71
72

73
74
75
76
77
78
79
65
66
67
68
69
70
71

72
73
74
75
76
77
78
79







-
+







foreach l { monochrome gray color } {
    radiobutton .t.$l -text $l -variable level -value $l
    pack .t.$l -in .t.top.r -anchor w
}

set BitmapImage [image create bitmap \
	-file [file join [file dirname [info script]] face.xbm] \
	-background white -foreground black]
	-background white -color black]
set PhotoImage [image create photo \
	-file [file join [file dirname [info script]] teapot.ppm]]

BuildTestImage

frame .t.bot
pack .t.bot -side top -fill x -expand 1
Changes to tests/canvPsText.tcl.
21
22
23
24
25
26
27
28

29
30
31
32
33
34
35
21
22
23
24
25
26
27

28
29
30
31
32
33
34
35







-
+








frame .t.bot
pack .t.bot -side bottom -fill both
button .t.bot.quit -text Quit -command {destroy .t}
button .t.bot.print -text Print -command "lpr $c"
pack .t.bot.print .t.bot.quit -side left -pady 1m -expand 1

canvas $c -width 6i -height 7i -bd 2 -relief sunken
canvas $c -width 6i -height 7i -borderwidth 2 -relief sunken
pack $c -expand yes -fill both -padx 2m -pady 2m

$c create rect 2.95i 0.45i 3.05i 0.55i -fill {} -outline black
$c create text 3.0i 0.5i -text "Center Courier Oblique 24" \
	-anchor center -tags text -font {Courier 24 italic} -stipple $stipple
$c create rect 2.95i 0.95i 3.05i 1.05i -fill {} -outline black
$c create text 3.0i 1.0i -text "Northwest Helvetica 24" \
Changes to tests/canvRect.test.
8
9
10
11
12
13
14
15

16
17
18
19
20
21
22
8
9
10
11
12
13
14

15
16
17
18
19
20
21
22







-
+








package require tcltest 2.2
namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands

# Canvas used in every test case of the whole file
canvas .c -width 400 -height 300 -bd 2 -relief sunken
canvas .c -width 400 -height 300 -borderwidth 2 -relief sunken
pack .c
update

# Rectangle used in canvRect-1.* tests
.c create rectangle 20 20 80 80 -tag test
test canvRect-1.1 {configuration options: good value for -fill} -body {
    .c itemconfigure test -fill #ff0000
433
434
435
436
437
438
439
440

441
442
443
444
445
446
447
433
434
435
436
437
438
439

440
441
442
443
444
445
446
447







-
+







    .c delete withtag all
} -body {
    # Crashes on Mac because the XGetImage() call isn't implemented, causing a
    # dereference of NULL.
    # This test is non-portable because different color information
	# will get generated on different displays (e.g. mono displays
	# vs. color).
    .c configure -bd 0 -highlightthickness 0
    .c configure -borderwidth 0 -highlightthickness 0
    .c create rect 50 60 90 80 -fill black -stipple gray50 -outline {}
    .c create oval 100 150 200 200 -fill {} -outline #ff0000 -width 5
    update
    set x [.c postscript]
    string range $x [string first "-200 -150 translate" $x] end
} -result {-200 -150 translate
0 300 moveto 400 300 lineto 400 0 lineto 0 0 lineto closepath clip newpath
Changes to tests/canvText.test.
11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
11
12
13
14
15
16
17

18
19
20
21
22
23
24
25







-
+







eval tcltest::configure $argv
tcltest::loadTestedCommands

testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]

# Canvas used in 1.* - 17.* tests
canvas .c -width 400 -height 300 -bd 2 -relief sunken
canvas .c -width 400 -height 300 -borderwidth 2 -relief sunken
pack .c
update

# Item used in 1.*  tests
.c create text 20 20 -tag test
test canvText-1.1 {configuration options: good value for "anchor"} -body {
    .c itemconfigure test -anchor nw
461
462
463
464
465
466
467
468

469
470
471
472
473
474
475
461
462
463
464
465
466
467

468
469
470
471
472
473
474
475







-
+







} -result {}
test canvText-7.7 {DisplayText procedure: selected text different color} -setup {
    .c create text 20 20 -tag test
    .c itemconfig test -text "abcd\nefghi\njklmnopq"
    focus .c
    .c focus test
} -body {
    .c config -selectforeground blue
    .c config -selectcolor blue
    .c itemconfig test -anchor n
    update
} -cleanup {
    .c delete test
} -result {}
test canvText-7.8 {DisplayText procedure: not selected} -setup {
    .c create text 20 20 -tag test
868
869
870
871
872
873
874
875

876
877
878
879
880
881
882
868
869
870
871
872
873
874

875
876
877
878
879
880
881
882







-
+







end
%%EOF
}
} -body {
    set font {Courier 12 italic}
    set ax [font measure $font 0]
    set ay [font metrics $font -linespace]
    .c config -height 300 -highlightthickness 0 -bd 0
    .c config -height 300 -highlightthickness 0 -borderwidth 0
    update
    .c create text 100 100 -tags test
    .c itemconfig test -font $font -text "00000000" -width [expr 3*$ax]
    .c itemconfig test -anchor n -fill black
    set x [.c postscript]
    set x [string range $x [string first "findfont " $x] end]
    expr {$x eq [subst $result] ? "ok" : $x}
896
897
898
899
900
901
902
903

904
905
906
907
908
909
910
896
897
898
899
900
901
902

903
904
905
906
907
908
909
910







-
+







} -cleanup {
    destroy .c
    unset -nocomplain bbox x2 y2
} -result 1

test canvText-19.1 {patch 1006286, leading space caused wrap under Win32} -setup {
    destroy .c
    set c [canvas .c -bg black -width 964]
    set c [canvas .c -background black -width 964]
    pack $c
    $c delete all
    after 100 "set done 1"; vwait done
} -body {
    set f {Arial 28 bold}
    set s1 {    Yeah-ah-ah-ah-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-Yow}
    set s2 {    Yeah ah ah ah oh oh oh oh oh oh oh oh oh oh oh oh oh oh oh oh Yow}
965
966
967
968
969
970
971
972

973
974
975
976
977
978
979
965
966
967
968
969
970
971

972
973
974
975
976
977
978
979







-
+







} -cleanup {
    destroy .c
    rename transpose {}
} -result {ok ok ok}

test canvText-20.2 {crash on angled text selection (X11, without xft) - bug 2712f43f6e} -setup {
    destroy .c
    canvas .c -background bisque -selectforeground green2
    canvas .c -background bisque -selectcolor green2
    grid .c
    set id [.c create text 50 150 -anchor w -text "Angled text" \
	    -angle 30 -font {Helvetica 32} -fill darkblue]
} -body {
    .c select clear
    .c select from $id 0
    .c select to $id 8 ; update    ;  # used to crash on X11 (--disable-xft build only)
Changes to tests/canvWind.test.
11
12
13
14
15
16
17
18

19
20
21
22
23
24

25
26
27
28
29
30
31
11
12
13
14
15
16
17

18
19
20
21
22
23

24
25
26
27
28
29
30
31







-
+





-
+







eval tcltest::configure $argv
tcltest::loadTestedCommands

test canvWind-1.1 {DisplayWinItem, windows off-screen vertically} -setup {
    destroy .t
} -body {
    toplevel .t
    canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -bd 2 \
    canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -borderwidth 2 \
	    -relief sunken -xscrollincrement 1 -yscrollincrement 1 \
	    -highlightthickness 1
    pack .t.c -fill both -expand 1 -padx 20 -pady 20
    wm geometry .t +0+0
    set f .t.f
    frame $f -width 80 -height 50 -bg red
    frame $f -width 80 -height 50 -background red
    .t.c create window 300 400 -window $f -anchor nw
    .t.c xview moveto .3
    .t.c yview moveto .50
    update
    set x [list [list [winfo ismapped $f] [winfo y $f]]]
    .t.c yview scroll 52 units
    update
43
44
45
46
47
48
49
50

51
52
53
54
55
56

57
58
59
60
61
62
63
43
44
45
46
47
48
49

50
51
52
53
54
55

56
57
58
59
60
61
62
63







-
+





-
+







    destroy .t
} -result {{1 23} {1 -29} {0 -29} {1 225} {0 225}}

test canvWind-1.2 {DisplayWinItem, windows off-screen vertically} -setup {
    destroy .t
} -body {
    toplevel .t
    canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -bd 2 \
    canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -borderwidth 2 \
	    -relief sunken -xscrollincrement 1 -yscrollincrement 1 \
	    -highlightthickness 1
    pack .t.c -fill both -expand 1 -padx 20 -pady 20
    wm geometry .t +0+0
    set f .t.c.f
    frame $f -width 80 -height 50 -bg red
    frame $f -width 80 -height 50 -background red
    .t.c create window 300 400 -window $f -anchor nw
    .t.c xview moveto .3
    .t.c yview moveto .50
    update
    set x [list [list [winfo ismapped $f] [winfo y $f]]]
    .t.c yview scroll 52 units
    update
75
76
77
78
79
80
81
82

83
84
85
86
87
88

89
90
91
92
93
94
95
75
76
77
78
79
80
81

82
83
84
85
86
87

88
89
90
91
92
93
94
95







-
+





-
+







    destroy .t
} -result {{1 3} {1 -49} {0 -49} {1 205} {0 205}}

test canvWind-1.3 {DisplayWinItem, windows off-screen horizontally} -setup {
    destroy .t
} -body {
    toplevel .t
    canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -bd 2 \
    canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -borderwidth 2 \
	    -relief sunken -xscrollincrement 1 -yscrollincrement 1 \
	    -highlightthickness 1
    pack .t.c -fill both -expand 1 -padx 20 -pady 20
    wm geometry .t +0+0
    set f .t.f
    frame $f -width 80 -height 50 -bg red
    frame $f -width 80 -height 50 -background red
    .t.c create window 300 400 -window $f -anchor nw
    .t.c xview moveto .3
    .t.c yview moveto .50
    update
    set x [list [list [winfo ismapped $f] [winfo x $f]]]
    .t.c xview scroll 82 units
    update
107
108
109
110
111
112
113
114

115
116
117
118
119
120

121
122
123
124
125
126
127
107
108
109
110
111
112
113

114
115
116
117
118
119

120
121
122
123
124
125
126
127







-
+





-
+







    destroy .t
} -result {{1 23} {1 -59} {0 -59} {1 275} {0 275}}

test canvWind-1.4 {DisplayWinItem, windows off-screen horizontally} -setup {
    destroy .t
} -body {
    toplevel .t
    canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -bd 2 \
    canvas .t.c -scrollregion {0 0 1000 800} -width 250 -height 200 -borderwidth 2 \
	    -relief sunken -xscrollincrement 1 -yscrollincrement 1 \
	    -highlightthickness 1
    pack .t.c -fill both -expand 1 -padx 20 -pady 20
    wm geometry .t +0+0
    set f .t.c.f
    frame $f -width 80 -height 50 -bg red
    frame $f -width 80 -height 50 -background red
    .t.c create window 300 400 -window $f -anchor nw
    .t.c xview moveto .3
    .t.c yview moveto .50
    update
    set x [list [list [winfo ismapped $f] [winfo x $f]]]
    .t.c xview scroll 82 units
    update
Changes to tests/canvas.test.
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
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







-
-
+
+


-
+


-
-
+
+


-
+







    .c configure -background #ff0000
    .c cget -background
} -result {#ff0000}
test canvas-1.2 {configuration options: bad value for "background"} -body {
    .c configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test canvas-1.3 {configuration options: good value for "bg"} -body {
    .c configure -bg #ff0000
    .c cget -bg
    .c configure -background #ff0000
    .c cget -background
} -result {#ff0000}
test canvas-1.4 {configuration options: bad value for "bg"} -body {
    .c configure -bg non-existent
    .c configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test canvas-1.5 {configuration options: good value for "bd"} -body {
    .c configure -bd 4
    .c cget -bd
    .c configure -borderwidth 4
    .c cget -borderwidth
} -result 4
test canvas-1.6 {configuration options: bad value for "bd"} -body {
    .c configure -bd badValue
    .c configure -borderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}
test canvas-1.7 {configuration options: good value for "borderwidth"} -body {
    .c configure -borderwidth 1.3
    .c cget -borderwidth
} -result 1
test canvas-1.8 {configuration options: bad value for "borderwidth"} -body {
    .c configure -borderwidth badValue
150
151
152
153
154
155
156
157
158


159
160
161

162
163
164
165
166
167
168
150
151
152
153
154
155
156


157
158
159
160

161
162
163
164
165
166
167
168







-
-
+
+


-
+







    .c configure -selectborderwidth 1.3
    .c cget -selectborderwidth
} -result 1
test canvas-1.38 {configuration options: bad value for "selectborderwidth"} -body {
    .c configure -selectborderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}
test canvas-1.39 {configuration options: good value for "selectforeground"} -body {
    .c configure -selectforeground #654321
    .c cget -selectforeground
    .c configure -selectcolor #654321
    .c cget -selectcolor
} -result {#654321}
test canvas-1.40 {configuration options: bad value for "selectforeground"} -body {
    .c configure -selectforeground bogus
    .c configure -selectcolor bogus
} -returnCodes error -result {unknown color name "bogus"}
test canvas-1.41 {configuration options: good value for "takefocus"} -body {
    .c configure -takefocus "any string"
    .c cget -takefocus
} -result {any string}
test canvas-1.42 {configuration options: good value for "width"} -body {
    .c configure -width 402
186
187
188
189
190
191
192
193

194
195
196
197
198
199
200
186
187
188
189
190
191
192

193
194
195
196
197
198
199
200







-
+







    catch {.c configure -gorp foo}
    .c create rect 10 10 100 100
    .c configure -gorp foo
} -returnCodes error -match glob -result {*}
catch {destroy .c}

# Canvas used in 2.* test cases
canvas .c -width 60 -height 40 -scrollregion {0 0 200 150} -bd 0 \
canvas .c -width 60 -height 40 -scrollregion {0 0 200 150} -borderwidth 0 \
	-highlightthickness 0
pack .c
update

test canvas-2.1 {CanvasWidgetCmd, bind option} -body {
    set i [.c create rect 10 10 100 100]
    .c bind $i <a>
265
266
267
268
269
270
271
272

273
274
275

276
277
278
279
280
281
282
265
266
267
268
269
270
271

272
273
274

275
276
277
278
279
280
281
282







-
+


-
+







} -result {{0.0 0.5} {0.1 0.6}}
destroy .c

test canvas-4.1 {ButtonEventProc procedure} -setup {
    deleteWindows
    set x {}
} -body {
    canvas .c1 -bg #543210
    canvas .c1 -background #543210
    rename .c1 .c2
    lappend x [winfo children .]
    lappend x [.c2 cget -bg]
    lappend x [.c2 cget -background]
    destroy .c1
    lappend x [info command .c*] [winfo children .]
} -result {.c1 #543210 {} {}}

test canvas-5.1 {ButtonCmdDeletedProc procedure} -body {
    canvas .c1
    rename .c1 {}
Changes to tests/cmap.tcl.
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
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







-
-
+
+














-
+


-
+








proc colors {w redInc greenInc blueInc} {
    set red 0
    set green 0
    set blue 0
    for {set y 0} {$y < 8} {incr y} {
	for {set x 0} {$x < 8} {incr x} {
	    frame $w.f$x,$y -width 40 -height 40 -bd 2 -relief raised \
		    -bg [format #%02x%02x%02x $red $green $blue]
	    frame $w.f$x,$y -width 40 -height 40 -borderwidth 2 -relief raised \
		    -background [format #%02x%02x%02x $red $green $blue]
	    place $w.f$x,$y -x [expr {40*$x}] -y [expr {40*$y}]
	    incr red $redInc
	    incr green $greenInc
	    incr blue $blueInc
	}
    }
}

message .t.m -width 6i -text {This window displays two nested frames, each with a whole bunch of subwindows that eat up a lot of colors.  The toplevel window has its own colormap, which is inherited by the outer frame.  The inner frame has its own colormap.  As you move the mouse around, the colors in the frames should change back and forth.}
pack .t.m -side top -fill x

button .t.quit -text Quit -command {destroy .t}
pack .t.quit -side bottom -pady 3 -ipadx 4 -ipady 2

frame .t.f -width 700 -height 450 -relief raised -bd 2
frame .t.f -width 700 -height 450 -relief raised -borderwidth 2
pack .t.f -side top -padx 1c -pady 1c
colors .t.f 4 0 0
frame .t.f.f -width 350 -height 350 -colormap new -bd 2 -relief raised
frame .t.f.f -width 350 -height 350 -colormap new -borderwidth 2 -relief raised
place .t.f.f -relx 1.0 -rely 0 -anchor ne
colors .t.f.f 0 4 0
bind .t.f.f <Enter> {wm colormapwindows .t {.t.f.f .t}}
bind .t.f.f <Leave> {wm colormapwindows .t {.t .t.f.f}}

catch {destroy .t2}
toplevel .t2
Changes to tests/color.test.
32
33
34
35
36
37
38
39

40
41
42
43
44
45
46
32
33
34
35
36
37
38

39
40
41
42
43
44
45
46







-
+







# height -	Number of squares in each column.
# r, g, b -	Initial value for red, green, and blue intensities.
# rx, gx, bx -	Change in intensities between adjacent elements in row.
# ry, gy, by -	Change in intensities between adjacent elements in column.

proc mkColors {c width height r g b rx gx bx ry gy by} {
    catch {destroy $c}
    canvas $c -width 400 -height 200 -bd 0
    canvas $c -width 400 -height 200 -borderwidth 0
    for {set y 0} {$y < $height} {incr y} {
	for {set x 0} {$x < $width} {incr x} {
	    set color [format #%02x%02x%02x [expr $r + $y*$ry + $x*$rx] \
		    [expr $g + $y*$gy + $x*$gx] [expr $b + $y*$by + $x*$bx]]
	    $c create rectangle [expr 10*$x] [expr 20*$y] \
		    [expr 10*$x + 10] [expr 20*$y + 20] -outline {} \
		    -fill $color
117
118
119
120
121
122
123
124

125
126
127
128
129
130
131

132
133
134
135

136
137
138
139
140
141

142
143
144

145
146
147
148
149
150
151

152
153
154
155

156
157
158

159
160
161
162
163
164
165
117
118
119
120
121
122
123

124
125
126
127
128
129
130

131
132
133
134

135
136
137
138
139
140

141
142
143

144
145
146
147
148
149
150

151
152
153
154

155
156
157

158
159
160
161
162
163
164
165







-
+






-
+



-
+





-
+


-
+






-
+



-
+


-
+







    destroy .t.c .t.c2
}

test color-1.1 {Tk_AllocColorFromObj - converting internal reps} colorsFree {
    set x green
    lindex $x 0
    destroy .b1
    button .b1 -foreground $x -text .b1
    button .b1 -color $x -text .b1
    lindex $x 0
    testcolor green
} {{1 0}}
test color-1.2 {Tk_AllocColorFromObj - discard stale color} colorsFree {
    set x green
    destroy .b1 .b2
    button .b1 -foreground $x -text First
    button .b1 -color $x -text First
    destroy .b1
    set result {}
    lappend result [testcolor green]
    button .b2 -foreground $x -text Second
    button .b2 -color $x -text Second
    lappend result [testcolor green]
} {{} {{1 1}}}
test color-1.3 {Tk_AllocColorFromObj - reuse existing color} colorsFree {
    set x green
    destroy .b1 .b2
    button .b1 -foreground $x -text First
    button .b1 -color $x -text First
    set result {}
    lappend result [testcolor green]
    button .b2 -foreground $x -text Second
    button .b2 -color $x -text Second
    pack .b1 .b2 -side top
    lappend result [testcolor green]
} {{{1 1}} {{2 1}}}
test color-1.4 {Tk_AllocColorFromObj - try other colors in list} colorsFree {
    set x purple
    destroy .b1 .b2 .t.b
    button .b1 -foreground $x -text First
    button .b1 -color $x -text First
    pack .b1 -side top
    set result {}
    lappend result [testcolor purple]
    button .t.b -foreground $x -text Second
    button .t.b -color $x -text Second
    pack .t.b -side top
    lappend result [testcolor purple]
    button .b2 -foreground $x -text Third
    button .b2 -color $x -text Third
    pack .b2 -side top
    lappend result [testcolor purple]
} {{{1 1}} {{1 1} {1 0}} {{1 0} {2 1}}}
test color-1.5 {Color table} nonPortable {
    set fd [open ../xlib/rgb.txt]
    set result {}
    while {[gets $fd line] >= 0} {
231
232
233
234
235
236
237
238

239
240

241
242

243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267










268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287

288
289

290
291

292
293
294
295
296
297
298
231
232
233
234
235
236
237

238
239

240
241

242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257










258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286

287
288

289
290

291
292
293
294
295
296
297
298







-
+

-
+

-
+















-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+



















-
+

-
+

-
+







    pack .t.c2
    update
    closest .t 241 241 1
} {240 240 0}
test color-3.3 {Tk_FreeColorFromObj - reference counts} colorsFree {
    set x purple
    destroy .b1 .b2 .t.b
    button .b1 -foreground $x -text First
    button .b1 -color $x -text First
    pack .b1 -side top
    button .t.b -foreground $x -text Second
    button .t.b -color $x -text Second
    pack .t.b -side top
    button .b2 -foreground $x -text Third
    button .b2 -color $x -text Third
    pack .b2 -side top
    set result {}
    lappend result [testcolor purple]
    destroy .b1
    lappend result [testcolor purple]
    destroy .b2
    lappend result [testcolor purple]
    destroy .t.b
    lappend result [testcolor purple]
} {{{1 0} {2 1}} {{1 0} {1 1}} {{1 0}} {}}
test color-3.4 {Tk_FreeColorFromObj - unlinking from list} colorsFree {
    destroy .b .t.b .t2 .t3
    toplevel .t2 -visual {pseudocolor 8} -colormap new
    toplevel .t3 -visual {pseudocolor 8} -colormap new
    set x purple
    button .b -foreground $x -text .b1
    button .t.b1 -foreground $x -text .t.b1
    button .t.b2 -foreground $x -text .t.b2
    button .t2.b1 -foreground $x -text .t2.b1
    button .t2.b2 -foreground $x -text .t2.b2
    button .t2.b3 -foreground $x -text .t2.b3
    button .t3.b1 -foreground $x -text .t3.b1
    button .t3.b2 -foreground $x -text .t3.b2
    button .t3.b3 -foreground $x -text .t3.b3
    button .t3.b4 -foreground $x -text .t3.b4
    button .b -color $x -text .b1
    button .t.b1 -color $x -text .t.b1
    button .t.b2 -color $x -text .t.b2
    button .t2.b1 -color $x -text .t2.b1
    button .t2.b2 -color $x -text .t2.b2
    button .t2.b3 -color $x -text .t2.b3
    button .t3.b1 -color $x -text .t3.b1
    button .t3.b2 -color $x -text .t3.b2
    button .t3.b3 -color $x -text .t3.b3
    button .t3.b4 -color $x -text .t3.b4
    set result {}
    lappend result [testcolor purple]
    destroy .t2
    lappend result [testcolor purple]
    destroy .b
    lappend result [testcolor purple]
    destroy .t3
    lappend result [testcolor purple]
    destroy .t
    lappend result [testcolor purple]
} {{{4 1} {3 0} {2 0} {1 0}} {{4 1} {2 0} {1 0}} {{4 1} {2 0}} {{2 0}} {}}

test color-4.1 {FreeColorObjProc} -constraints {
    colorsFree
} -setup {
    proc copy {s} {return [string index $s 0][string range $s 1 end]}
} -body {
    destroy .b
    set x [copy purple]
    button .b -foreground $x -text .b1
    button .b -color $x -text .b1
    set y [copy purple]
    .b configure -foreground $y
    .b configure -color $y
    set z [copy purple]
    .b configure -foreground $z
    .b configure -color $z
    set result {}
    lappend result [testcolor purple]
    set x red
    lappend result [testcolor purple]
    set z 32
    lappend result [testcolor purple]
    destroy .b
Changes to tests/constraints.tcl.
215
216
217
218
219
220
221
222

223
224
225
226
227
228
229

230
231
232
233
234
235
236
215
216
217
218
219
220
221

222
223
224
225
226
227
228

229
230
231
232
233
234
235
236







-
+






-
+







testConstraint testtext      [llength [info commands testtext]]
testConstraint testwinevent  [llength [info commands testwinevent]]
testConstraint testwrapper   [llength [info commands testwrapper]]

# constraint to see what sort of fonts are available
testConstraint fonts 1
destroy .e
entry .e -width 0 -font {Helvetica -12} -bd 1 -highlightthickness 1
entry .e -width 0 -font {Helvetica -12} -borderwidth 1 -highlightthickness 1
.e insert end a.bcd
if {([winfo reqwidth .e] != 37) || ([winfo reqheight .e] != 20)} {
    testConstraint fonts 0
}
destroy .e
destroy .t
text .t -width 80 -height 20 -font {Times -14} -bd 1
text .t -width 80 -height 20 -font {Times -14} -borderwidth 1
pack .t
.t insert end "This is\na dot."
update
set x [list [.t bbox 1.3] [.t bbox 2.5]]
destroy .t
if {![string match {{22 3 6 15} {31 18 [34] 15}} $x]} {
    testConstraint fonts 0
Changes to tests/entry.test.
1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21













+







# This file is a Tcl script to test entry widgets in Tk.  It is
# organized in the standard fashion for Tcl tests.
#
# Copyright © 1994 The Regents of the University of California.
# Copyright © 1994-1997 Sun Microsystems, Inc.
# Copyright © 1998-1999 by Scriptics Corporation.
# All rights reserved.

package require tcltest 2.2
namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands

testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}]
testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
testConstraint failsOnUbuntuNoXft [expr {[testConstraint failsOnUbuntu] || (![catch {tk::pkgconfig get fontsystem} fs] && ($fs eq "xft"))}]
testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]

# For xscrollcommand
set scrollInfo {}
proc scroll args {
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
94


95
96
97
98
99
100
101
102
103

104
105
106
107
108
109
110
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


94
95
96
97
98
99
100
101
102
103

104
105
106
107
108
109
110
111







-
-
+
+








-
+









-
-
+
+








-
+







} -returnCodes {error} -result {unknown color name "non-existent"}

test entry-1.3 {configuration option: "bd" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
    update
} -body {
    .e configure -bd 4
    .e cget -bd
    .e configure -borderwidth 4
    .e cget -borderwidth
} -cleanup {
    destroy .e
} -result 4
test entry-1.4 {configuration option: "bd" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
    update
} -body {
    .e configure -bd badValue
    .e configure -borderwidth badValue
} -cleanup {
    destroy .e
} -returnCodes {error} -result {bad screen distance "badValue"}

test entry-1.5 {configuration option: "bg" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
    update
} -body {
    .e configure -bg #ff0000
    .e cget -bg
    .e configure -background #ff0000
    .e cget -background
} -cleanup {
    destroy .e
} -result {#ff0000}
test entry-1.6 {configuration option: "bg" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
    update
} -body {
    .e configure -bg non-existent
    .e configure -background non-existent
} -cleanup {
    destroy .e
} -returnCodes {error} -result {unknown color name "non-existent"}

test entry-1.7 {configuration option: "borderwidth" for entry} -setup {
    entry .e -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
166
167
168
169
170
171
172
173
174


175
176
177
178
179
180
181
182
183

184
185
186
187
188
189
190
167
168
169
170
171
172
173


174
175
176
177
178
179
180
181
182
183

184
185
186
187
188
189
190
191







-
-
+
+








-
+







} -returnCodes {error} -result {unknown color name "non-existent"}

test entry-1.13 {configuration option: "disabledforeground" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
    update
} -body {
    .e configure -disabledforeground blue
    .e cget -disabledforeground
    .e configure -disabledcolor blue
    .e cget -disabledcolor
} -cleanup {
    destroy .e
} -result {blue}
test entry-1.14 {configuration option: "disabledforeground" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
    update
} -body {
    .e configure -disabledforeground non-existent
    .e configure -disabledcolor non-existent
} -cleanup {
    destroy .e
} -returnCodes {error} -result {unknown color name "non-existent"}

test entry-1.15 {configuration option: "exportselection" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
206
207
208
209
210
211
212
213
214


215
216
217
218
219
220
221
222
223

224
225
226
227
228
229
230
207
208
209
210
211
212
213


214
215
216
217
218
219
220
221
222
223

224
225
226
227
228
229
230
231







-
-
+
+








-
+







} -returnCodes {error} -result {expected boolean value but got "xyzzy"}

test entry-1.17 {configuration option: "fg" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
    update
} -body {
    .e configure -fg #110022
    .e cget -fg
    .e configure -color #110022
    .e cget -color
} -cleanup {
    destroy .e
} -result {#110022}
test entry-1.18 {configuration option: "fg" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
    update
} -body {
    .e configure -fg non-existent
    .e configure -color non-existent
} -cleanup {
    destroy .e
} -returnCodes {error} -result {unknown color name "non-existent"}

test entry-1.19 {configuration option: "font" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2
    pack .e
246
247
248
249
250
251
252
253
254


255
256
257
258
259
260
261
262
263

264
265
266
267
268
269
270
247
248
249
250
251
252
253


254
255
256
257
258
259
260
261
262
263

264
265
266
267
268
269
270
271







-
-
+
+








-
+







} -returnCodes {error} -result {font "" doesn't exist}

test entry-1.21 {configuration option: "foreground" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
    update
} -body {
    .e configure -foreground #110022
    .e cget -foreground
    .e configure -color #110022
    .e cget -color
} -cleanup {
    destroy .e
} -result {#110022}
test entry-1.22 {configuration option: "foreground" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
    update
} -body {
    .e configure -foreground non-existent
    .e configure -color non-existent
} -cleanup {
    destroy .e
} -returnCodes {error} -result {unknown color name "non-existent"}

test entry-1.23 {configuration option: "highlightbackground" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
422
423
424
425
426
427
428
429

430
431
432
433
434
435
436
423
424
425
426
427
428
429

430
431
432
433
434
435
436
437







-
+







} -body {
    .e configure -invalidcommand "any string"
    .e cget -invalidcommand
} -cleanup {
    destroy .e
} -result {any string}

test entry-1.39 {configuration option: "invcmd" for entry} -setup {
test entry-1.39 {configuration option: "invcmd" for entry} -constraints nodeprecated -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
    update
} -body {
    .e configure -invcmd "any string"
    .e cget -invcmd
} -cleanup {
529
530
531
532
533
534
535
536
537


538
539
540
541
542
543
544
545
546

547
548
549
550
551
552
553
530
531
532
533
534
535
536


537
538
539
540
541
542
543
544
545
546

547
548
549
550
551
552
553
554







-
-
+
+








-
+







} -returnCodes {error} -result {bad screen distance "badValue"}

test entry-1.49 {configuration option: "selectforeground" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
    update
} -body {
    .e configure -selectforeground #110022
    .e cget -selectforeground
    .e configure -selectcolor #110022
    .e cget -selectcolor
} -cleanup {
    destroy .e
} -result {#110022}
test entry-1.50 {configuration option: "selectforeground" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
    update
} -body {
    .e configure -selectforeground non-existent
    .e configure -selectcolor non-existent
} -cleanup {
    destroy .e
} -returnCodes {error} -result {unknown color name "non-existent"}

test entry-1.51 {configuration option: "show" for entry} -setup {
    entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .e
637
638
639
640
641
642
643
644

645
646
647
648


649
650
651
652
653
654
655
638
639
640
641
642
643
644

645
646
647


648
649
650
651
652
653
654
655
656







-
+


-
-
+
+







} -body {
    .e configure -placeholder {Some text}
    .e cget -placeholder
} -cleanup {
    destroy .e
} -result {Some text}

test entry-1.60 {configuration option: "-placeholderforeground"} -setup {
test entry-1.60 {configuration option: "-placeholdercolor"} -setup {
    pack [entry .e]
} -body {
    .e configure -placeholder {Some text} -placeholderforeground red
    .e cget -placeholderforeground
    .e configure -placeholder {Some text} -placeholdercolor red
    .e cget -placeholdercolor
} -cleanup {
    destroy .e
} -result {red}


test entry-2.1 {Tk_EntryCmd procedure} -body {
    entry
813
814
815
816
817
818
819
820
821


822
823
824
825

826
827
828
829
830
831
832
833

834
835
836
837
838
839
840
841
842
843
844
845
846



847
848
849
850
851
852
853
814
815
816
817
818
819
820


821
822
823
824
825

826
827
828
829
830
831
832
833

834
835
836
837
838
839
840
841
842
843
844



845
846
847
848
849
850
851
852
853
854







-
-
+
+



-
+







-
+










-
-
-
+
+
+







    .e cget -gorp
} -cleanup {
    destroy .e
} -returnCodes error -result {unknown option "-gorp"}
test entry-3.14 {EntryWidgetCmd procedure, "cget" widget command} -setup {
    entry .e
} -body {
    .e configure -bd 4
    .e cget -bd
    .e configure -borderwidth 4
    .e cget -borderwidth
} -cleanup {
    destroy .e
} -result 4
test entry-3.15 {EntryWidgetCmd procedure, "configure" widget command} -setup {
test entry-3.15 {EntryWidgetCmd procedure, "configure" widget command} -constraints nodeprecated -setup {
    entry .e
    pack .e
    update
} -body {
    llength [.e configure]
} -cleanup {
    destroy .e
} -result 38
} -result 42
test entry-3.16 {EntryWidgetCmd procedure, "configure" widget command} -setup {
    entry .e
} -body {
    .e configure -foo
} -cleanup {
    destroy .e
} -returnCodes error -result {unknown option "-foo"}
test entry-3.17 {EntryWidgetCmd procedure, "configure" widget command} -setup {
    entry .e
} -body {
    .e configure -bd 4
    .e configure -bg #ffffff
    lindex [.e configure -bd] 4
    .e configure -borderwidth 4
    .e configure -background #ffffff
    lindex [.e configure -borderwidth] 4
} -cleanup {
    destroy .e
} -result 4
test entry-3.18 {EntryWidgetCmd procedure, "delete" widget command} -setup {
    entry .e
} -body {
    .e delete
1721
1722
1723
1724
1725
1726
1727
1728

1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741

1742
1743
1744
1745
1746
1747
1748
1722
1723
1724
1725
1726
1727
1728

1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741

1742
1743
1744
1745
1746
1747
1748
1749







-
+












-
+







} -result {62x37+0+0}
test entry-5.9 {ConfigureEntry procedure} -constraints {
    fonts
} -setup {
    entry .e -borderwidth 2 -highlightthickness 2
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief raised
    .e configure -font {Courier -12} -borderwidth 2 -relief raised
    .e insert end "0123"
    update
    list [.e index @10] [.e index @11] [.e index @12] [.e index @13]
} -cleanup {
    destroy .e
} -result {0 0 1 1}
test entry-5.10 {ConfigureEntry procedure} -constraints {
    fonts
} -setup {
    entry .e -borderwidth 2 -highlightthickness 2
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief flat
    .e configure -font {Courier -12} -borderwidth 2 -relief flat
    .e insert end "0123"
    update
    list [.e index @10] [.e index @11] [.e index @12] [.e index @13]
} -cleanup {
    destroy .e
} -result {0 0 1 1}
test entry-5.11 {ConfigureEntry procedure} -setup {
1761
1762
1763
1764
1765
1766
1767
1768

1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782

1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796

1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808

1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820

1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834

1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848

1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861

1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874

1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886

1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903

1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924

1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937

1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954

1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969

1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983

1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997

1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011

2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025

2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037

2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048

2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060

2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075

2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088

2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104

2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120

2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135

2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151

2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167

2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183

2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197

2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213

2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226

2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242

2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258

2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271

2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284

2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297

2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310

2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323

2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336

2337
2338
2339
2340
2341
2342
2343
1762
1763
1764
1765
1766
1767
1768

1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782

1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796

1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808

1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820

1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834

1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848

1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861

1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874

1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886

1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903

1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924

1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937

1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954

1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969

1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983

1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997

1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011

2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025

2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037

2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048

2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060

2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075

2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088

2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104

2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120

2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135

2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151

2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167

2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183

2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197

2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213

2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226

2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242

2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258

2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271

2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284

2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297

2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310

2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323

2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336

2337
2338
2339
2340
2341
2342
2343
2344







-
+













-
+













-
+











-
+











-
+













-
+













-
+












-
+












-
+











-
+
















-
+




















-
+












-
+
















-
+














-
+













-
+













-
+













-
+













-
+











-
+










-
+











-
+














-
+












-
+















-
+















-
+














-
+















-
+















-
+















-
+













-
+















-
+












-
+















-
+















-
+












-
+












-
+












-
+












-
+












-
+












-
+








test entry-6.1 {EntryComputeGeometry procedure} -constraints {
    fonts
} -setup {
    entry .e
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \
    .e configure -font {Courier -12} -borderwidth 2 -relief raised -width 20 \
        -highlightthickness 3
    .e insert end 012\t45
    update
    list [.e index @61] [.e index @62]
} -cleanup {
    destroy .e
} -result {3 4}
test entry-6.2 {EntryComputeGeometry procedure} -constraints {
    fonts
} -setup {
    entry .e
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \
    .e configure -font {Courier -12} -borderwidth 2 -relief raised -width 20 \
        -justify center -highlightthickness 3
    .e insert end 012\t45
    update
    list [.e index @96] [.e index @97]
} -cleanup {
    destroy .e
} -result {3 4}
test entry-6.3 {EntryComputeGeometry procedure} -constraints {
    fonts
} -setup {
    entry .e
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \
    .e configure -font {Courier -12} -borderwidth 2 -relief raised -width 20 \
        -justify right -highlightthickness 3
    .e insert end 012\t45
    update
    list [.e index @131] [.e index @132]
} -cleanup {
    destroy .e
} -result {3 4}
test entry-6.4 {EntryComputeGeometry procedure} -setup {
    entry .e
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief raised -width 5
    .e configure -font {Courier -12} -borderwidth 2 -relief raised -width 5
    .e insert end "01234567890"
    update
    .e xview 6
    .e index @0
} -cleanup {
    destroy .e
} -result 6
test entry-6.5 {EntryComputeGeometry procedure} -setup {
    entry .e -highlightthickness 2
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief raised -width 5
    .e configure -font {Courier -12} -borderwidth 2 -relief raised -width 5
    .e insert end "01234567890"
    update
    .e xview 7
    .e index @0
} -cleanup {
    destroy .e
} -result 6
test entry-6.6 {EntryComputeGeometry procedure} -constraints {
    fonts
} -setup {
    entry .e -highlightthickness 2
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief raised -width 10
    .e configure -font {Courier -12} -borderwidth 2 -relief raised -width 10
    .e insert end "01234\t67890"
    update
    .e xview 3
    list [.e index @39] [.e index @40]
} -cleanup {
    destroy .e
} -result {5 6}
test entry-6.7 {EntryComputeGeometry procedure} -constraints {
    fonts
} -setup {
    entry .e -highlightthickness 2
    pack .e
} -body {
    .e configure -font {Helvetica -24} -bd 3 -relief raised -width 5
    .e configure -font {Helvetica -24} -borderwidth 3 -relief raised -width 5
    .e insert end "01234567"
    update
    list [winfo reqwidth .e] [winfo reqheight .e]
} -cleanup {
    destroy .e
} -result {77 39}
test entry-6.8 {EntryComputeGeometry procedure} -constraints {
    fonts
} -setup {
    entry .e -highlightthickness 2
    pack .e
} -body {
    .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0
    .e configure -font {Helvetica -24} -borderwidth 3 -relief raised -width 0
    .e insert end "01234567"
    update
    list [winfo reqwidth .e] [winfo reqheight .e]
} -cleanup {
    destroy .e
} -result {116 39}
test entry-6.9 {EntryComputeGeometry procedure} -constraints {
    fonts
} -setup {
    entry .e -highlightthickness 2
    pack .e
} -body {
    .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0
    .e configure -font {Helvetica -24} -borderwidth 3 -relief raised -width 0
    update
    list [winfo reqwidth .e] [winfo reqheight .e]
} -cleanup {
    destroy .e
} -result {25 39}
test entry-6.10 {EntryComputeGeometry procedure} -constraints {
    unix fonts
} -setup {
    entry .e -highlightthickness 2 -font {Helvetica -12}
    pack .e
} -body {
    .e configure -bd 1 -relief raised -width 0 -show .
    .e configure -borderwidth 1 -relief raised -width 0 -show .
    .e insert 0 12345
    update
    set x [winfo reqwidth .e]
    .e configure -show X
    lappend x [winfo reqwidth .e]
    .e configure -show ""
    lappend x [winfo reqwidth .e]
} -cleanup {
    destroy .e
} -result {23 53 43}
test entry-6.11 {EntryComputeGeometry procedure} -constraints {
    win
} -setup {
    entry .e -highlightthickness 2
    pack .e
} -body {
    .e configure -bd 1 -relief raised -width 0 -show . -font {helvetica 12}
    .e configure -borderwidth 1 -relief raised -width 0 -show . -font {helvetica 12}
    .e insert 0 12345
    update
    set x1 [winfo reqwidth .e]
	set x2 [expr {8+5*[font measure {helvetica 12} .]}]
	set x [expr {$x1 eq $x2}]
    .e configure -show X
	set x1 [winfo reqwidth .e]
	set x2 [expr {8+5*[font measure {helvetica 12} X]}]
    lappend x [expr {$x1 eq $x2}]
    .e configure -show ""
	set x1 [winfo reqwidth .e]
	set x2 [expr {8+[font measure {helvetica 12} 12345]}]
    lappend x [expr {$x1 eq $x2}]
} -cleanup {
    destroy .e
} -result {1 1 1}
test entry-6.12 {EntryComputeGeometry procedure} -constraints {
    fonts
} -setup {
    catch {destroy .e}
    entry .e -font {Courier -12} -bd 2 -relief raised -width 20
    entry .e -font {Courier -12} -borderwidth 2 -relief raised -width 20
    pack .e
} -body {
    .e insert end "012\t456\t"
    update
    list [.e index @80] [.e index @81] [.e index @115] [.e index @116]
} -cleanup {
    destroy .e
} -result {6 7 7 8}


test entry-7.1 {InsertChars procedure} -setup {
    unset -nocomplain contents
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e configure -textvariable contents -xscrollcommand scroll
    set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
    .e insert 0 abcde
    .e insert 2 XXX
    vwait scrollInfo
    list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
    destroy .e
    after cancel $timeout
} -result {abXXXcde abXXXcde {0.000000 1.000000}}

test entry-7.2 {InsertChars procedure} -setup {
    unset -nocomplain contents
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e configure -textvariable contents -xscrollcommand scroll
    set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
    .e insert 0 abcde
    .e insert 500 XXX
    vwait scrollInfo
    list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
    destroy .e
    after cancel $timeout
} -result {abcdeXXX abcdeXXX {0.000000 1.000000}}
test entry-7.3 {InsertChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 0123456789
    .e select from 2
    .e select to 6
    .e insert 2 XXX
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 8
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {5 9 5 8}
test entry-7.4 {InsertChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 0123456789
    .e select from 2
    .e select to 6
    .e insert 3 XXX
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 8
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {2 9 2 8}
test entry-7.5 {InsertChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 0123456789
    .e select from 2
    .e select to 6
    .e insert 5 XXX
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 8
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {2 9 2 8}
test entry-7.6 {InsertChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 0123456789
    .e select from 2
    .e select to 6
    .e insert 6 XXX
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 5
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {2 6 2 5}
test entry-7.7 {InsertChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e configure -xscrollcommand scroll
    .e insert 0 0123456789
    .e icursor 4
    .e insert 4 XXX
    .e index insert
} -cleanup {
    destroy .e
} -result 7
test entry-7.8 {InsertChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 0123456789
    .e icursor 4
    .e insert 5 XXX
    .e index insert
} -cleanup {
    destroy .e
} -result 4
test entry-7.9 {InsertChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 "This is a very long string"
    update
    .e xview 4
    .e insert 3 XXX
    .e index @0
} -cleanup {
    destroy .e
} -result 7
test entry-7.10 {InsertChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 "This is a very long string"
    update
    .e xview 4
    .e insert 4 XXX
    .e index @0
} -cleanup {
    destroy .e
} -result 4

test entry-7.11 {InsertChars procedure} -constraints {
    fonts
} -setup {
    entry .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 0 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 "xyzzy"
    update
    .e insert 2 00
    winfo reqwidth .e
} -cleanup {
    destroy .e
} -result 59

test entry-8.1 {DeleteChars procedure} -setup {
    unset -nocomplain contents
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e configure -textvariable contents -xscrollcommand scroll
    set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
    .e insert 0 abcde
    .e delete 2 4
    vwait scrollInfo
    list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
    destroy .e
    after cancel $timeout
} -result {abe abe {0.000000 1.000000}}
test entry-8.2 {DeleteChars procedure} -setup {
    unset -nocomplain contents
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e configure -textvariable contents -xscrollcommand scroll
    set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
    .e insert 0 abcde
    .e delete -1 2
    vwait scrollInfo
    list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
    destroy .e
    after cancel $timeout
} -result {cde cde {0.000000 1.000000}}
test entry-8.3 {DeleteChars procedure} -setup {
    unset -nocomplain contents
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e configure -textvariable contents -xscrollcommand scroll
    set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
    .e insert 0 abcde
    .e delete 3 1000
    vwait scrollInfo
    list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
    destroy .e
    after cancel $timeout
} -result {abc abc {0.000000 1.000000}}
test entry-8.4 {DeleteChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 3
    .e select to 8
    .e delete 1 3
    update
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 5
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {1 6 1 5}
test entry-8.5 {DeleteChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 3
    .e select to 8
    .e delete 1 4
    update
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 4
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {1 5 1 4}
test entry-8.6 {DeleteChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 3
    .e select to 8
    .e delete 1 7
    update
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 5
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {1 2 1 5}
test entry-8.7 {DeleteChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 3
    .e select to 8
    .e delete 1 8
    update
    .e index sel.first
} -cleanup {
    destroy .e
} -returnCodes error -result {selection isn't in widget .e}
test entry-8.8 {DeleteChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 3
    .e select to 8
    .e delete 3 7
    update
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 8
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {3 4 3 8}
test entry-8.9 {DeleteChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 3
    .e select to 8
    .e delete 3 8
    update
    .e index sel.first
} -cleanup {
    destroy .e
} -returnCodes error -result {selection isn't in widget .e}
test entry-8.10 {DeleteChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 8
    .e select to 3
    .e delete 5 8
    update
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 8
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {3 5 5 8}
test entry-8.11 {DeleteChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 8
    .e select to 3
    .e delete 8 10
    update
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 4
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {3 8 4 8}
test entry-8.12 {DeleteChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e icursor 4
    .e delete 1 4
    update
    .e index insert
} -cleanup {
    destroy .e
} -result 1
test entry-8.13 {DeleteChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e icursor 4
    .e delete 1 5
    update
    .e index insert
} -cleanup {
    destroy .e
} -result 1
test entry-8.14 {DeleteChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e icursor 4
    .e delete 4 6
    update
    .e index insert
} -cleanup {
    destroy .e
} -result 4
test entry-8.15 {DeleteChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 "This is a very long string"
    .e xview 4
    .e delete 1 4
    update
    .e index @0
} -cleanup {
    destroy .e
} -result 1
test entry-8.16 {DeleteChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 "This is a very long string"
    .e xview 4
    .e delete 1 5
    update
    .e index @0
} -cleanup {
    destroy .e
} -result 1
test entry-8.17 {DeleteChars procedure} -setup {
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 "This is a very long string"
    .e xview 4
    .e delete 4 6
    update
    .e index @0
} -cleanup {
    destroy .e
} -result 4
test entry-8.18 {DeleteChars procedure} -constraints failsOnUbuntuNoXft -setup {
    entry .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2
    entry .e -width 0 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 "xyzzy"
    update
    .e delete 2 4
    # To check that deletion actually happened we measure the new width
2368
2369
2370
2371
2372
2373
2374
2375

2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386

2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399

2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412

2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425

2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440

2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456

2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471

2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485

2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497

2498
2499
2500

2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517

2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534

2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547

2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560

2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581

2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600

2601
2602
2603
2604
2605
2606
2607
2369
2370
2371
2372
2373
2374
2375

2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386

2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399

2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412

2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425

2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440

2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456

2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471

2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485

2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497

2498
2499
2500

2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517

2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534

2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547

2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560

2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581

2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600

2601
2602
2603
2604
2605
2606
2607
2608







-
+










-
+












-
+












-
+












-
+














-
+















-
+














-
+













-
+











-
+


-
+
















-
+
















-
+












-
+












-
+




















-
+


















-
+







    unset x
} -result {12345 12345}


test entry-10.1 {EntrySetValue procedure} -constraints fonts -body {
    set x abcde
    set y ab
    entry .e  -font {Helvetica -12} -highlightthickness 2 -bd 2  -width 0
    entry .e  -font {Helvetica -12} -highlightthickness 2 -borderwidth 2  -width 0
    pack .e
    .e configure -textvariable x
    .e configure -textvariable y
    update
    list [.e get] [winfo reqwidth .e]
} -cleanup {
    destroy .e
} -result {ab 24}
test entry-10.2 {EntrySetValue procedure, updating selection} -setup {
    unset -nocomplain x
    entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2
    entry .e -font {Helvetica -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e configure -textvariable x
    .e insert 0 "abcdefghjklmnopqrstu"
    .e selection range 4 10
    set x "a"
    .e index sel.first
} -cleanup {
    destroy .e
} -returnCodes error -result {selection isn't in widget .e}
test entry-10.3 {EntrySetValue procedure, updating selection} -setup {
    unset -nocomplain x
    entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2
    entry .e -font {Helvetica -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e configure -textvariable x
    .e insert 0 "abcdefghjklmnopqrstu"
    .e selection range 4 10
    set x "abcdefg"
    list [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {4 7}
test entry-10.4 {EntrySetValue procedure, updating selection} -setup {
    unset -nocomplain x
    entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2
    entry .e -font {Helvetica -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e configure -textvariable x
    .e insert 0 "abcdefghjklmnopqrstu"
    .e selection range 4 10
    set x "abcdefghijklmn"
    list [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {4 10}
test entry-10.5 {EntrySetValue procedure, updating display position} -setup {
    unset -nocomplain x
    entry .e -highlightthickness 2 -bd 2
    entry .e -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e configure -width 10 -font {Courier -12} -textvariable x
    .e insert 0 "abcdefghjklmnopqrstuvwxyz"
    .e xview 10
    update
    set x "abcdefg"
    update
    .e index @0
} -cleanup {
    destroy .e
} -result 0
test entry-10.6 {EntrySetValue procedure, updating display position} -setup {
    unset -nocomplain x
    entry .e -highlightthickness 2 -bd 2
    entry .e -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e configure -width 10 -font {Courier -12} -textvariable x
    pack .e
    .e insert 0 "abcdefghjklmnopqrstuvwxyz"
    .e xview 10
    update
    set x "1234567890123456789012"
    update
    .e index @0
} -cleanup {
    destroy .e
} -result 10
test entry-10.7 {EntrySetValue procedure, updating insertion cursor} -setup {
    unset -nocomplain x
    entry .e -highlightthickness 2 -bd 2
    entry .e -highlightthickness 2 -borderwidth 2
    pack .e
    update
} -body {
    .e configure -width 10 -font {Courier -12} -textvariable x
    pack .e
    .e insert 0 "abcdefghjklmnopqrstuvwxyz"
    .e icursor 5
    set x "123"
    .e index insert
} -cleanup {
    destroy .e
} -result 3
test entry-10.8 {EntrySetValue procedure, updating insertion cursor} -setup {
    unset -nocomplain x
    entry .e -highlightthickness 2 -bd 2
    entry .e -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e configure -width 10 -font {Courier -12} -textvariable x
    pack .e
    .e insert 0 "abcdefghjklmnopqrstuvwxyz"
    .e icursor 5
    set x "123456"
    .e index insert
} -cleanup {
    destroy .e
} -result 5

test entry-11.1 {EntryEventProc procedure} -setup {
    entry .e -highlightthickness 2 -bd 2 -font {Helvetica -12}
    entry .e -highlightthickness 2 -borderwidth 2 -font {Helvetica -12}
    pack .e
} -body {
    .e insert 0 abcdefg
    destroy .e
    update
} -cleanup {
    destroy .e
} -result {}
test entry-11.2 {EntryEventProc procedure} -setup {
    set x {}
} -body {
    entry .e1 -fg #112233
    entry .e1 -color #112233
    rename .e1 .e2
    lappend x [winfo children .]
    lappend x [.e2 cget -fg]
    lappend x [.e2 cget -color]
    destroy .e1
    lappend x [info command .e*] [winfo children .]
} -cleanup {
    destroy .e1
} -result {.e1 #112233 {} {}}

test entry-12.1 {EntryCmdDeletedProc procedure} -body {
    button .b -text "xyz_123"
    rename .b {}
    list [info command .b*] [winfo children .]
} -cleanup {
    destroy .b
} -result {{} {}}


test entry-13.1 {GetEntryIndex procedure} -setup {
    entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
    entry .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
    pack .e
} -body {
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index end
} -cleanup {
    destroy .e
} -result 21
test entry-13.2 {GetEntryIndex procedure} -body {
    entry .e
    .e index abogus
} -cleanup {
    destroy .e
} -returnCodes error -result {bad entry index "abogus"}
test entry-13.3 {GetEntryIndex procedure} -setup {
    entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
    entry .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
    pack .e
} -body {
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e select from 1
    .e select to 6
    .e index anchor
} -cleanup {
    destroy .e
} -result 1
test entry-13.4 {GetEntryIndex procedure} -setup {
    entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
    entry .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
    pack .e
} -body {
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e select from 4
    .e select to 1
    .e index anchor
} -cleanup {
    destroy .e
} -result 4
test entry-13.5 {GetEntryIndex procedure} -setup {
    entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
    entry .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
    pack .e
} -body {
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e select from 3
    .e select to 15
    .e select adjust 4
    .e index anchor
} -cleanup {
    destroy .e
} -result 15
test entry-13.6 {GetEntryIndex procedure} -setup {
    entry .e
} -body {
    .e index ebogus
} -cleanup {
    destroy .e
} -returnCodes error -result {bad entry index "ebogus"}
test entry-13.7 {GetEntryIndex procedure} -setup {
    entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
    entry .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
    pack .e
} -body {
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e icursor 2
    .e index insert
} -cleanup {
    destroy .e
} -result 2
test entry-13.8 {GetEntryIndex procedure} -setup {
    entry .e
} -body {
    .e index ibogus
} -cleanup {
    destroy .e
} -returnCodes error -result {bad entry index "ibogus"}
test entry-13.9 {GetEntryIndex procedure} -setup {
    entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
    entry .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
    pack .e
} -body {
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e select from 1
    .e select to 6
2615
2616
2617
2618
2619
2620
2621
2622

2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642

2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660

2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679

2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696

2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716

2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736

2737
2738
2739
2740
2741
2742
2743
2616
2617
2618
2619
2620
2621
2622

2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642

2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660

2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679

2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696

2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716

2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736

2737
2738
2739
2740
2741
2742
2743
2744







-
+



















-
+

















-
+


















-
+
















-
+



















-
+



















-
+










test entry-13.10 {GetEntryIndex procedure} -constraints x11 -body {
# On unix, when selection is cleared, entry widget's internal
# selection range is reset.
# Previous settings:
	entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
	entry .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
	pack .e
	.e insert 0 012345678901234567890
	.e xview 4
	update
    .e select from 1
    .e select to 6
    list [.e index sel.first] [.e index sel.last]
# Testing:
    selection clear .e
    .e index sel.first
} -cleanup {
    destroy .e
} -returnCodes error -result {selection isn't in widget .e}

test entry-13.11 {GetEntryIndex procedure} -constraints aquaOrWin32 -body {
# On mac and pc, when selection is cleared, entry widget remembers
# last selected range.  When selection ownership is restored to
# entry, the old range will be rehighlighted.
# Previous settings:
	entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
	entry .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
	pack .e
	.e insert 0 012345678901234567890
	.e xview 4
	update
    .e select from 1
    .e select to 6
    list [.e index sel.first] [.e index sel.last]
# Testing:
    selection clear .e
    catch {selection get}
    .e index sel.first
} -cleanup {
    destroy .e
} -result 1

test entry-13.12 {GetEntryIndex procedure} -constraints x11 -body {
# Previous settings:
	entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
	entry .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
	pack .e
	.e insert 0 012345678901234567890
	.e xview 4
	update
    .e select from 1
    .e select to 6
    list [.e index sel.first] [.e index sel.last]
# Testing:
    selection clear .e
    .e index sbogus
} -cleanup {
    destroy .e
} -returnCodes error -result {selection isn't in widget .e}

# why when string in .e index changed to not beginning with s,
# it behaves differently?
test entry-13.12.1 {GetEntryIndex procedure} -constraints unix -body {
# Previous settings:
	entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
	entry .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
	pack .e
	.e insert 0 012345678901234567890
	.e xview 4
	update
    .e select from 1
    .e select to 6
    list [.e index sel.first] [.e index sel.last]
# Testing:
    selection clear .e
    .e index bogus
} -cleanup {
    destroy .e
} -returnCodes error -result {bad entry index "bogus"}

test entry-13.13 {GetEntryIndex procedure} -constraints win -body {
# Previous settings:
	entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
	entry .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
	pack .e
	.e insert 0 012345678901234567890
	.e xview 4
	update
    .e select from 1
    .e select to 6
    list [.e index sel.first] [.e index sel.last]
# Testing:
    selection clear .e
    .e index sbogus
} -cleanup {
    destroy .e
} -returnCodes error -result {bad entry index "sbogus"}

test entry-13.14 {GetEntryIndex procedure} -constraints win -body {
# On mac and pc, when selection is cleared, entry widget remembers
# last selected range.  When selection ownership is restored to
# entry, the old range will be rehighlighted.
# Previous settings:
	entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
	entry .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
	pack .e
	.e insert 0 012345678901234567890
	.e xview 4
	update
    .e select from 1
    .e select to 6
    list [.e index sel.first] [.e index sel.last]
# Testing:
    selection clear .e
    selection get
} -cleanup {
    destroy .e
} -returnCodes error -match glob -result {*}

test entry-13.14.1 {GetEntryIndex procedure} -constraints win -body {
# On mac and pc, when selection is cleared, entry widget remembers
# last selected range.  When selection ownership is restored to
# entry, the old range will be rehighlighted.
# Previous settings:
	entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken
	entry .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
	pack .e
	.e insert 0 012345678901234567890
	.e xview 4
	update
    .e select from 1
    .e select to 6
    list [.e index sel.first] [.e index sel.last]
2754
2755
2756
2757
2758
2759
2760
2761

2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772

2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783

2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794

2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805

2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816

2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836

2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847

2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858

2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869

2870
2871
2872
2873
2874
2875
2876
2755
2756
2757
2758
2759
2760
2761

2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772

2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783

2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794

2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805

2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816

2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836

2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847

2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858

2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869

2870
2871
2872
2873
2874
2875
2876
2877







-
+










-
+










-
+










-
+










-
+










-
+



















-
+










-
+










-
+










-
+







    selection clear .e
    .e index @xyz
} -cleanup {
    destroy .e
} -returnCodes error -result {bad entry index "@xyz"}

test entry-13.16 {GetEntryIndex procedure} -constraints fonts -body {
    entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
    entry .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2\
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index @4
} -cleanup {
    destroy .e
} -result 4
test entry-13.17 {GetEntryIndex procedure} -constraints fonts -body {
    entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
    entry .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2\
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index @11
} -cleanup {
    destroy .e
} -result 4
test entry-13.18 {GetEntryIndex procedure} -constraints fonts -body {
    entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
    entry .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2\
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index @12
} -cleanup {
    destroy .e
} -result 5
test entry-13.19 {GetEntryIndex procedure} -constraints fonts -body {
    entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
    entry .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2\
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index @[expr {[winfo width .e] - 6}]
} -cleanup {
    destroy .e
} -result 8
test entry-13.20 {GetEntryIndex procedure} -constraints fonts -body {
    entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
    entry .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2\
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index @[expr {[winfo width .e] - 5}]
} -cleanup {
    destroy .e
} -result 9
test entry-13.21 {GetEntryIndex procedure} -body {
    entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
    entry .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2\
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index @1000
} -cleanup {
    destroy .e
} -result 9
test entry-13.22 {GetEntryIndex procedure} -setup {
    entry .e
    pack .e
    update
} -body {
    .e index 1xyz
} -cleanup {
    destroy .e
} -returnCodes error -result {bad entry index "1xyz"}
test entry-13.23 {GetEntryIndex procedure} -body {
    entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
    entry .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2\
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index -1
} -cleanup {
    destroy .e
} -result 0
test entry-13.24 {GetEntryIndex procedure} -body {
    entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
    entry .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2\
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index 12
} -cleanup {
    destroy .e
} -result 12
test entry-13.25 {GetEntryIndex procedure} -body {
    entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\
    entry .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2\
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index 49
} -cleanup {
    destroy .e
} -result 21
test entry-13.26 {GetEntryIndex procedure} -constraints fonts -body {
    entry .e -highlightthickness 2 -bd 2 -font {Helvetica -12}
    entry .e -highlightthickness 2 -borderwidth 2 -font {Helvetica -12}
    selection clear .e
    .e configure -show .
    .e insert 0 XXXYZZY
    pack .e
    update
    list [.e index @7] [.e index @8]
} -cleanup {
3049
3050
3051
3052
3053
3054
3055
3056

3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071

3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087

3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103

3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119

3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135

3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152

3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169

3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188

3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209

3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227

3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248

3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266

3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285

3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304

3305
3306
3307
3308
3309
3310
3311
3050
3051
3052
3053
3054
3055
3056

3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071

3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087

3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103

3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119

3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135

3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152

3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169

3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188

3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209

3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227

3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248

3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266

3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285

3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304

3305
3306
3307
3308
3309
3310
3311
3312







-
+














-
+















-
+















-
+















-
+















-
+
















-
+
















-
+


















-
+




















-
+

















-
+




















-
+

















-
+


















-
+


















-
+







test entry-19.1 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert 0 a
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e 1 0 a {} a all key}

test entry-19.2 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert 0 a   ;# previous settings
    .e insert 1 b
    return $::vVals
} -cleanup {
    destroy .e
} -result {.e 1 1 ab a b all key}

test entry-19.3 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert 0 ab   ;# previous settings
    .e insert end c
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e 1 2 abc ab c all key}

test entry-19.4 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert 0 abc   ;# previous settings
    .e insert 1 123
    list $::vVals $::e
} -cleanup {
    destroy .e
} -result {{.e 1 1 a123bc abc 123 all key} a123bc}

test entry-19.5 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert 0 a123bc   ;# previous settings
    .e delete 2
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e 0 2 a13bc a123bc 2 all key}

test entry-19.6 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert 0 a13bc   ;# previous settings
    .e configure -validate key
    .e delete 1 3
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e 0 1 abc a13bc 13 key key}

test entry-19.7 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate focus \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abc                 ;# previous settings
    set ::vVals {}
    .e insert end d
    set ::vVals
} -cleanup {
    destroy .e
} -result {}

test entry-19.8 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e configure -validate focus    ;# previous settings
    .e insert end abcd              ;# previous settings
    focus -force .e
# update necessary to process FocusIn event
    update
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e -1 -1 abcd abcd {} focus focusin}

test entry-19.9 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate focus \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd      ;# previous settings
    focus -force .e         ;# previous settings
    update                  ;# previous settings
# update necessary to process FocusIn event
    focus -force .
# update necessary to process FocusOut event
    update
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e -1 -1 abcd abcd {} focus focusout}

test entry-19.10 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd          ;# previous settings
    focus -force .e
# update necessary to process FocusIn event
    update
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e -1 -1 abcd abcd {} all focusin}

test entry-19.11 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd          ;# previous settings
    focus -force .e             ;# previous settings
# update necessary to process FocusIn event
    update                      ;# previous settings
    focus -force .
# update necessary to process FocusOut event
    update
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e -1 -1 abcd abcd {} all focusout}

test entry-19.12 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate focusin \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert 0 abcd              ;# previous settings
    focus -force .e
# update necessary to process FocusIn event
    update
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e -1 -1 abcd abcd {} focusin focusin}

test entry-19.13 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate focusin \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd              ;# previous settings
    set ::vVals {}
    focus -force .
# update necessary to process FocusOut event
    update
    set ::vVals
} -cleanup {
    destroy .e
} -result {}

test entry-19.14 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate focuso \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd              ;# previous settings
    set ::vVals {}                  ;# previous settings
    focus -force .e
# update necessary to process FocusIn event
    update
    set ::vVals
} -cleanup {
    destroy .e
} -result {}

test entry-19.15 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate focuso \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd              ;# previous settings
    set ::vVals {}                  ;# previous settings
    focus -force .e                 ;# previous settings
# update necessary to process FocusIn event
    update                          ;# previous settings
    focus -force .
3320
3321
3322
3323
3324
3325
3326
3327

3328
3329
3330
3331
3332
3333
3334
3321
3322
3323
3324
3325
3326
3327

3328
3329
3330
3331
3332
3333
3334
3335







-
+







test entry-19.16 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate focuso \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd              ;# previous settings
    set ::vVals {}                  ;# previous settings
    focus -force .e                 ;# previous settings
# update necessary to process FocusIn event
    update                          ;# previous settings
    focus -force .
3343
3344
3345
3346
3347
3348
3349
3350

3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368

3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388

3389
3390
3391
3392
3393
3394
3395
3344
3345
3346
3347
3348
3349
3350

3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368

3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388

3389
3390
3391
3392
3393
3394
3395
3396







-
+

















-
+



















-
+







test entry-19.17 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate focuso \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd              ;# previous settings
    set ::e newdata
    list [.e cget -validate] $::vVals
} -cleanup {
    destroy .e
} -result {focusout {.e -1 -1 newdata abcd {} focusout forced}}


# proc doval changed - returns 0
test entry-19.18 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate all \
        -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    set ::e newdata                 ;# previous settings
    .e configure -validate all
    set ::e nextdata
    list [.e cget -validate] $::vVals
} -cleanup {
    destroy .e
} -result {none {.e -1 -1 nextdata newdata {} all forced}}

## This sets validate to none because it shows that we prevent a possible
## loop condition in the validation, when the entry textvar is also set
# proc doval2 used
test entry-19.19 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate all \
        -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    set ::e nextdata                 ;# previous settings

    .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V]
    .e validate
    list [.e cget -validate] [.e get] $::vVals
} -cleanup {
3404
3405
3406
3407
3408
3409
3410
3411

3412
3413
3414
3415
3416
3417
3418
3405
3406
3407
3408
3409
3410
3411

3412
3413
3414
3415
3416
3417
3418
3419







-
+







test entry-19.20 {entry widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    entry .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    set ::e nextdata                 ;# previous settings
    .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V] ;# prev
    .e validate                     ;# previous settings

    .e configure -validate all
    set ::e testdata
3502
3503
3504
3505
3506
3507
3508
3509

3510
3511
3512
3513
3514
3515
3516
3503
3504
3505
3506
3507
3508
3509

3510
3511
3512
3513
3514
3515
3516
3517







-
+







    destroy .e
} -result 0

test entry-20.7 {widget deletion with textvariable active} -body {
# SF bugs 607390 and 617446
    set FOO init
    entry .e -textvariable FOO -validate all \
	    -vcmd {%W configure -bg white; format 1}
	    -validatecommand {%W configure -background white; format 1}
    bind .e <Destroy> { set FOO hello }
    destroy .e
    winfo exists .e
} -cleanup {
    destroy .e
} -result 0

Changes to tests/focus.test.
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
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







-
+









-
+







testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]

proc focusSetup {} {
    destroy .t
    toplevel .t
    wm geom .t +0+0
    foreach i {b1 b2 b3 b4} {
	    button .t.$i -text .t.$i -relief raised -bd 2
	    button .t.$i -text .t.$i -relief raised -borderwidth 2
	    pack .t.$i
    }
    tkwait visibility .t.b4
}
proc focusSetupAlt {} {
    global env
    destroy .alt
    toplevel .alt -screen $env(TK_ALT_DISPLAY)
    foreach i {a b c d} {
	button .alt.$i -text .alt.$i -relief raised -bd 2
	button .alt.$i -text .alt.$i -relief raised -borderwidth 2
	pack .alt.$i
    }
    tkwait visibility .alt.d
}


# The following procedure ensures that there is no input focus
48
49
50
51
52
53
54
55

56
57
58
59
60
61
62
48
49
50
51
52
53
54

55
56
57
58
59
60
61
62







-
+







    tkwait variable x
    dobg {focus -force .; update}
    update
}


# Button used in some tests in the whole test file
button .b -text .b -relief raised -bd 2
button .b -text .b -relief raised -borderwidth 2
pack .b

# Make sure the window manager knows who has focus
catch {fixfocus}

# cleanupbg will be after 4.3 test
setupbg
110
111
112
113
114
115
116
117
118


119
120
121
122
123
124
125
110
111
112
113
114
115
116


117
118
119
120
121
122
123
124
125







-
-
+
+







	unix
} -setup {
    destroy .t2
} -body {
    focusClear
    toplevel .t2
    wm geom .t2 +10+10
    frame .t2.f -width 200 -height 100 -bd 2 -relief raised
    frame .t2.f2 -width 200 -height 100 -bd 2 -relief raised
    frame .t2.f -width 200 -height 100 -borderwidth 2 -relief raised
    frame .t2.f2 -width 200 -height 100 -borderwidth 2 -relief raised
    pack .t2.f .t2.f2
    bind .t2.f <Destroy> {focus .t2.f}
    bind .t2.f2 <Destroy> {focus .t2}
    focus -force .t2.f2
    tkwait visibility .t2.f2
    update
    set x [focus]
630
631
632
633
634
635
636
637

638
639
640
641
642
643
644
645

646
647
648
649
650
651
652
630
631
632
633
634
635
636

637
638
639
640
641
642
643
644

645
646
647
648
649
650
651
652







-
+







-
+







    eval interp delete [interp slaves]
} -body {
    toplevel .t
    wm geometry .t +0+0
    frame .t.f1 -container 1
    frame .t.f2
    pack .t.f1 .t.f2
    entry .t.f2.e1 -bg red
    entry .t.f2.e1 -background red
    pack .t.f2.e1
    bind all <FocusIn> {lappend x "focus in %W %d"}
    bind all <FocusOut> {lappend x "focus out %W %d"}
    interp create child
    child eval "set argv {-use [winfo id .t.f1]}"
    load {} Tk child
    child eval {
	    entry .e1 -bg lightBlue
	    entry .e1 -background lightBlue
	    pack .e1
	    bind all <FocusIn> {lappend x "focus in %W %d"}
	    bind all <FocusOut> {lappend x "focus out %W %d"}
	    set x {}
    }

    # Claim the focus and wait long enough for it to really arrive.
685
686
687
688
689
690
691
692

693
694
695
696
697
698

699
700
701
702
703
704
705
685
686
687
688
689
690
691

692
693
694
695
696
697

698
699
700
701
702
703
704
705







-
+





-
+







} -body {
    setupbg
    toplevel .t
    wm geometry .t +0+0
    frame .t.f1 -container 1
    frame .t.f2
    pack .t.f1 .t.f2
    entry .t.f2.e1 -bg red
    entry .t.f2.e1 -background red
    pack .t.f2.e1
    bind all <FocusIn> {lappend x "focus in %W %d"}
    bind all <FocusOut> {lappend x "focus out %W %d"}
    setupbg -use [winfo id .t.f1]
    dobg {
	    entry .e1 -bg lightBlue
	    entry .e1 -background lightBlue
	    pack .e1
	    bind all <FocusIn> {lappend x "focus in %W %d"}
	    bind all <FocusOut> {lappend x "focus out %W %d"}
	    set x {}
    }

    # Claim the focus and wait long enough for it to really arrive.
Changes to tests/focusTcl.test.
18
19
20
21
22
23
24
25

26
27
28
29
30
31
32
18
19
20
21
22
23
24

25
26
27
28
29
30
31
32







-
+








proc setup1 w {
    if {$w == "."} {
        set w ""
    }
    foreach i {a b c d} {
        destroy $w.$i
        frame  $w.$i -width 200 -height 50 -bd 2 -relief raised
        frame  $w.$i -width 200 -height 50 -borderwidth 2 -relief raised
        pack $w.$i
    }
    .b configure -width 0 -height 0
    foreach i {x y z} {
        destroy $w.b.$i
        button $w.b.$i -text "Button $w.b.$i"
        pack $w.b.$i -side left
Changes to tests/font.test.
522
523
524
525
526
527
528
529

530
531
532
533
534
535
536
522
523
524
525
526
527
528

529
530
531
532
533
534
535
536







-
+







test font-12.2 {UpdateDependantFonts procedure: pings the widgets} -setup {
    destroy .t.f
    catch {font delete xyz}
    pack [label .t.f]
    update
} -body {
    font create xyz -family times -size 20
    .t.f config -font xyz -text "abcd" -padx 0 -bd 0 -highlightthickness 0
    .t.f config -font xyz -text "abcd" -padx 0 -borderwidth 0 -highlightthickness 0
    set a1 [font measure xyz "abcd"]
    update
    set b1 [winfo reqwidth .t.f]
    font configure xyz -family helvetica -size 20
    set a2 [font measure xyz "abcd"]
    update
    set b2 [winfo reqwidth .t.f]
710
711
712
713
714
715
716
717

718
719
720
721
722
723
724
710
711
712
713
714
715
716

717
718
719
720
721
722
723
724







-
+







    # not (ParseFontNameObj() != TCL_OK)
    lindex [font actual {plan 9}] 0
} -result {-family}
test font-15.12 {Tk_AllocFontFromObj procedure: setup tab width} -setup {
    destroy .l
} -body {
    # Tk_MeasureChars(fontPtr, "0", ...)
    label .l -bd 0 -padx 0  -highlightthickness 0 -font $fixed -text "a\tb"
    label .l -borderwidth 0 -padx 0  -highlightthickness 0 -font $fixed -text "a\tb"
    update
    set res1 [winfo reqwidth .l]
	set res2 [expr [font measure $fixed "0"]*9]
	expr {$res1 eq $res2}
} -cleanup {
    destroy .l
} -result 1
1449
1450
1451
1452
1453
1454
1455
1456

1457
1458
1459
1460
1461
1462
1463
1449
1450
1451
1452
1453
1454
1455

1456
1457
1458
1459
1460
1461
1462
1463







-
+







    set x [psfontname {{times new roman} 12 italic bold}]
} -result {Times-BoldItalic}


test font-22.1 {Tk_TextWidth procedure} -setup {
    destroy .t.l
} -body {
    label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
    label .t.l -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0 -justify left \
	    -text "0" -font "Courier -12"
    pack .t.l
    set ax [winfo reqwidth .t.l]
    expr {[font measure [.t.l cget -font] "000"] eq $ax*3}
} -cleanup {
    destroy .t.l
} -result 1
1474
1475
1476
1477
1478
1479
1480
1481

1482
1483
1484
1485
1486
1487
1488
1474
1475
1476
1477
1478
1479
1480

1481
1482
1483
1484
1485
1486
1487
1488







-
+







} -cleanup {
    destroy .t.t
} -result {}


# Data used in 24.* tests
destroy .t.l
label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
label .t.l -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0 -justify left \
	-text "0" -font "Courier -12"
pack .t.l
update
set ax [winfo reqwidth .t.l]
set ay [winfo reqheight .t.l]
test font-24.1 {Tk_ComputeTextLayout: empty string} -body {
    .t.l config -text ""
Changes to tests/frame.test.
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
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







+













-
+







# All rights reserved.

package require tcltest 2.2
namespace import ::tcltest::*
tcltest::configure {*}$argv
tcltest::loadTestedCommands

tcltest::testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}]
tcltest::testConstraint x11 [expr {[tk windowingsystem] eq "x11"}]

# eatColors --
# Creates a toplevel window and allocates enough colors in it to use up all
# the slots in an 8-bit colormap.
#
# Arguments:
# w -		Name of toplevel window to create.

proc eatColors {w} {
    catch {destroy $w}
    toplevel $w
    wm geom $w +0+0
    canvas $w.c -width 400 -height 200 -bd 0
    canvas $w.c -width 400 -height 200 -borderwidth 0
    pack $w.c
    for {set y 0} {$y < 8} {incr y} {
	for {set x 0} {$x < 40} {incr x} {
	    set color [format #%02x%02x%02x [expr {$x*6}] [expr {$y*30}] 0]
	    $w.c create rectangle [expr {10*$x}] [expr {20*$y}] \
		[expr {10*$x + 10}] [expr {20*$y + 20}] -outline {} \
		-fill $color
187
188
189
190
191
192
193
194
195


196
197

198
199
200

201
202
203
204


205
206

207
208
209

210
211
212
213
214
215
216
188
189
190
191
192
193
194


195
196
197

198
199
200

201
202
203


204
205
206

207
208
209

210
211
212
213
214
215
216
217







-
-
+
+

-
+


-
+


-
-
+
+

-
+


-
+







} -cleanup {
    .f configure -background [lindex [.f configure -background] 3]
} -result "#ff0000"
test frame-1.14 {frame configuration options} -body {
    .f configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test frame-1.15 {frame configuration options} -body {
    .f configure -bd 4
    lindex [.f configure -bd] 4
    .f configure -borderwidth 4
    lindex [.f configure -borderwidth] 4
} -cleanup {
    .f configure -bd [lindex [.f configure -bd] 3]
    .f configure -borderwidth [lindex [.f configure -borderwidth] 3]
} -result 4
test frame-1.16 {frame configuration options} -body {
    .f configure -bd badValue
    .f configure -borderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}
test frame-1.17 {frame configuration options} -body {
    .f configure -bg #00ff00
    lindex [.f configure -bg] 4
    .f configure -background #00ff00
    lindex [.f configure -background] 4
} -cleanup {
    .f configure -bg [lindex [.f configure -bg] 3]
    .f configure -background [lindex [.f configure -background] 3]
} -result "#00ff00"
test frame-1.18 {frame configuration options} -body {
    .f configure -bg non-existent
    .f configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test frame-1.19 {frame configuration options} -body {
    .f configure -borderwidth 1.3
    lindex [.f configure -borderwidth] 4
} -cleanup {
    .f configure -borderwidth [lindex [.f configure -borderwidth] 3]
} -result 1
494
495
496
497
498
499
500
501
502


503
504
505

506
507
508
509


510
511
512

513
514
515
516
517
518
519
495
496
497
498
499
500
501


502
503
504
505

506
507
508


509
510
511
512

513
514
515
516
517
518
519
520







-
-
+
+


-
+


-
-
+
+


-
+







    .t configure -background #ff0000
    lindex [.t configure -background] 4
} -result "#ff0000"
test frame-2.21 {toplevel configuration options} -body {
    .t configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test frame-2.22 {toplevel configuration options} -body {
    .t configure -bd 4
    lindex [.t configure -bd] 4
    .t configure -borderwidth 4
    lindex [.t configure -borderwidth] 4
} -result 4
test frame-2.23 {toplevel configuration options} -body {
    .t configure -bd badValue
    .t configure -borderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}
test frame-2.24 {toplevel configuration options} -body {
    .t configure -bg #00ff00
    lindex [.t configure -bg] 4
    .t configure -background #00ff00
    lindex [.t configure -background] 4
} -result "#00ff00"
test frame-2.25 {toplevel configuration options} -body {
    .t configure -bg non-existent
    .t configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test frame-2.26 {toplevel configuration options} -body {
    .t configure -borderwidth 1.3
    lindex [.t configure -borderwidth] 4
} -result 1
test frame-2.27 {toplevel configuration options} -body {
    .t configure -borderwidth badValue
595
596
597
598
599
600
601
602

603
604
605
606
607
608
609
596
597
598
599
600
601
602

603
604
605
606
607
608
609
610







-
+







    .t configure -class
} -cleanup {
    deleteWindows
} -result {-class class Class Toplevel Toplevel}
test frame-3.4 {TkCreateFrame procedure} -setup {
    deleteWindows
} -body {
    toplevel .t -width 350 -class NewClass -bg black -visual default -height 90
    toplevel .t -width 350 -class NewClass -background black -visual default -height 90
    wm geometry .t +0+0
    update
    list [lindex [.t configure -width] 4] \
	    [lindex [.t configure -background] 4] \
	    [lindex [.t configure -height] 4]
} -cleanup {
    deleteWindows
645
646
647
648
649
650
651
652

653
654
655
656
657
658
659
646
647
648
649
650
651
652

653
654
655
656
657
658
659
660







-
+







test frame-3.9 {TkCreateFrame procedure, -use option} -constraints {
    unix
} -setup {
    deleteWindows
} -body {
    toplevel .t -container 1 -width 300 -height 120
    wm geometry .t +0+0
    toplevel .x -width 140 -height 300 -use [winfo id .t] -bg green
    toplevel .x -width 140 -height 300 -use [winfo id .t] -background green
    tkwait visibility .x
    list [expr {[winfo rootx .x] - [winfo rootx .t]}] \
	    [expr {[winfo rooty .x] - [winfo rooty .t]}] \
	    [winfo width .t] [winfo height .t]
} -cleanup {
    # This call to update idletasks was added to prevent a crash that was
    # observed on OSX 10.12 (Sierra) only.  Any change, such as using the
672
673
674
675
676
677
678
679

680
681
682
683
684
685
686
673
674
675
676
677
678
679

680
681
682
683
684
685
686
687







-
+







    wm geometry .t +0+0
    if {[tk windowingsystem] eq "aqua"} {
	update idletasks
    } else {
	update
    }
    option add *x.use [winfo id .t]
    toplevel .x -width 140 -height 300 -bg green
    toplevel .x -width 140 -height 300 -background green
    if {[tk windowingsystem] eq "aqua"} {
	update idletasks
    } else {
	tkwait visibility .x
	update
    }
    list [expr {[winfo rootx .x] - [winfo rootx .t]}] \
697
698
699
700
701
702
703
704

705
706
707
708
709
710
711
712
713
714
715
716

717
718
719
720
721
722
723
724
725
726
727
728
729
730

731
732
733
734
735
736
737
738
739
740
741
742
743
744
745

746
747
748
749
750
751
752
753
754
755
756
757
758
759
760

761
762
763
764
765
766
767
768
769
770
771

772
773
774
775
776
777
778
779
780
781
782
783

784
785
786
787
788
789
790
791
792
793
794
795
796

797
798
799
800
801
802
803
804
805
806
807
808
809
810

811
812
813
814
815
816
817
818
819
820
821
822
823
824
825

826
827
828
829
830
831
832
833
834
835
836
837
838

839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855

856
857
858
859
860
861
862
698
699
700
701
702
703
704

705
706
707
708
709
710
711
712
713
714
715
716

717
718
719
720
721
722
723
724
725
726
727
728
729
730

731
732
733
734
735
736
737
738
739
740
741
742
743
744
745

746
747
748
749
750
751
752
753
754
755
756
757
758
759
760

761
762
763
764
765
766
767
768
769
770
771

772
773
774
775
776
777
778
779
780
781
782
783

784
785
786
787
788
789
790
791
792
793
794
795
796

797
798
799
800
801
802
803
804
805
806
807
808
809
810

811
812
813
814
815
816
817
818
819
820
821
822
823
824
825

826
827
828
829
830
831
832
833
834
835
836
837
838

839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855

856
857
858
859
860
861
862
863







-
+











-
+













-
+














-
+














-
+










-
+











-
+












-
+













-
+














-
+












-
+
















-
+







    eatColors .t1
}
test frame-3.11 {TkCreateFrame procedure} -constraints {
    defaultPseudocolor8 nonPortable
} -setup {
    destroy .t
} -body {
    toplevel .t -width 300 -height 200 -bg #475601
    toplevel .t -width 300 -height 200 -background #475601
    wm geometry .t +0+0
    update
    colorsFree .t
} -cleanup {
    destroy .t
} -result 0
test frame-3.12 {TkCreateFrame procedure} -constraints {
    defaultPseudocolor8 nonPortable
} -setup {
    destroy .t
} -body {
    toplevel .t -width 300 -height 200 -bg #475601 -colormap new
    toplevel .t -width 300 -height 200 -background #475601 -colormap new
    wm geometry .t +0+0
    update
    colorsFree .t
} -cleanup {
    destroy .t
} -result 1
test frame-3.13 {TkCreateFrame procedure} -constraints {
    defaultPseudocolor8 nonPortable
} -setup {
    destroy .t
} -body {
    option add *t.class Toplevel2
    option add *Toplevel2.colormap new
    toplevel .t -width 300 -height 200 -bg #475601
    toplevel .t -width 300 -height 200 -background #475601
    wm geometry .t +0+0
    update
    option clear
    colorsFree .t
} -cleanup {
    destroy .t
} -result 1
test frame-3.14 {TkCreateFrame procedure} -constraints {
    defaultPseudocolor8 nonPortable
} -setup {
    destroy .t
} -body {
    option add *t.class Toplevel3
    option add *Toplevel3.Colormap new
    toplevel .t -width 300 -height 200 -bg #475601 -colormap new
    toplevel .t -width 300 -height 200 -background #475601 -colormap new
    wm geometry .t +0+0
    update
    option clear
    colorsFree .t
} -cleanup {
    destroy .t
} -result 1
test frame-3.15 {TkCreateFrame procedure, -use and -colormap} -constraints {
    defaultPseudocolor8 unix nonPortable
} -setup {
    destroy .t
} -body {
    toplevel .t -container 1 -width 300 -height 120
    wm geometry .t +0+0
    toplevel .x -width 140 -height 300 -use [winfo id .t] -bg green -colormap new
    toplevel .x -width 140 -height 300 -use [winfo id .t] -background green -colormap new
    tkwait visibility .x
    list [colorsFree .t] [colorsFree .x]
} -cleanup {
    destroy .t
} -result {0 1}
test frame-3.16 {TkCreateFrame procedure} -constraints {
    defaultPseudocolor8 nonPortable
} -setup {
    destroy .t
} -body {
    toplevel .t -width 300 -height 200 -bg #475601 -visual default
    toplevel .t -width 300 -height 200 -background #475601 -visual default
    wm geometry .t +0+0
    update
    colorsFree .t
} -cleanup {
    destroy .t
} -result 0
test frame-3.17 {TkCreateFrame procedure} -constraints {
    defaultPseudocolor8 nonPortable
} -setup {
    destroy .t
} -body {
    toplevel .t -width 300 -height 200 -bg #475601 -visual default \
    toplevel .t -width 300 -height 200 -background #475601 -visual default \
	    -colormap new
    wm geometry .t +0+0
    update
    colorsFree .t
} -cleanup {
    destroy .t
} -result 1
test frame-3.18 {TkCreateFrame procedure} -constraints {
    defaultPseudocolor8 haveGrayscale8 nonPortable
} -setup {
    destroy .t
} -body {
    toplevel .t -visual {grayscale 8} -width 300 -height 200 -bg #434343
    toplevel .t -visual {grayscale 8} -width 300 -height 200 -background #434343
    wm geometry .t +0+0
    update
    colorsFree .t 131 131 131
} -cleanup {
    destroy .t
} -result 1
test frame-3.19 {TkCreateFrame procedure} -constraints {
    defaultPseudocolor8 haveGrayscale8 nonPortable
} -setup {
    destroy .t
} -body {
    option add *t.class T4
    option add *T4.visual {grayscale 8}
    toplevel .t -width 300 -height 200 -bg #434343
    toplevel .t -width 300 -height 200 -background #434343
    wm geometry .t +0+0
    update
    option clear
    list [colorsFree .t 131 131 131] [lindex [.t configure -visual] 4]
} -cleanup {
    destroy .t
} -result {1 {grayscale 8}}
test frame-3.20 {TkCreateFrame procedure} -constraints {
    defaultPseudocolor8 haveGrayscale8 nonPortable
} -setup {
    destroy .t
} -body {
    option add *t.class T5
    option add *T5.Visual {grayscale 8}
    toplevel .t -width 300 -height 200 -bg #434343
    toplevel .t -width 300 -height 200 -background #434343
    wm geometry .t +0+0
    update
    option clear
    list [colorsFree .t 131 131 131] [lindex [.t configure -visual] 4]
} -cleanup {
    destroy .t
} -result {1 {grayscale 8}}
test frame-3.21 {TkCreateFrame procedure} -constraints {
    defaultPseudocolor8 haveGrayscale8 nonPortable
} -setup {
    destroy .t
} -body {
    toplevel .t -visual {grayscale 8} -width 300 -height 200 -bg #434343
    toplevel .t -visual {grayscale 8} -width 300 -height 200 -background #434343
    wm geometry .t +0+0
    update
    colorsFree .t 131 131 131
} -cleanup {
    destroy .t
} -result 1
if {[testConstraint defaultPseudocolor8]} {
    destroy .t1
}
test frame-3.22 {TkCreateFrame procedure, default dimensions} -setup {
    deleteWindows
} -body {
    toplevel .t
    wm geometry .t +0+0
    update
    set result "[winfo reqwidth .t] [winfo reqheight .t]"
    frame .t.f -bg red
    frame .t.f -background red
    pack .t.f
    update
    lappend result [winfo reqwidth .t.f] [winfo reqheight .t.f]
} -cleanup {
    deleteWindows
} -result {200 200 1 1}
test frame-3.23 {TkCreateFrame procedure} -setup {
908
909
910
911
912
913
914
915

916
917
918
919
920
921
922
923
924
925
926
927
928
929
930

931
932
933
934
935
936
937
909
910
911
912
913
914
915

916
917
918
919
920
921
922
923
924
925
926
927
928
929
930

931
932
933
934
935
936
937
938







-
+














-
+







    destroy .t
} -body {
    toplevel .t
    .t cget -screen
} -cleanup {
    destroy .t
} -returnCodes ok -match glob -result *
test frame-5.8 {FrameWidgetCommand procedure, configure option} -body {
test frame-5.8 {FrameWidgetCommand procedure, configure option} -constraints nodeprecated -body {
    optnames [.f configure]
} -result {-background -backgroundimage -bd -bg -bgimg -borderwidth -class -colormap -container -cursor -height -highlightbackground -highlightcolor -highlightthickness -padx -pady -relief -takefocus -tile -visual -width}
test frame-5.9 {FrameWidgetCommand procedure, configure option} -body {
    .f configure -gorp
} -returnCodes error -result {unknown option "-gorp"}
test frame-5.10 {FrameWidgetCommand procedure, configure option} -body {
    .f configure -gorp bogus
} -returnCodes error -result {unknown option "-gorp"}
test frame-5.11 {FrameWidgetCommand procedure, configure option} -body {
    .f configure -width 200 -height
} -returnCodes error -result {value for "-height" missing}
test frame-5.12 {FrameWidgetCommand procedure} -body {
    .f swizzle
} -returnCodes error -result {bad option "swizzle": must be cget or configure}
test frame-5.13 {FrameWidgetCommand procedure, configure option} -body {
test frame-5.13 {FrameWidgetCommand procedure, configure option} -constraints nodeprecated -body {
    optnames [. configure]
} -result {-background -backgroundimage -bd -bg -bgimg -borderwidth -class -colormap -container -cursor -height -highlightbackground -highlightcolor -highlightthickness -menu -padx -pady -relief -screen -takefocus -tile -use -visual -width}
destroy .f

test frame-6.1 {ConfigureFrame procedure} -setup {
    deleteWindows
} -body {
970
971
972
973
974
975
976
977

978
979
980

981
982
983
984
985
986
987
971
972
973
974
975
976
977

978
979
980

981
982
983
984
985
986
987
988







-
+


-
+







    destroy .frame2
    lappend result [info commands .frame2]
} -result {.frame2 {}}
test frame-7.2 {FrameEventProc procedure} -setup {
    deleteWindows
    set x {}
} -body {
    frame .f1 -bg #543210
    frame .f1 -background #543210
    rename .f1 .f2
    lappend x [winfo children .]
    lappend x [.f2 cget -bg]
    lappend x [.f2 cget -background]
    destroy .f1
    lappend x [info command .f*] [winfo children .]
} -cleanup {
    deleteWindows
} -result {.f1 #543210 {} {}}

test frame-8.1 {FrameCmdDeletedProc procedure} -setup {
1092
1093
1094
1095
1096
1097
1098
1099

1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113

1114
1115
1116
1117
1118
1119
1120
1093
1094
1095
1096
1097
1098
1099

1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113

1114
1115
1116
1117
1118
1119
1120
1121







-
+













-
+







} -cleanup {
    deleteWindows
} -result {}

test frame-12.1 {FrameWorldChanged procedure} -setup {
    deleteWindows
} -body {
    # Test -bd -padx and -pady
    # Test -borderwidth -padx and -pady
    frame .f -borderwidth 2 -padx 3 -pady 4
    place .f -x 0 -y 0 -width 40 -height 40
    pack [frame .f.f] -fill both -expand 1
    update
    list [winfo x .f.f] [winfo y .f.f] [winfo width .f.f] [winfo height .f.f]
} -cleanup {
    deleteWindows
} -result {5 6 30 28}
test frame-12.2 {FrameWorldChanged procedure} -setup {
    deleteWindows
} -body {
    # Test all -labelanchor positions
    set font {helvetica 12}
    labelframe .f -highlightthickness 1 -bd 3 -padx 1 -pady 2 -font $font \
    labelframe .f -highlightthickness 1 -borderwidth 3 -padx 1 -pady 2 -font $font \
            -text "Mupp"
    set fh [expr {max([font metrics $font -linespace] + 2 - 3, 0)}]
    set fw [expr {max([font measure $font "Mupp"] + 2 - 3, 0)}]
    place .f -x 0 -y 0 -width 100 -height 100
    pack [frame .f.f] -fill both -expand 1
    set result {}
    foreach lp {nw n ne en e es se s sw ws w wn} {
1244
1245
1246
1247
1248
1249
1250
1251
1252


1253
1254

1255
1256
1257

1258
1259
1260
1261


1262
1263

1264
1265
1266

1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288



1289
1290

1291
1292
1293


1294
1295
1296
1297
1298
1299
1300
1301
1302
1303


1304
1305

1306
1307
1308

1309
1310
1311
1312
1313
1314
1315
1245
1246
1247
1248
1249
1250
1251


1252
1253
1254

1255
1256
1257

1258
1259
1260


1261
1262
1263

1264
1265
1266

1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286



1287
1288
1289
1290

1291
1292


1293
1294
1295
1296
1297
1298
1299
1300
1301
1302


1303
1304
1305

1306
1307
1308

1309
1310
1311
1312
1313
1314
1315
1316







-
-
+
+

-
+


-
+


-
-
+
+

-
+


-
+



















-
-
-
+
+
+

-
+

-
-
+
+








-
-
+
+

-
+


-
+







} -cleanup {
    .f configure -background [lindex [.f configure -background] 3]
} -result "#ff0000"
test frame-13.11 {labelframe configuration options} -body {
    .f configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test frame-13.12 {labelframe configuration options} -body {
    .f configure -bd 4
    lindex [.f configure -bd] 4
    .f configure -borderwidth 4
    lindex [.f configure -borderwidth] 4
} -cleanup {
    .f configure -bd [lindex [.f configure -bd] 3]
    .f configure -borderwidth [lindex [.f configure -borderwidth] 3]
} -result 4
test frame-13.13 {labelframe configuration options} -body {
    .f configure -bd badValue
    .f configure -borderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}
test frame-13.14 {labelframe configuration options} -body {
    .f configure -bg #00ff00
    lindex [.f configure -bg] 4
    .f configure -background #00ff00
    lindex [.f configure -background] 4
} -cleanup {
    .f configure -bg [lindex [.f configure -bg] 3]
    .f configure -background [lindex [.f configure -background] 3]
} -result "#00ff00"
test frame-13.15 {labelframe configuration options} -body {
    .f configure -bg non-existent
    .f configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test frame-13.16 {labelframe configuration options} -body {
    .f configure -borderwidth 1.3
    lindex [.f configure -borderwidth] 4
} -cleanup {
    .f configure -borderwidth [lindex [.f configure -borderwidth] 3]
} -result 1
test frame-13.17 {labelframe configuration options} -body {
    .f configure -borderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}
test frame-13.18 {labelframe configuration options} -body {
    .f configure -cursor arrow
    lindex [.f configure -cursor] 4
} -cleanup {
    .f configure -cursor [lindex [.f configure -cursor] 3]
} -result {arrow}
test frame-13.19 {labelframe configuration options} -body {
    .f configure -cursor badValue
} -returnCodes error -result {bad cursor spec "badValue"}
test frame-13.20 {labelframe configuration options} -body {
    .f configure -fg #0000ff
    lindex [.f configure -fg] 4
test frame-13.20 {labelframe configuration options} -constraints nodeprecated -body {
    .f configure -color #0000ff
    lindex [.f configure -color] 4
} -cleanup {
    .f configure -fg [lindex [.f configure -fg] 3]
    .f configure -color [lindex [.f configure -color] 3]
} -result "#0000ff"
test frame-13.21 {labelframe configuration options} -body {
    .f configure -fg non-existent
test frame-13.21 {labelframe configuration options} -constraints nodeprecated -body {
    .f configure -color non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test frame-13.22 {labelframe configuration options} -body {
    .f configure -font {courier 8}
    lindex [.f configure -font] 4
} -cleanup {
    .f configure -font [lindex [.f configure -font] 3]
} -result {courier 8}
test frame-13.23 {labelframe configuration options} -body {
    .f configure -foreground #ff0000
    lindex [.f configure -foreground] 4
    .f configure -color #ff0000
    lindex [.f configure -color] 4
} -cleanup {
    .f configure -foreground [lindex [.f configure -foreground] 3]
    .f configure -color [lindex [.f configure -color] 3]
} -result "#ff0000"
test frame-13.24 {labelframe configuration options} -body {
    .f configure -foreground non-existent
    .f configure -color non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test frame-13.25 {labelframe configuration options} -body {
    .f configure -height 100
    lindex [.f configure -height] 4
} -cleanup {
    .f configure -height [lindex [.f configure -height] 3]
} -result 100
1537
1538
1539
1540
1541
1542
1543
1544

1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560

1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577

1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591

1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604

1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625

1626
1627
1628
1629
1630
1631
1632
1538
1539
1540
1541
1542
1543
1544

1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560

1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577

1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591

1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604

1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625

1626
1627
1628
1629
1630
1631
1632
1633







-
+















-
+
















-
+













-
+












-
+




















-
+







    image create photo gorp -width 10 -height 10
    gorp put black -to 2 2 7 7
} -body {
    frame .f -width 100 -height 100 -backgroundimage gorp
    pack .f
    .f configure -tile yes
    update
    list [.f cget -bgimg] [.f cget -tile]
    list [.f cget -backgroundimage] [.f cget -tile]
} -cleanup {
    image delete gorp
    deleteWindows
} -result {gorp 1}
test frame-15.4 {TIP 262: frame background images} -setup {
    deleteWindows
    image create photo gorp -width 10 -height 10
    gorp put black -to 2 2 7 7
} -body {
    frame .f -width 100 -height 100 -backgroundimage gorp
    pack .f
    .f configure -tile yes
    update
    gorp put red -to 15 15 20 20
    update
    list [.f cget -bgimg] [.f cget -tile]
    list [.f cget -backgroundimage] [.f cget -tile]
} -cleanup {
    image delete gorp
    deleteWindows
} -result {gorp 1}
test frame-15.5 {TIP 262: frame background images} -setup {
    deleteWindows
    image create photo gorp -width 10 -height 10
    gorp put black -to 2 2 7 7
    set result {}
} -body {
    frame .f -width 100 -height 100 -backgroundimage gorp
    pack .f
    .f configure -tile yes
    update
    image delete gorp
    update
    set result [list [.f cget -bgimg] [.f cget -tile]]
    set result [list [.f cget -backgroundimage] [.f cget -tile]]
    image create photo gorp -width 250 -height 250
    update
    lappend result [.f cget -backgroundimage]
} -cleanup {
    catch {image delete gorp}
    deleteWindows
} -result {gorp 1 gorp}
test frame-15.6 {TIP 262: frame background images} -setup {
    deleteWindows
    set result {}
    . configure -width 200 -height 200
} -constraints testImageType -body {
    image create test gorp -variable result
    pack [frame .f -width 100 -height 100 -bgimg gorp]
    pack [frame .f -width 100 -height 100 -backgroundimage gorp]
    update idletasks; update
    return [uniq $result]
} -cleanup {
    deleteWindows
    catch {image delete gorp}
} -result {{gorp get} {gorp display 0 0 30 15}}
test frame-15.6a {TIP 262: frame background images (offsets)} -setup {
    deleteWindows
    set result {}
    . configure -width 200 -height 200
} -constraints testImageType -body {
    image create test gorp -variable result
    pack [frame .f -width 10 -height 10 -bgimg gorp]
    pack [frame .f -width 10 -height 10 -backgroundimage gorp]
    update idletasks; update
    # On MacOS must wait for the test image display procedure to run.
    set timer [after 300 {lappend result "timedout"}]
    while {"timedout" ni $result &&
	   "gorp display 10 2 10 10" ni $result} {
       vwait result
    }
    after cancel $timer
    update idletasks; update
    return [uniq $result]
} -cleanup {
    deleteWindows
    catch {image delete gorp}
} -result {{gorp get} {gorp display 10 2 10 10}}
test frame-15.7 {TIP 262: frame background images} -setup {
    deleteWindows
    set result {}
    . configure -width 200 -height 200
} -constraints testImageType -body {
    image create test gorp -variable result
    pack [frame .f -width 50 -height 25 -bgimg gorp -tile 1]
    pack [frame .f -width 50 -height 25 -backgroundimage gorp -tile 1]
    update idletasks; update
    # On MacOS must wait for the test image display procedure to run.
    set timer [after 300 {lappend result "timedout"}]
    while {"timedout" ni $result &&
	   "gorp display 0 0 20 10" ni $result} {
	vwait result
    }
1641
1642
1643
1644
1645
1646
1647
1648

1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668

1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681

1682
1683
1684
1685
1686
1687
1688
1642
1643
1644
1645
1646
1647
1648

1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668

1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681

1682
1683
1684
1685
1686
1687
1688
1689







-
+



















-
+












-
+







} -result {{gorp get} {gorp display 0 0 30 15} {gorp display 0 0 30 10} {gorp display 0 0 20 15} {gorp display 0 0 20 10}}
test frame-15.7a {TIP 262: frame background images (offsets)} -setup {
    deleteWindows
    set result {}
    . configure -width 200 -height 200
} -constraints testImageType -body {
    image create test gorp -variable result
    pack [frame .f -width 50 -height 25 -bgimg gorp -tile 1 -highlightthick 1]
    pack [frame .f -width 50 -height 25 -backgroundimage gorp -tile 1 -highlightthick 1]
    update idletasks; update
    # On MacOS must wait for the test image display procedure to run.
    set timer [after 300 {lappend result "timedout"}]
    while {"timedout" ni $result &&
	   "gorp display 0 0 18 8" ni $result} {
	vwait result
   }
    after cancel $timer
    return [uniq $result]
} -cleanup {
    deleteWindows
    catch {image delete gorp}
} -result {{gorp get} {gorp display 0 0 30 15} {gorp display 0 0 30 8} {gorp display 0 0 18 15} {gorp display 0 0 18 8}}
test frame-15.7b {TIP 262: frame background images (offsets)} -setup {
    deleteWindows
    set result {}
    . configure -width 200 -height 200
} -constraints testImageType -body {
    image create test gorp -variable result
    pack [frame .f -width 50 -height 25 -bgimg gorp -tile 1 -bd 2]
    pack [frame .f -width 50 -height 25 -backgroundimage gorp -tile 1 -borderwidth 2]
    update idletasks; update
    return [uniq $result]
} -cleanup {
    deleteWindows
    catch {image delete gorp}
} -result {{gorp get} {gorp display 0 0 30 15} {gorp display 0 0 30 6} {gorp display 0 0 16 15} {gorp display 0 0 16 6}}
test frame-15.7c {TIP 262: frame background images (offsets)} -setup {
    deleteWindows
    set result {}
    . configure -width 200 -height 200
} -constraints testImageType -body {
    image create test gorp -variable result
    pack [frame .f -width 50 -height 25 -bgimg gorp -tile 1 -bd 2 -highlightthick 1]
    pack [frame .f -width 50 -height 25 -backgroundimage gorp -tile 1 -borderwidth 2 -highlightthick 1]
    update idletasks; update
    return [uniq $result]
} -cleanup {
    deleteWindows
    catch {image delete gorp}
} -result {{gorp get} {gorp display 0 0 30 15} {gorp display 0 0 30 4} {gorp display 0 0 14 15} {gorp display 0 0 14 4}}
test frame-15.8 {TIP 262: toplevel background images} -setup {
1715
1716
1717
1718
1719
1720
1721
1722

1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736

1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751

1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764

1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777

1778
1779
1780
1781
1782
1783
1784
1716
1717
1718
1719
1720
1721
1722

1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736

1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751

1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764

1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777

1778
1779
1780
1781
1782
1783
1784
1785







-
+













-
+














-
+












-
+












-
+







test frame-15.10 {TIP 262: toplevel background images} -setup {
    deleteWindows
    image create photo gorp -width 10 -height 10
    gorp put black -to 2 2 7 7
} -body {
    toplevel .t -width 100 -height 100 -backgroundimage gorp -tile yes
    update
    list [.t cget -bgimg] [.t cget -tile]
    list [.t cget -backgroundimage] [.t cget -tile]
} -cleanup {
    image delete gorp
    deleteWindows
} -result {gorp 1}
test frame-15.11 {TIP 262: toplevel background images} -setup {
    deleteWindows
    image create photo gorp -width 10 -height 10
    gorp put black -to 2 2 7 7
} -body {
    toplevel .t -width 100 -height 100 -backgroundimage gorp -tile yes
    update
    gorp put red -to 15 15 20 20
    update
    list [.t cget -bgimg] [.t cget -tile]
    list [.t cget -backgroundimage] [.t cget -tile]
} -cleanup {
    image delete gorp
    deleteWindows
} -result {gorp 1}
test frame-15.12 {TIP 262: toplevel background images} -setup {
    deleteWindows
    image create photo gorp -width 10 -height 10
    gorp put black -to 2 2 7 7
    set result {}
} -body {
    toplevel .t -width 100 -height 100 -backgroundimage gorp -tile yes
    update
    image delete gorp
    update
    set result [list [.t cget -bgimg] [.t cget -tile]]
    set result [list [.t cget -backgroundimage] [.t cget -tile]]
    image create photo gorp -width 250 -height 250
    update
    lappend result [.t cget -backgroundimage]
} -cleanup {
    catch {image delete gorp}
    deleteWindows
} -result {gorp 1 gorp}
test frame-15.13 {TIP 262: toplevel background images} -setup {
    deleteWindows
    set result {}
} -constraints testImageType -body {
    image create test gorp -variable result
    toplevel .t -width 100 -height 100 -bgimg gorp
    toplevel .t -width 100 -height 100 -backgroundimage gorp
    wm overrideredirect .t 1;	# Reduce trouble from window managers
    update idletasks; update
    return [uniq $result]
} -cleanup {
    deleteWindows
    catch {image delete gorp}
} -result {{gorp get} {gorp display 0 0 30 15}}
test frame-15.14 {TIP 262: toplevel background images} -setup {
    deleteWindows
    set result {}
} -constraints testImageType -body {
    image create test gorp -variable result
    toplevel .t -width 50 -height 25 -bgimg gorp -tile 1
    toplevel .t -width 50 -height 25 -backgroundimage gorp -tile 1
    wm overrideredirect .t 1;	# Reduce trouble from window managers
    update idletasks; update
    # On MacOS must wait for the test image display procedure to run.
    set timer [after 300 {lappend result "timedout"}]
    while {"timedout" ni $result &&
	   "gorp display 0 0 20 10" ni $result} {
	vwait result
Changes to tests/geometry.test.
18
19
20
21
22
23
24
25
26
27



28
29
30
31
32
33
34
18
19
20
21
22
23
24



25
26
27
28
29
30
31
32
33
34







-
-
-
+
+
+







namespace import -force tcltest::test


wm geometry . 300x300
raise .
update

frame .f -bd 2 -relief raised
frame .f.f -bd 2 -relief sunken
frame .f.f.f -bd 2 -relief raised
frame .f -borderwidth 2 -relief raised
frame .f.f -borderwidth 2 -relief sunken
frame .f.f.f -borderwidth 2 -relief raised
button .b1 -text .b1
button .b2 -text .b2
button .b3 -text .b3
button .f.f.b4 -text .b4

test geometry-1.1 {Tk_ManageGeometry procedure} -setup {
	foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
82
83
84
85
86
87
88
89

90
91
92
93

94
95
96
97
98
99
100
82
83
84
85
86
87
88

89
90
91
92

93
94
95
96
97
98
99
100







-
+



-
+







        place forget $w
    }
} -body {
    place .f -x 20 -y 30 -width 200 -height 200
    place .b1 -in .f -x 50 -y 5
    update
    set x [list [winfo x .b1] [winfo y .b1]]
    .f configure -bd 5
    .f configure -borderwidth 5
    update
    lappend x [winfo x .b1] [winfo y .b1]
} -cleanup {
    .f configure -bd 2
    .f configure -borderwidth 2
} -result {72 37 75 40}


test geometry-4.1 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup {
	foreach w {.f .f.f .f.f.f .b1 .b2 .b3} {
        place forget $w
    }
230
231
232
233
234
235
236
237
238


239
240
241
242
243
244
245
230
231
232
233
234
235
236


237
238
239
240
241
242
243
244
245







-
-
+
+







    place .f.f -x 15 -y 5 -width 150 -height 120
    place .f.f.f -width 100 -height 80
    place .b1 -in .f.f.f -x 50 -y 5
    place .b2 -in .f.f.f -x 10 -y 25
    place .b3 -in .f.f.f -x 50 -y 25
    update
    destroy .f.f
    frame .f.f -bd 2 -relief raised
    frame .f.f.f -bd 2 -relief raised
    frame .f.f -borderwidth 2 -relief raised
    frame .f.f.f -borderwidth 2 -relief raised
    place .f -x 30 -y 25
    update
    list [winfo x .b1] [winfo y .b1] [winfo ismapped .b1] \
        [winfo x .b2] [winfo y .b2] [winfo ismapped .b2] \
        [winfo x .b3] [winfo y .b3] [winfo ismapped .b3]
} -result {91 46 0 51 66 0 91 66 0}
test geometry-4.9 {Tk_MaintainGeometry and Tk_UnmaintainGeometry} -setup {
Changes to tests/grid.test.
106
107
108
109
110
111
112
113
114


115
116
117
118
119
120
121
122
123
124
125
126
127
128
129


130
131
132
133
134
135
136
106
107
108
109
110
111
112


113
114
115
116
117
118
119
120
121
122
123
124
125
126
127


128
129
130
131
132
133
134
135
136







-
-
+
+













-
-
+
+







test grid-2.7 {bbox} -body {
    grid bbox . 0 0 x 0
} -returnCodes error -result {expected integer but got "x"}
test grid-2.8 {bbox} -body {
    grid bbox . 0 0 0 x
} -returnCodes error -result {expected integer but got "x"}
test grid-2.9 {bbox} -body {
    frame .1 -width 75 -height 75 -bg red
    frame .2 -width 90 -height 90 -bg red
    frame .1 -width 75 -height 75 -background red
    frame .2 -width 90 -height 90 -background red
    grid .1 -row 0 -column 0
    grid .2 -row 1 -column 1
    update
    set a ""
    lappend a [grid bbox .]
    lappend a [grid bbox . 0 0]
    lappend a [grid bbox . 0 0 1 1]
    lappend a [grid bbox . 1 1]
    return $a
} -cleanup {
    grid_reset 2.9
} -result {{0 0 165 165} {0 0 75 75} {0 0 165 165} {75 75 90 90}}
test grid-2.10 {bbox} -body {
    frame .1 -width 75 -height 75 -bg red
    frame .2 -width 90 -height 90 -bg red
    frame .1 -width 75 -height 75 -background red
    frame .2 -width 90 -height 90 -background red
    grid .1 -row 0 -column 0
    grid .2 -row 1 -column 1
    update
    set a ""
    lappend a [grid bbox . 10 10 0 0]
    lappend a [grid bbox . -2 -2 -1 -1]
    lappend a [grid bbox . 10 10 12 12]
246
247
248
249
250
251
252
253

254
255

256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271

272
273
274
275
276
277
278
279

280
281
282
283
284
285
286
287

288
289
290
291
292
293
294
246
247
248
249
250
251
252

253
254

255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270

271
272
273
274
275
276
277
278

279
280
281
282
283
284
285
286

287
288
289
290
291
292
293
294







-
+

-
+















-
+







-
+







-
+







    grid forget .c
    grid .c -row 0 -column 0
    grid info .c
} -cleanup {
    grid_reset 4.3.1
} -result {-in . -column 0 -row 0 -columnspan 1 -rowspan 1 -ipadx 0 -ipady 0 -padx 0 -pady 0 -sticky {}}
test grid-4.5 {forget, calling Tk_UnmaintainGeometry} -body {
    frame .f -bd 2 -relief raised
    frame .f -borderwidth 2 -relief raised
    place .f -x 10 -y 20 -width 200 -height 100
    frame .f2 -width 50 -height 30 -bg red
    frame .f2 -width 50 -height 30 -background red
    grid .f2 -in .f
    update
    set x [winfo ismapped .f2]
    grid forget .f2
    place .f -x 30
    update
    lappend x [winfo ismapped .f2]
} -cleanup {
    grid_reset 4.4
} -result {1 0}

test grid-5.1 {info: basic argument checking} -body {
    grid info a b
} -returnCodes error -result {wrong # args: should be "grid info window"}
test grid-5.2 {info} -body {
    frame .1 -width 75 -height 75 -bg red
    frame .1 -width 75 -height 75 -background red
    grid .1 -row 0 -column 0
    update
    grid info .x
} -cleanup {
    grid_reset 5.2
} -returnCodes error -result {bad window path name ".x"}
test grid-5.3 {info} -body {
    frame .1 -width 75 -height 75 -bg red
    frame .1 -width 75 -height 75 -background red
    grid .1 -row 0 -column 0
    update
    grid info .1
} -cleanup {
    grid_reset 5.3
} -result {-in . -column 0 -row 0 -columnspan 1 -rowspan 1 -ipadx 0 -ipady 0 -padx 0 -pady 0 -sticky {}}
test grid-5.4 {info} -body {
    frame .1 -width 75 -height 75 -bg red
    frame .1 -width 75 -height 75 -background red
    update
    grid info .1
} -cleanup {
    grid_reset 5.4
} -returnCodes ok -result {}

test grid-6.1 {location: basic argument checking} -body {
306
307
308
309
310
311
312
313

314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330

331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347

348
349
350
351
352
353
354
306
307
308
309
310
311
312

313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329

330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346

347
348
349
350
351
352
353
354







-
+
















-
+
















-
+







test grid-6.5 {location: basic argument checking} -body {
    frame .f
    grid location .f 10 10
} -cleanup {
    grid_reset 6.5
} -result {-1 -1}
test grid-6.6 {location (x)} -body {
    frame .f -width 200 -height 100 -highlightthickness 0 -bg red
    frame .f -width 200 -height 100 -highlightthickness 0 -background red
    grid .f
    update
    set got ""
    set result ""
    for {set x -10} { $x < 220} { incr x} {
	set a [grid location . $x 0]
	if {$a != $got} {
	    lappend result $x->$a
	    set got $a
	}
    }
    return $result
} -cleanup {
    grid_reset 6.6
} -result {{-10->-1 0} {0->0 0} {201->1 0}}
test grid-6.7 {location (y)} -body {
    frame .f -width 200 -height 100 -highlightthickness 0 -bg red
    frame .f -width 200 -height 100 -highlightthickness 0 -background red
    grid .f
    update
    set got ""
    set result ""
    for {set y -10} { $y < 110} { incr y} {
	set a [grid location . 0 $y]
	if {$a != $got} {
	    lappend result $y->$a
	    set got $a
	}
    }
    return $result
} -cleanup {
    grid_reset 6.7
} -result {{-10->0 -1} {0->0 0} {101->0 1}}
test grid-6.8 {location (weights)} -body {
    frame .f -width 300 -height 100 -highlightthickness 0 -bg red
    frame .f -width 300 -height 100 -highlightthickness 0 -background red
    frame .a
    grid .a
    grid .f -in .a
    grid rowconfigure .f 0 -weight 1
    grid columnconfigure .f 0 -weight 1
    grid propagate .a 0
    .a configure -width 200 -height 15
367
368
369
370
371
372
373
374

375
376
377
378
379
380
381
367
368
369
370
371
372
373

374
375
376
377
378
379
380
381







-
+







    grid_reset 6.8
} -result {{-10->-1 -1} {0->0 0} {16->0 1} {201->1 1}}
test grid-6.9 {location: check updates pending} -constraints {
    nonPortable
} -body {
    set a ""
    foreach i {0 1 2} {
	frame .$i -width 120 -height 75 -bg red
	frame .$i -width 120 -height 75 -background red
	lappend a [grid location . 150 90]
	grid .$i -row $i -column $i
    }
    return $a
} -cleanup {
    grid_reset 6.9
} -result {{0 0} {1 1} {1 1}}
402
403
404
405
406
407
408
409

410
411
412
413
414

415
416
417
418
419
420
421
402
403
404
405
406
407
408

409
410
411
412
413

414
415
416
417
418
419
420
421







-
+




-
+







} -returnCodes error -result {bad window path name ".x"}
test grid-7.5 {propagate} -body {
    grid propagate . x
} -cleanup {
    grid_reset 7.5
} -returnCodes error -result {expected boolean value but got "x"}
test grid-7.6 {propagate} -body {
    frame .f -width 100 -height 100 -bg red
    frame .f -width 100 -height 100 -background red
    grid .f -row 0 -column 0
    update
    set a [winfo width .f]x[winfo height .f]
    grid propagate .f 0
    frame .g -width 75 -height 85 -bg green
    frame .g -width 75 -height 85 -background green
    grid .g -in .f -row 0 -column 0
    update
    lappend a [winfo width .f]x[winfo height .f]
    grid propagate .f 1
    update
    lappend a [winfo width .f]x[winfo height .f]
    return $a
879
880
881
882
883
884
885
886

887
888
889
890
891
892
893
894
895
896
897
898
899
900
901

902
903
904
905
906
907
908

909
910
911
912
913
914
915

916
917
918
919
920
921
922
923

924
925
926
927
928
929
930
879
880
881
882
883
884
885

886
887
888
889
890
891
892
893
894
895
896
897
898
899
900

901
902
903
904
905
906
907

908
909
910
911
912
913
914

915
916
917
918
919
920
921
922

923
924
925
926
927
928
929
930







-
+














-
+






-
+






-
+







-
+







    button .b
    grid .b - x -
} -cleanup {
    grid_reset 11.5
} -returnCodes error -result {must specify window before shortcut '-'}
test grid-11.6 {default widget placement} -body {
    foreach i {1 2 3 4 5 6} {
	frame .f$i -width 50 -height 50 -highlightthickness 0 -bg red
	frame .f$i -width 50 -height 50 -highlightthickness 0 -background red
    }
    grid .f1 .f2 .f3 .f4
    grid .f5   -  x  .f6 -sticky nsew
    update
    set a ""
    foreach i {5 6} {
	lappend a "[winfo x .f$i],[winfo y .f$i] \
		[winfo width .f$i],[winfo height .f$i]"
    }
    return $a
} -cleanup {
    grid_reset 11.6
} -result {{0,50  100,50} {150,50  50,50}}
test grid-11.7 {default widget placement} -body {
    frame .f -width 20 -height 20 -highlightthickness 0 -bg red
    frame .f -width 20 -height 20 -highlightthickness 0 -background red
    grid .f -row 5 -column 5
    grid .f x -
} -cleanup {
    grid_reset 11.7
} -returnCodes error -result {must specify window before shortcut '-'}
test grid-11.8 {default widget placement} -body {
    frame .f -width 20 -height 20 -highlightthickness 0 -bg red
    frame .f -width 20 -height 20 -highlightthickness 0 -background red
    grid .f -row 5 -column 5
    grid .f ^ -
} -cleanup {
    grid_reset 11.8
} -returnCodes error -result {must specify window before shortcut '-'}
test grid-11.9 {default widget placement} -body {
    frame .f -width 20 -height 20 -highlightthickness 0 -bg red
    frame .f -width 20 -height 20 -highlightthickness 0 -background red
    grid .f -row 5 -column 5
    grid .f x ^
} -cleanup {
    grid_reset 11.9
} -returnCodes error -result {can't find content to extend with "^"}
test grid-11.10 {default widget placement} -body {
    foreach i {1 2 3} {
	frame .f$i -width 100 -height 50 -highlightthickness 0 -bg red
	frame .f$i -width 100 -height 50 -highlightthickness 0 -background red
    }
    grid .f1 .f2  -sticky nsew
    grid .f3   ^  -sticky nsew
    update
    set a ""
    foreach i {1 2 3} {
	lappend a "[winfo x .f$i],[winfo y .f$i] \
989
990
991
992
993
994
995
996

997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012

1013
1014
1015
1016
1017
1018
1019
989
990
991
992
993
994
995

996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011

1012
1013
1014
1015
1016
1017
1018
1019







-
+















-
+







    }
    return $a
} -cleanup {
    grid_reset 11.13
} -result {{0,50  120,50} {120,50  80,50}}
test grid-11.14 {default widget placement} -body {
    foreach i {1 2 3} {
	frame .f$i -width 60 -height 60 -highlightthickness 0 -bg red
	frame .f$i -width 60 -height 60 -highlightthickness 0 -background red
    }
    grid .f1 .f2
    grid  ^  .f3
    update
    set a ""
    foreach i {1 2 3} {
	lappend a "[winfo x .f$i],[winfo y .f$i] \
		[winfo width .f$i],[winfo height .f$i]"
    }
    return $a
} -cleanup {
    grid_reset 11.14
} -result {{0,30  60,60} {60,0  60,60} {60,60  60,60}}
test grid-11.15 {^ ^ test with multiple windows} -body {
    foreach i {1 2 3 4} {
	frame .f$i -width 50 -height 50 -bd 1 -relief solid
	frame .f$i -width 50 -height 50 -borderwidth 1 -relief solid
    }
    grid .f1 .f2 .f3 -sticky ns
    grid .f4 ^ ^
    update
    set a ""
    foreach i {1 2 3 4} {
	lappend a "[winfo x .f$i],[winfo y .f$i]\
1084
1085
1086
1087
1088
1089
1090
1091

1092
1093
1094
1095
1096
1097
1098
1084
1085
1086
1087
1088
1089
1090

1091
1092
1093
1094
1095
1096
1097
1098







-
+







    lappend res [winfo height .d]
} -cleanup {
    grid_reset 11.19
} -result {50 100 100 50}

test grid-12.1 {-sticky} -body {
    catch {unset data}
    frame .f -width 200 -height 100 -highlightthickness 0 -bg red
    frame .f -width 200 -height 100 -highlightthickness 0 -background red
    set a ""
    grid .f
    grid rowconfigure . 0 -weight 1
    grid columnconfigure . 0 -weight 1
    grid propagate . 0
    . configure -width 250 -height 150
    foreach i { {} n s e w ns ew nw ne se sw nse nsw sew new nsew} {
1118
1119
1120
1121
1122
1123
1124
1125

1126
1127
1128
1129
1130
1131

1132
1133
1134
1135
1136
1137
1138
1139
1140

1141
1142
1143
1144
1145
1146

1147
1148
1149
1150
1151
1152
1153
1154

1155
1156
1157
1158
1159
1160

1161
1162
1163
1164
1165
1166
1167
1168

1169
1170
1171
1172
1173
1174

1175
1176
1177
1178
1179
1180

1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191

1192
1193
1194
1195
1196
1197

1198
1199
1200
1201
1202
1203

1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214

1215
1216
1217
1218
1219
1220

1221
1222
1223
1224
1225
1226

1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237

1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248

1249
1250
1251
1252
1253
1254

1255
1256
1257
1258
1259
1260

1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271

1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282

1283
1284
1285
1286
1287
1288
1289
1118
1119
1120
1121
1122
1123
1124

1125
1126
1127
1128
1129
1130

1131
1132
1133
1134
1135
1136
1137
1138
1139

1140
1141
1142
1143
1144
1145

1146
1147
1148
1149
1150
1151
1152
1153

1154
1155
1156
1157
1158
1159

1160
1161
1162
1163
1164
1165
1166
1167

1168
1169
1170
1171
1172
1173

1174
1175
1176
1177
1178
1179

1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190

1191
1192
1193
1194
1195
1196

1197
1198
1199
1200
1201
1202

1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213

1214
1215
1216
1217
1218
1219

1220
1221
1222
1223
1224
1225

1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236

1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247

1248
1249
1250
1251
1252
1253

1254
1255
1256
1257
1258
1259

1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270

1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281

1282
1283
1284
1285
1286
1287
1288
1289







-
+





-
+








-
+





-
+







-
+





-
+







-
+





-
+





-
+










-
+





-
+





-
+










-
+





-
+





-
+










-
+










-
+





-
+





-
+










-
+










-
+







(nes) 50 0 200 150
(nsw) 0 0 200 150
(esw) 0 50 250 100
(new) 0 0 250 100
(nesw) 0 0 250 150
}
test grid-12.2 {-sticky} -body {
    frame .f -bg red
    frame .f -background red
    grid .f -sticky glue
} -cleanup {
    grid_reset 12.2
} -returnCodes error -result {bad stickyness value "glue": must be a string containing n, e, s, and/or w}
test grid-12.3 {-sticky} -body {
    frame .f -bg red
    frame .f -background red
    grid .f -sticky {n,s,e,w}
    array set A [grid info .f]
    set A(-sticky)
} -cleanup {
    grid_reset 12.3
} -result {nesw}

test grid-13.1 {-in} -body {
    frame .f -bg red
    frame .f -background red
    grid .f -in .f
} -cleanup {
    grid_reset 13.1
} -returnCodes error -result {window can't be managed in itself}
test grid-13.2 {-in} -body {
    frame .f -bg red
    frame .f -background red
    list [winfo manager .f] \
         [catch {grid .f -in .f} err] $err \
         [winfo manager .f]
} -cleanup {
    grid_reset 13.1.1
} -result {{} 1 {window can't be managed in itself} {}}
test grid-13.3 {-in} -body {
    frame .f -bg red
    frame .f -background red
    grid .f -in .bad
} -cleanup {
    grid_reset 13.2
} -returnCodes error -result {bad window path name ".bad"}
test grid-13.4 {-in} -body {
    frame .f -bg red
    frame .f -background red
    toplevel .top
    grid .f -in .top
} -cleanup {
    grid_reset 13.3
} -returnCodes error -result {can't put ".f" inside ".top"}
destroy .top
test grid-13.5 {-ipadx} -body {
    frame .f -width 20 -height 20 -highlightthickness 0 -bg red
    frame .f -width 20 -height 20 -highlightthickness 0 -background red
    grid .f -ipadx x
} -cleanup {
    grid_reset 13.4
} -returnCodes error -result {bad ipadx value "x": must be positive screen distance}
test grid-13.6 {-ipadx} -body {
    frame .f -width 20 -height 20 -highlightthickness 0 -bg red
    frame .f -width 20 -height 20 -highlightthickness 0 -background red
    grid .f -ipadx {5 5}
} -cleanup {
    grid_reset 13.4.1
} -returnCodes error -result {bad ipadx value "5 5": must be positive screen distance}
test grid-13.7 {-ipadx} -body {
    frame .f -width 200 -height 100 -highlightthickness 0 -bg red
    frame .f -width 200 -height 100 -highlightthickness 0 -background red
    grid .f
    update
    set a [winfo width .f]
    grid .f -ipadx 1
    update
    list $a [winfo width .f]
} -cleanup {
    grid_reset 13.5
} -result {200 202}
test grid-13.8 {-ipady} -body {
    frame .f -width 20 -height 20 -highlightthickness 0 -bg red
    frame .f -width 20 -height 20 -highlightthickness 0 -background red
    grid .f -ipady x
} -cleanup {
    grid_reset 13.6
} -returnCodes error -result {bad ipady value "x": must be positive screen distance}
test grid-13.9 {-ipady} -body {
    frame .f -width 20 -height 20 -highlightthickness 0 -bg red
    frame .f -width 20 -height 20 -highlightthickness 0 -background red
    grid .f -ipady {5 5}
} -cleanup {
    grid_reset 13.6.1
} -returnCodes error -result {bad ipady value "5 5": must be positive screen distance}
test grid-13.10 {-ipady} -body {
    frame .f -width 200 -height 100 -highlightthickness 0 -bg red
    frame .f -width 200 -height 100 -highlightthickness 0 -background red
    grid .f
    update
    set a [winfo height .f]
    grid .f -ipady 1
    update
    list $a [winfo height .f]
} -cleanup {
    grid_reset 13.7
} -result {100 102}
test grid-13.11 {-padx} -body {
    frame .f -width 20 -height 20 -highlightthickness 0 -bg red
    frame .f -width 20 -height 20 -highlightthickness 0 -background red
    grid .f -padx x
} -cleanup {
    grid_reset 13.8
} -returnCodes error -result {bad pad value "x": must be positive screen distance}
test grid-13.12 {-padx} -body {
    frame .f -width 20 -height 20 -highlightthickness 0 -bg red
    frame .f -width 20 -height 20 -highlightthickness 0 -background red
    grid .f -padx {10 x}
} -cleanup {
    grid_reset 13.8.1
} -returnCodes error -result {bad 2nd pad value "x": must be positive screen distance}
test grid-13.13 {-padx} -body {
    frame .f -width 200 -height 100 -highlightthickness 0 -bg red
    frame .f -width 200 -height 100 -highlightthickness 0 -background red
    grid .f
    update
    set a "[winfo width .f] [winfo width .]"
    grid .f -padx 1
    update
    list $a "[winfo width .f] [winfo width .] [winfo x .f]"
} -cleanup {
    grid_reset 13.9
} -result {{200 200} {200 202 1}}
test grid-13.14 {-padx} -body {
    frame .f -width 200 -height 100 -highlightthickness 0 -bg red
    frame .f -width 200 -height 100 -highlightthickness 0 -background red
    grid .f
    update
    set a "[winfo width .f] [winfo width .]"
    grid .f -padx {10 5}
    update
    list $a "[winfo width .f] [winfo width .] [winfo x .f]"
} -cleanup {
    grid_reset 13.9.1
} -result {{200 200} {200 215 10}}
test grid-13.15 {-pady} -body {
    frame .f -width 20 -height 20 -highlightthickness 0 -bg red
    frame .f -width 20 -height 20 -highlightthickness 0 -background red
    grid .f -pady x
} -cleanup {
    grid_reset 13.10
} -returnCodes error -result {bad pad value "x": must be positive screen distance}
test grid-13.16 {-pady} -body {
    frame .f -width 20 -height 20 -highlightthickness 0 -bg red
    frame .f -width 20 -height 20 -highlightthickness 0 -background red
    grid .f -pady {10 x}
} -cleanup {
    grid_reset 13.10.1
} -returnCodes error -result {bad 2nd pad value "x": must be positive screen distance}
test grid-13.17 {-pady} -body {
    frame .f -width 200 -height 100 -highlightthickness 0 -bg red
    frame .f -width 200 -height 100 -highlightthickness 0 -background red
    grid .f
    update
    set a "[winfo height .f] [winfo height .]"
    grid .f -pady 1
    update
    list $a "[winfo height .f] [winfo height .] [winfo y .f]"
} -cleanup {
    grid_reset 13.11
} -result {{100 100} {100 102 1}}
test grid-13.18 {-pady} -body {
    frame .f -width 200 -height 100 -highlightthickness 0 -bg red
    frame .f -width 200 -height 100 -highlightthickness 0 -background red
    grid .f
    update
    set a "[winfo height .f] [winfo height .]"
    grid .f -pady {4 16}
    update
    list $a "[winfo height .f] [winfo height .] [winfo y .f]"
} -cleanup {
    grid_reset 13.11.1
} -result {{100 100} {100 120 4}}
test grid-13.19 {-ipad x and y} -body {
    frame .f -width 20 -height 20 -highlightthickness 0 -bg red
    frame .f -width 20 -height 20 -highlightthickness 0 -background red
    grid columnconfigure . 0 -minsize 150
    grid rowconfigure . 0 -minsize 100
    set a ""
    foreach x {0 5} {
	foreach y {0 5} {
	    grid .f -ipadx $x -ipady $y
	    update
1312
1313
1314
1315
1316
1317
1318
1319
1320


1321
1322
1323
1324
1325
1326
1327

1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343

1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364

1365
1366
1367
1368
1369
1370
1371
1312
1313
1314
1315
1316
1317
1318


1319
1320
1321
1322
1323
1324
1325
1326

1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342

1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363

1364
1365
1366
1367
1368
1369
1370
1371







-
-
+
+






-
+















-
+




















-
+







    unset info
    return $a
} -cleanup {
    grid_reset 13.13
} -result {.b,,.1 ,.b,.2}

test grid-14.1 {structure notify} -body {
    frame .f -width 200 -height 100 -highlightthickness 0 -bg red
    frame .g -width 200 -height 100 -highlightthickness 0 -bg red
    frame .f -width 200 -height 100 -highlightthickness 0 -background red
    frame .g -width 200 -height 100 -highlightthickness 0 -background red
    grid .f
    grid .g -in .f
    update
    set a ""
    lappend a "[winfo x .g],[winfo y .g] \
        [winfo width .g],[winfo height .g]"
    .f configure -bd 5 -relief raised
    .f configure -borderwidth 5 -relief raised
    update
    lappend a "[winfo x .g],[winfo y .g] \
        [winfo width .g],[winfo height .g]"
    return $a
} -cleanup {
    grid_reset 14.1
} -result {{0,0  200,100} {5,5  200,100}}
test grid-14.2 {structure notify} -body {
    frame .f -width 200 -height 100
    frame .f.g -width 200 -height 100
    grid .f
    grid .f.g
    update
    set a ""
    lappend a [grid bbox .],[grid bbox .f]
    .f config -bd 20
    .f config -borderwidth 20
    update
    lappend a [grid bbox .],[grid bbox .f]
} -cleanup {
    grid_reset 14.2
} -result {{0 0 200 100,0 0 200 100} {0 0 240 140,20 20 200 100}}
test grid-14.3 {map notify: bug 1648} -constraints {nonPortable} -body {
    # This test is nonPortable because the number of times
    # A(.) will be incremented is unspecified--the behavior
    # is different accross window managers.
    global A
    catch {unset A}
    bind . <Configure> {incr A(%W)}
    set A(.) 0
    foreach i {0 1 2} {
	frame .$i -width 100 -height 75
	set A(.$i) 0
    }
    grid .0 .1 .2
    update
    bind <Configure> .1 {destroy .0}
    .2 configure -bd 10
    .2 configure -borderwidth 10
    update
    bind . <Configure> {}
    array get A
} -cleanup {
    grid_reset 14.3
} -result {.2 2 .0 1 . 2 .1 1}

1392
1393
1394
1395
1396
1397
1398
1399

1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412

1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430

1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448

1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466

1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484

1485
1486
1487
1488
1489
1490
1491
1392
1393
1394
1395
1396
1397
1398

1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411

1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429

1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447

1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465

1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483

1484
1485
1486
1487
1488
1489
1490
1491







-
+












-
+

















-
+

















-
+

















-
+

















-
+







    lappend a [grid content .f]
} -cleanup {
    grid_reset 15.2
} -result {.b {} .b}

test grid-16.1 {layout centering} -body {
    foreach i {0 1 2} {
	frame .$i -bg gray  -width 75 -height 50 -bd 2 -relief ridge
	frame .$i -background gray  -width 75 -height 50 -borderwidth 2 -relief ridge
	grid .$i -row $i -column $i -sticky nswe
    }
    grid propagate . 0
    grid anchor . center
    . configure -width 300 -height 250
    update
    grid bbox .
} -cleanup {
    grid_reset 16.1
} -result {37 50 225 150}
test grid-16.2 {layout weights (expanding)} -body {
    foreach i {0 1 2} {
	frame .$i -bg gray  -width 75 -height 50 -bd 2 -relief ridge
	frame .$i -background gray  -width 75 -height 50 -borderwidth 2 -relief ridge
	grid .$i -row $i -column $i -sticky nswe
	grid rowconfigure . $i -weight [expr $i + 1]
	grid columnconfigure . $i -weight [expr $i + 1]
    }
    grid propagate . 0
    . configure -width 500 -height 300
    set a ""
    update
    foreach i {0 1 2} {
	lappend a [winfo width .$i]-[winfo height .$i]
    }
    return $a
} -cleanup {
    grid_reset 16.2
} -result {120-75 167-100 213-125}
test grid-16.3 {layout weights (shrinking)} -body {
    foreach i {0 1 2} {
	frame .$i -bg gray -width 100 -height 75 -bd 2 -relief ridge
	frame .$i -background gray -width 100 -height 75 -borderwidth 2 -relief ridge
	grid .$i -row $i -column $i -sticky nswe
	grid rowconfigure . $i -weight [expr $i + 1]
	grid columnconfigure . $i -weight [expr $i + 1]
    }
    grid propagate . 0
    . configure -width 200 -height 150
    set a ""
    update
    foreach i {0 1 2} {
	lappend a [winfo width .$i]-[winfo height .$i]
    }
    return $a
} -cleanup {
    grid_reset 16.3
} -result {84-63 66-50 50-37}
test grid-16.4 {layout weights (shrinking with minsize)} -body {
    foreach i {0 1 2} {
	frame .$i -bg gray  -width 100 -height 75 -bd 2 -relief ridge
	frame .$i -background gray  -width 100 -height 75 -borderwidth 2 -relief ridge
	grid .$i -row $i -column $i -sticky nswe
	grid rowconfigure . $i -weight [expr $i + 1] -minsize 45
	grid columnconfigure . $i -weight [expr $i + 1] -minsize 65
    }
    grid propagate . 0
    . configure -width 200 -height 150
    set a ""
    update
    foreach i {0 1 2} {
	lappend a [winfo width .$i]-[winfo height .$i]
    }
    return $a
} -cleanup {
    grid_reset 16.4
} -result {70-60 65-45 65-45}
test grid-16.5 {layout weights (shrinking at minsize)} -body {
    foreach i {0 1 2} {
	frame .$i -bg gray  -width 100 -height 75 -bd 2 -relief ridge
	frame .$i -background gray  -width 100 -height 75 -borderwidth 2 -relief ridge
	grid .$i -row $i -column $i -sticky nswe
	grid rowconfigure . $i -weight 0 -minsize 70
	grid columnconfigure . $i -weight 0 -minsize 90
    }
    grid propagate . 0
    . configure -width 100 -height 75
    set a ""
    update
    foreach i {0 1 2} {
	lappend a [winfo width .$i]-[winfo height .$i]
    }
    return $a
} -cleanup {
    grid_reset 16.5
} -result {100-75 100-75 100-75}
test grid-16.6 {layout weights (shrinking at minsize)} -body {
    foreach i {0 1 2} {
	frame .$i -bg gray  -width 100 -height 75 -bd 2 -relief ridge
	frame .$i -background gray  -width 100 -height 75 -borderwidth 2 -relief ridge
	grid .$i -row $i -column $i -sticky nswe
	grid rowconfigure . $i -weight [expr $i + 1] -minsize 52
	grid columnconfigure . $i -weight [expr $i + 1] -minsize 69
    }
    grid propagate . 0
    . configure -width 200 -height 150
    set a ""
1501
1502
1503
1504
1505
1506
1507
1508

1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526

1527
1528
1529
1530


1531
1532
1533
1534
1535
1536
1537
1501
1502
1503
1504
1505
1506
1507

1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525

1526
1527
1528


1529
1530
1531
1532
1533
1534
1535
1536
1537







-
+

















-
+


-
-
+
+







# reason (I think): -minsize 0 causes both:
# [winfo ismapped .$i] => 0 and
# not responding for width ang height settings, so that
# [winfo width .$i] [winfo height .$i] take different values
# That doesn't happen if previous tests run
test grid-16.7 {layout weights (shrinking at minsize)} -body {
    foreach i {0 1 2} {
	frame .$i -bg gray  -width 100 -height 75 -bd 2 -relief ridge
	frame .$i -background gray  -width 100 -height 75 -borderwidth 2 -relief ridge
	grid .$i -row $i -column $i -sticky nswe
    }
    grid propagate . 0
    grid columnconfigure . 1 -weight 1 -minsize 0
    grid rowconfigure . 1 -weight 1 -minsize 0
    . configure -width 100 -height 1
    set a ""
    update
    foreach i {0 1 2} {
	lappend a [winfo width .$i]-[winfo height .$i]-[winfo ismapped .$i]
    }
    return $a
} -cleanup {
    grid_reset 16.7
} -result {100-75-1 1-1-0 100-75-1}
test grid-16.8 {layout internal constraints} -body {
    foreach i {0 1 2 3 4} {
	frame .$i -bg gray  -width 30 -height 25 -bd 2 -relief ridge
	frame .$i -background gray  -width 30 -height 25 -borderwidth 2 -relief ridge
	grid .$i -row $i -column $i -sticky nswe
    }
    frame .f -bg red -width 250 -height 200
    frame .g -bg green -width 200 -height 180
    frame .f -background red -width 250 -height 200
    frame .g -background green -width 200 -height 180
    lower .f
    raise .g .f
    grid .f -row 1 -column 1 -rowspan 3 -columnspan 3 -sticky nswe
    grid .g -row 1 -column 1 -rowspan 2 -columnspan 2 -sticky nswe
    update
    set a ""
    foreach i {0 1 2 3 4} {
1733
1734
1735
1736
1737
1738
1739
1740

1741
1742
1743
1744
1745
1746
1747
1733
1734
1735
1736
1737
1738
1739

1740
1741
1742
1743
1744
1745
1746
1747







-
+







    return $res
} -cleanup {
    grid_reset 16.16
} -result [list [list 30 34 43 43 0] [list 30 34 48 38 0] [list 22 42 48 38 0] \
           [list 25 39 29 57 0] [list 30 34 22 64 0]]
test grid-16.17 {layout weights (shrinking at minsize)} -body {
    foreach i {0 1 2 3} {
	frame .$i -bg gray  -width 100 -height 75 -bd 2 -relief ridge
	frame .$i -background gray  -width 100 -height 75 -borderwidth 2 -relief ridge
	grid .$i -row $i -column $i -sticky nswe
    }
    grid propagate . 0
    grid columnconfigure . {0 1} -weight 1 -minsize 0
    grid rowconfigure . {0 1} -weight 1 -minsize 0
    set a ""
    . configure -width 250 -height 200
1918
1919
1920
1921
1922
1923
1924
1925

1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946

1947
1948
1949
1950
1951

1952
1953
1954
1955
1956
1957
1958
1918
1919
1920
1921
1922
1923
1924

1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945

1946
1947
1948
1949
1950

1951
1952
1953
1954
1955
1956
1957
1958







-
+




















-
+




-
+







test grid-21.5 {anchor} -body {
    grid anchor . x
} -cleanup {
    grid_reset 21.5
} -returnCodes error -result {bad anchor "x": must be n, ne, e, se, s, sw, w, nw, or center}
test grid-21.6 {anchor} -body {
    foreach i {0 1 2} {
	frame .$i -bg gray  -width 75 -height 50 -bd 2 -relief ridge
	frame .$i -background gray  -width 75 -height 50 -borderwidth 2 -relief ridge
	grid .$i -row $i -column $i -sticky nswe
    }
    grid propagate . 0
    . configure -width 300 -height 250
    set res {}
    foreach a {n ne e se s sw w nw center} {
        grid anchor . $a
        update
        lappend res [grid bbox .]
    }
    return $res
} -cleanup {
    grid_reset 21.6
} -result [list {37 0 225 150} {75 0 225 150} {75 50 225 150} {75 100 225 150} \
           {37 100 225 150} {0 100 225 150} {0 50 225 150} {0 0 225 150} \
           {37 50 225 150}]
test grid-21.7 {anchor} -body {
    # Test with a non-symmetric internal border.
    # This only tests vertically, there is currently no way to get
    # it assymetric horizontally.
    labelframe .f -bd 0
    labelframe .f -borderwidth 0
    frame .f.x -width 20 -height 20
    .f configure -labelwidget .f.x
    pack .f -fill both -expand 1
    foreach i {0 1 2} {
	frame .$i -bg gray  -width 75 -height 50 -bd 2 -relief ridge
	frame .$i -background gray  -width 75 -height 50 -borderwidth 2 -relief ridge
	grid .$i -in .f -row $i -column $i -sticky nswe
    }
    pack propagate . 0
    grid propagate .f 0
    . configure -width 300 -height 250
    set res {}
    foreach a {n ne e se s sw w nw center} {
1994
1995
1996
1997
1998
1999
2000
2001

2002
2003

2004
2005
2006
2007
2008
2009
2010
1994
1995
1996
1997
1998
1999
2000

2001
2002

2003
2004
2005
2006
2007
2008
2009
2010







-
+

-
+







    grid .c -in .a -row 2 -column 2 -rowspan 2 -columnspan 2 -padx {3 5} -pady {4 7} -sticky ns
    grid remove .c
    grid .c -row 0 -column 0
    grid info .c
} {-in .a -column 0 -row 0 -columnspan 2 -rowspan 2 -ipadx 0 -ipady 0 -padx {3 5} -pady {4 7} -sticky ns}
grid_reset 22.3.1
test grid-22.4 {remove, calling Tk_UnmaintainGeometry} {
    frame .f -bd 2 -relief raised
    frame .f -borderwidth 2 -relief raised
    place .f -x 10 -y 20 -width 200 -height 100
    frame .f2 -width 50 -height 30 -bg red
    frame .f2 -width 50 -height 30 -background red
    grid .f2 -in .f
    update
    set x [winfo ismapped .f2]
    grid remove .f2
    place .f -x 30
    update
    lappend x [winfo ismapped .f2]
Changes to tests/imgBmap.test.
9
10
11
12
13
14
15


16
17
18
19
20
21
22
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24







+
+








package require tcltest 2.2
namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
imageInit

testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}]

set data1 {#define foo_width 16
#define foo_height 16
#define foo_x_hot 3
#define foo_y_hot 3
static unsigned char foo_bits[] = {
   0xff, 0xff, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
   0x81, 0x81, 0xff, 0xff, 0xff, 0xff, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
77
78
79
80
81
82
83
84
85


86
87
88
89
90
91
92
93
94
95

96
97
98
99
100
101
102
79
80
81
82
83
84
85


86
87
88
89
90
91
92
93
94
95
96

97
98
99
100
101
102
103
104







-
-
+
+









-
+







    image create bitmap i1 -file foo.bm
    lindex [i1 configure -file] 4
} -result foo.bm
test imageBmap-1.6 {options for bitmap images} -body {
    list [catch {image create bitmap i1 -file bogus} msg] [string tolower $msg]
} -result {1 {couldn't read bitmap file "bogus": no such file or directory}}
test imageBmap-1.7 {options for bitmap images} -body {
    image create bitmap i1 -foreground #00ff00
    lindex [i1 configure -foreground] 4
    image create bitmap i1 -color #00ff00
    lindex [i1 configure -color] 4
} -cleanup {
	image delete i1
} -result {#00ff00}
test imageBmap-1.8 {options for bitmap images} -setup {
    destroy .c
    pack [canvas .c]
    update
} -body {
    set errMsg {}
    image create bitmap i1 -foreground bad_color
    image create bitmap i1 -color bad_color
    .c create image 200 100 -image i1
    update
    list $errMsg $errorInfo
} -cleanup {
    destroy .c
	image delete i1
} -result {{unknown color name "bad_color"} {unknown color name "bad_color"
126
127
128
129
130
131
132
133

134
135
136
137
138
139
140
128
129
130
131
132
133
134

135
136
137
138
139
140
141
142







-
+







} -result {1 {unknown option "-gorp"} {}}
test imageBmap-2.2 {ImgBmapCreate procedure} -setup {
    imageCleanup
} -body {
    image create bitmap image1
    list [info commands image1] [imageNames] \
	    [image width image1] [image height image1] \
	    [lindex [image1 configure -foreground] 4] \
	    [lindex [image1 configure -color] 4] \
	    [lindex [image1 configure -background] 4]
} -cleanup {
    image delete image1
} -result {image1 image1 0 0 #000000 {}}


test imageBmap-3.1 {ImgBmapConfigureModel procedure, memory de-allocation} -body {
206
207
208
209
210
211
212
213

214
215
216
217
218
219
220
208
209
210
211
212
213
214

215
216
217
218
219
220
221
222







-
+







    pack [canvas .c]
    update
} -body {
    proc bgerror args {}
    image create bitmap i1 -file foo.bm
    .c create image 100 100 -image i1
    update
    i1 configure -foreground bogus
    i1 configure -color bogus
    update
} -cleanup {
	image delete i1
    destroy .c
} -result {}


354
355
356
357
358
359
360
361
362


363
364
365
366
367

368
369

370
371
372
373



374
375
376
377
378

379
380
381
382
383
384
385
356
357
358
359
360
361
362


363
364
365
366
367
368

369
370

371
372



373
374
375
376
377
378
379

380
381
382
383
384
385
386
387







-
-
+
+




-
+

-
+

-
-
-
+
+
+




-
+







test imageBmap-7.2 {ImgBmapCmd procedure, "cget" option} -body {
    i1 cget
} -returnCodes error -result {wrong # args: should be "i1 cget option"}
test imageBmap-7.3 {ImgBmapCmd procedure, "cget" option} -body {
    i1 cget a b
} -returnCodes error -result {wrong # args: should be "i1 cget option"}
test imageBmap-7.4 {ImgBmapCmd procedure, "cget" option} -body {
    i1 co -foreground #123456
    i1 cget -foreground
    i1 co -color #123456
    i1 cget -color
} -result {#123456}
test imageBmap-7.5 {ImgBmapCmd procedure, "cget" option} -body {
    i1 cget -stupid
} -returnCodes error -result {unknown option "-stupid"}
test imageBmap-7.6 {ImgBmapCmd procedure} -body {
test imageBmap-7.6 {ImgBmapCmd procedure} -constraints nodeprecated -body {
    llength [i1 configure]
} -result 6
} -result 7
test imageBmap-7.7 {ImgBmapCmd procedure} -body {
    i1 co -foreground #001122
    i1 configure -foreground
} -result {-foreground {} {} #000000 #001122}
    i1 co -color #001122
    i1 configure -color
} -result {-color color Color #000000 #001122}
test imageBmap-7.8 {ImgBmapCmd procedure} -body {
    i1 configure -gorp
} -returnCodes error -result {unknown option "-gorp"}
test imageBmap-7.9 {ImgBmapCmd procedure} -body {
    i1 configure -foreground #221100 -background
    i1 configure -color #221100 -background
} -returnCodes error -result {value for "-background" missing}
test imageBmap-7.10 {ImgBmapCmd procedure} -body {
    i1 gorp
} -returnCodes error -result {bad option "gorp": must be cget or configure}
# Clean it up after use!!
imageCleanup

429
430
431
432
433
434
435
436

437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453

454
455
456
457
458
459
460
461
462
463
464
465
466
467
468

469
470
471
472
473
474
475
431
432
433
434
435
436
437

438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454

455
456
457
458
459
460
461
462
463
464
465
466
467
468
469

470
471
472
473
474
475
476
477







-
+
















-
+














-
+







    update
} -body {
    proc bgerror args {}
    imageCleanup
    .c delete all
    image create bitmap i1 -data $data1
    .c create image 50 100 -image i1 -tags i1.1
    i1 configure -foreground bogus
    i1 configure -color bogus
    update
} -cleanup {
    image delete i1
    destroy .c
} -result {}
if {[info exists bgerror]} {
    rename bgerror {}
}


test imageBmap-10.1 {ImgBmapFree procedure, resource freeing} -setup {
    destroy .c
    pack [canvas .c]
    update
} -body {
    imageCleanup
    image create bitmap i1 -data $data1 -maskdata $data2 -foreground #112233 \
    image create bitmap i1 -data $data1 -maskdata $data2 -color #112233 \
	    -background #445566
    .c create image 100 100 -image i1
    update
    .c delete all
    image delete i1
} -cleanup {
    destroy .c
} -result {}
test imageBmap-10.2 {ImgBmapFree procedures, unlinking} -setup {
    destroy .c
    pack [canvas .c]
    update
} -body {
    imageCleanup
    image create bitmap i1 -data $data1 -maskdata $data2 -foreground #112233 \
    image create bitmap i1 -data $data1 -maskdata $data2 -color #112233 \
	    -background #445566
    .c create image 100 100 -image i1
    button .b1 -image i1
    button .b2 -image i1
    button .b3 -image i1
    pack .b1 .b2 .b3
    update
Changes to tests/listbox.test.
1
2
3
4
5
6
7
8
9
10
11
12
13


14
15
16
17
18
19
20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22













+
+







# This file is a Tcl script to test out the "listbox" command
# of Tk.  It is organized in the standard fashion for Tcl tests.
#
# Copyright © 1993-1994 The Regents of the University of California.
# Copyright © 1994-1997 Sun Microsystems, Inc.
# Copyright © 1998-1999 by Scriptics Corporation.
# All rights reserved.

package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
namespace import -force tcltest::test

testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}]

set fixed {Courier -12}

proc record {name args} {
    global log
    lappend log [format {%s %.6g %.6g} $name {*}$args]
}

81
82
83
84
85
86
87
88
89


90
91

92
93
94

95
96
97
98


99
100

101
102
103

104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125


126
127

128
129
130

131
132
133
134
135
136
137
138
139
140
141
142
143


144
145

146
147
148

149
150
151
152
153
154
155
156
157
158


159
160

161
162
163

164
165
166
167
168
169
170
83
84
85
86
87
88
89


90
91
92

93
94
95

96
97
98


99
100
101

102
103
104

105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125


126
127
128

129
130
131

132
133
134
135
136
137
138
139
140
141
142
143


144
145
146

147
148
149

150
151
152
153
154
155
156
157
158


159
160
161

162
163
164

165
166
167
168
169
170
171
172







-
-
+
+

-
+


-
+


-
-
+
+

-
+


-
+




















-
-
+
+

-
+


-
+











-
-
+
+

-
+


-
+








-
-
+
+

-
+


-
+







} -cleanup {
    .l configure -background [lindex [.l configure -background] 3]
} -result {{#ff0000} #ff0000}
test listbox-1.4 {configuration options} -body {
    .l configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test listbox-1.5 {configuration options} -body {
    .l configure -bd 4
    list [lindex [.l configure -bd] 4] [.l cget -bd]
    .l configure -borderwidth 4
    list [lindex [.l configure -borderwidth] 4] [.l cget -borderwidth]
} -cleanup {
    .l configure -bd [lindex [.l configure -bd] 3]
    .l configure -borderwidth [lindex [.l configure -borderwidth] 3]
} -result {4 4}
test listbox-1.6 {configuration options} -body {
    .l configure -bd badValue
    .l configure -borderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}
test listbox-1.7 {configuration options} -body {
    .l configure -bg #ff0000
    list [lindex [.l configure -bg] 4] [.l cget -bg]
    .l configure -background #ff0000
    list [lindex [.l configure -background] 4] [.l cget -background]
} -cleanup {
    .l configure -bg [lindex [.l configure -bg] 3]
    .l configure -background [lindex [.l configure -background] 3]
} -result {{#ff0000} #ff0000}
test listbox-1.8 {configuration options} -body {
    .l configure -bg non-existent
    .l configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test listbox-1.9 {configuration options} -body {
    .l configure -borderwidth 1.3
    list [lindex [.l configure -borderwidth] 4] [.l cget -borderwidth]
} -cleanup {
    .l configure -borderwidth [lindex [.l configure -borderwidth] 3]
} -result {1 1}
test listbox-1.10 {configuration options} -body {
    .l configure -borderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}
test listbox-1.11 {configuration options} -body {
    .l configure -cursor arrow
    list [lindex [.l configure -cursor] 4] [.l cget -cursor]
} -cleanup {
    .l configure -cursor [lindex [.l configure -cursor] 3]
} -result {arrow arrow}
test listbox-1.12 {configuration options} -body {
    .l configure -cursor badValue
} -returnCodes error -result {bad cursor spec "badValue"}
test listbox-1.13 {configuration options} -body {
    .l configure -disabledforeground #110022
    list [lindex [.l configure -disabledforeground] 4] [.l cget -disabledforeground]
    .l configure -disabledcolor #110022
    list [lindex [.l configure -disabledcolor] 4] [.l cget -disabledcolor]
} -cleanup {
    .l configure -disabledforeground [lindex [.l configure -disabledforeground] 3]
    .l configure -disabledcolor [lindex [.l configure -disabledcolor] 3]
} -result {{#110022} #110022}
test listbox-1.14 {configuration options} -body {
    .l configure -disabledforeground bogus
    .l configure -disabledcolor bogus
} -returnCodes error -result {unknown color name "bogus"}
test listbox-1.15 {configuration options} -body {
    .l configure -exportselection yes
    list [lindex [.l configure -exportselection] 4] [.l cget -exportselection]
} -cleanup {
    .l configure -exportselection [lindex [.l configure -exportselection] 3]
} -result {1 1}
test listbox-1.16 {configuration options} -body {
    .l configure -exportselection xyzzy
} -returnCodes error -result {expected boolean value but got "xyzzy"}
test listbox-1.17 {configuration options} -body {
    .l configure -fg #110022
    list [lindex [.l configure -fg] 4] [.l cget -fg]
    .l configure -color #110022
    list [lindex [.l configure -color] 4] [.l cget -color]
} -cleanup {
    .l configure -fg [lindex [.l configure -fg] 3]
    .l configure -color [lindex [.l configure -color] 3]
} -result {{#110022} #110022}
test listbox-1.18 {configuration options} -body {
    .l configure -fg bogus
    .l configure -color bogus
} -returnCodes error -result {unknown color name "bogus"}
test listbox-1.19 {configuration options} -body {
    .l configure -font {Helvetica 12}
    list [lindex [.l configure -font] 4] [.l cget -font]
} -cleanup {
    .l configure -font [lindex [.l configure -font] 3]
} -result {{Helvetica 12} {Helvetica 12}}
test listbox-1.21 {configuration options} -body {
    .l configure -foreground #110022
    list [lindex [.l configure -foreground] 4] [.l cget -foreground]
    .l configure -color #110022
    list [lindex [.l configure -color] 4] [.l cget -color]
} -cleanup {
    .l configure -foreground [lindex [.l configure -foreground] 3]
    .l configure -color [lindex [.l configure -color] 3]
} -result {{#110022} #110022}
test listbox-1.22 {configuration options} -body {
    .l configure -foreground bogus
    .l configure -color bogus
} -returnCodes error -result {unknown color name "bogus"}
test listbox-1.23 {configuration options} -body {
    .l configure -height 30
    list [lindex [.l configure -height] 4] [.l cget -height]
} -cleanup {
    .l configure -height [lindex [.l configure -height] 3]
} -result {30 30}
243
244
245
246
247
248
249
250
251


252
253

254
255
256

257
258
259
260
261
262
263
245
246
247
248
249
250
251


252
253
254

255
256
257

258
259
260
261
262
263
264
265







-
-
+
+

-
+


-
+







} -cleanup {
    .l configure -selectborderwidth [lindex [.l configure -selectborderwidth] 3]
} -result {1 1}
test listbox-1.38 {configuration options} -body {
    .l configure -selectborderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}
test listbox-1.39 {configuration options} -body {
    .l configure -selectforeground #654321
    list [lindex [.l configure -selectforeground] 4] [.l cget -selectforeground]
    .l configure -selectcolor #654321
    list [lindex [.l configure -selectcolor] 4] [.l cget -selectcolor]
} -cleanup {
    .l configure -selectforeground [lindex [.l configure -selectforeground] 3]
    .l configure -selectcolor [lindex [.l configure -selectcolor] 3]
} -result {{#654321} #654321}
test listbox-1.40 {configuration options} -body {
    .l configure -selectforeground bogus
    .l configure -selectcolor bogus
} -returnCodes error -result {unknown color name "bogus"}
test listbox-1.41 {configuration options} -body {
    .l configure -selectmode string
    list [lindex [.l configure -selectmode] 4] [.l cget -selectmode]
} -cleanup {
    .l configure -selectmode [lindex [.l configure -selectmode] 3]
} -result {string string}
348
349
350
351
352
353
354
355

356
357
358
359
360
361
362
350
351
352
353
354
355
356

357
358
359
360
361
362
363
364







-
+







} -cleanup {
    destroy .l
} -result {.l}


# Listbox used in 3.1 -3.115 tests
destroy .l
listbox .l -width 20 -height 5 -bd 4 -highlightthickness 1 -selectborderwidth 2
listbox .l -width 20 -height 5 -borderwidth 4 -highlightthickness 1 -selectborderwidth 2
pack .l
.l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11 el12 el13 el14 \
	el15 el16 el17
update
test listbox-3.1 {ListboxWidgetCmd procedure} -body {
    .l
} -returnCodes error -result {wrong # args: should be ".l option ?arg ...?"}
517
518
519
520
521
522
523
524

525
526

527
528
529
530
531
532
533
534
535
536
537

538
539
540
541



542
543
544
545
546
547
548
519
520
521
522
523
524
525

526
527

528
529
530
531
532
533
534
535
536
537
538

539
540



541
542
543
544
545
546
547
548
549
550







-
+

-
+










-
+

-
-
-
+
+
+







} -returnCodes error -result {wrong # args: should be ".l cget option"}
test listbox-3.21 {ListboxWidgetCmd procedure, "cget" option} -body {
    .l cget -gorp
} -returnCodes error -result {unknown option "-gorp"}
test listbox-3.22 {ListboxWidgetCmd procedure, "cget" option} -body {
    .l cget -setgrid
} -result 0
test listbox-3.23 {ListboxWidgetCmd procedure, "configure" option} -body {
test listbox-3.23 {ListboxWidgetCmd procedure, "configure" option} -constraints nodeprecated -body {
    llength [.l configure]
} -result 28
} -result 31
test listbox-3.24 {ListboxWidgetCmd procedure, "configure" option} -body {
    .l configure -gorp
} -returnCodes error -result {unknown option "-gorp"}
test listbox-3.25 {ListboxWidgetCmd procedure, "configure" option} -body {
    .l configure -setgrid
} -result {-setgrid setGrid SetGrid 0 0}
test listbox-3.26 {ListboxWidgetCmd procedure, "configure" option} -body {
    .l configure -gorp is_messy
} -returnCodes error -result {unknown option "-gorp"}
test listbox-3.27 {ListboxWidgetCmd procedure, "configure" option} -body {
    set oldbd [.l cget -bd]
    set oldbd [.l cget -borderwidth]
    set oldht [.l cget -highlightthickness]
    .l configure -bd 3 -highlightthickness 0
    set x "[.l cget -bd] [.l cget -highlightthickness]"
    .l configure -bd $oldbd -highlightthickness $oldht
    .l configure -borderwidth 3 -highlightthickness 0
    set x "[.l cget -borderwidth] [.l cget -highlightthickness]"
    .l configure -borderwidth $oldbd -highlightthickness $oldht
    set x
} -result {3 0}
test listbox-3.28 {ListboxWidgetCmd procedure, "curselection" option} -body {
    .l curselection a
} -returnCodes error -result {wrong # args: should be ".l curselection"}
test listbox-3.29 {ListboxWidgetCmd procedure, "curselection" option} -body {
    .l selection clear 0 end
1124
1125
1126
1127
1128
1129
1130
1131

1132
1133
1134
1135
1136
1137
1138
1126
1127
1128
1129
1130
1131
1132

1133
1134
1135
1136
1137
1138
1139
1140







-
+







    format {%.6g %.6g} {*}[.partial.l yview]
} -cleanup {
    destroy .l
} -result {0 0.266667}

# Listbox used in 3.127 -3.137 tests
destroy .l
listbox .l -width 20 -height 5 -bd 4 -highlightthickness 1 -selectborderwidth 2
listbox .l -width 20 -height 5 -borderwidth 4 -highlightthickness 1 -selectborderwidth 2
pack .l
.l insert 0 el0 el1 el2 el3 el4 el5 el6 el7 el8 el9 el10 el11 el12 el13 el14 \
	el15 el16 el17
update
test listbox-3.127 {ListboxWidgetCmd procedure, "xview" option} -body {
    .l yview foo
} -returnCodes error -result {bad listbox index "foo": must be active, anchor, end, @x,y, or a number}
1357
1358
1359
1360
1361
1362
1363
1364

1365
1366
1367
1368
1369
1370
1371
1359
1360
1361
1362
1363
1364
1365

1366
1367
1368
1369
1370
1371
1372
1373







-
+







test listbox-4.8 {ConfigureListbox procedure} -setup {
    destroy .l2
} -body {
    listbox .l2 -width 15 -height 20 -xscrollcommand "record x" \
	    -yscrollcommand "record y"
    pack .l2
    update
    .l2 configure -fg black
    .l2 configure -color black
    set log {}
    update
    set log
} -cleanup {
    destroy .l2
} -result {{y 0 1} {x 0 1}}
test listbox-4.9 {ConfigureListbox procedure, -listvar} -setup {
1511
1512
1513
1514
1515
1516
1517
1518

1519
1520
1521
1522
1523
1524
1525
1513
1514
1515
1516
1517
1518
1519

1520
1521
1522
1523
1524
1525
1526
1527







-
+







    list [winfo reqwidth .l] [winfo reqheight .l]
} -result {17 168}
test listbox-5.3 {ListboxComputeGeometry procedure} -constraints {
	fonts
} -setup {
    destroy .l
} -body {
    listbox .l -font $fixed -width 0 -height 10 -bd 3
    listbox .l -font $fixed -width 0 -height 10 -borderwidth 3
    .l insert 0 Short "Really much longer" Longer
    pack .l
    update
    list [winfo reqwidth .l] [winfo reqheight .l]
} -result {138 170}
test listbox-5.4 {ListboxComputeGeometry procedure} -constraints {
	fonts
1887
1888
1889
1890
1891
1892
1893
1894

1895
1896
1897
1898

1899
1900
1901
1902
1903
1904
1905
1889
1890
1891
1892
1893
1894
1895

1896
1897
1898
1899

1900
1901
1902
1903
1904
1905
1906
1907







-
+



-
+







    list [format {%.6g %.6g} {*}[.l xview]] [format {%.6g %.6g} {*}[.l yview]]
} -cleanup {
    destroy .l
} -result {{0 0.222222} {0 0.333333}}
test listbox-8.3 {ListboxEventProc procedure} -setup {
    deleteWindows
} -body {
    listbox .l1 -bg #543210
    listbox .l1 -background #543210
    rename .l1 .l2
    set x {}
    lappend x [winfo children .]
    lappend x [.l2 cget -bg]
    lappend x [.l2 cget -background]
    destroy .l1
    lappend x [info command .l*] [winfo children .]
} -cleanup {
    deleteWindows
} -result {.l1 #543210 {} {}}


2705
2706
2707
2708
2709
2710
2711
2712

2713
2714
2715

2716
2717
2718
2719
2720
2721
2722
2723
2724

2725
2726
2727

2728
2729
2730
2731
2732
2733
2734
2735
2736
2737

2738
2739

2740
2741
2742
2743
2744
2745
2746
2747
2748
2749

2750
2751

2752
2753
2754
2755
2756
2757
2758
2707
2708
2709
2710
2711
2712
2713

2714
2715
2716

2717
2718
2719
2720
2721
2722
2723
2724
2725

2726
2727
2728

2729
2730
2731
2732
2733
2734
2735
2736
2737
2738

2739
2740

2741
2742
2743
2744
2745
2746
2747
2748
2749
2750

2751
2752

2753
2754
2755
2756
2757
2758
2759
2760







-
+


-
+








-
+


-
+









-
+

-
+









-
+

-
+







    destroy .l
} -result {can't set "x": invalid listvar value}
test listbox-21.12 {ListboxListVarProc, cleanup item attributes} -setup {
    destroy .l
} -body {
    set x [list a b c d e f g]
    listbox .l -listvar x
    .l itemconfigure end -fg red
    .l itemconfigure end -color red
    set x [list a b c d]
    set x [list 0 1 2 3 4 5 6]
    .l itemcget end -fg
    .l itemcget end -color
} -cleanup {
    destroy .l
} -result {}
test listbox-21.12a {ListboxListVarProc, cleanup item attributes} -setup {
    destroy .l
} -body {
    set x [list a b c d e f g]
    listbox .l -listvar x
    .l itemconfigure end -fg red
    .l itemconfigure end -color red
    set x [list a b c d]
    set x [list 0 1 2 3 4 5 6]
    .l itemcget end -fg
    .l itemcget end -color
} -cleanup {
    destroy .l
} -result {}
test listbox-21.13 {listbox item configurations and listvar based deletions} -setup {
    destroy .l
} -body {
    catch {unset x}
    listbox .l -listvar x
    .l insert end a b c
    .l itemconfigure 1 -fg red
    .l itemconfigure 1 -color red
    set x [list b c]
    .l itemcget 1 -fg
    .l itemcget 1 -color
} -cleanup {
    destroy .l
} -result red
test listbox-21.14 {listbox item configurations and listvar based inserts} -setup {
    destroy .l
} -body {
    catch {unset x}
    listbox .l -listvar x
    .l insert end a b c
    .l itemconfigure 0 -fg red
    .l itemconfigure 0 -color red
    set x [list 1 2 3 4 a b c]
    .l itemcget 0 -fg
    .l itemcget 0 -color
} -cleanup {
    destroy .l
} -result red
test listbox-21.15 {ListboxListVarProc, update vertical scrollbar} -setup {
    destroy .l
} -body {
    catch {unset x}
2818
2819
2820
2821
2822
2823
2824
2825

2826
2827
2828
2829
2830
2831
2832
2833
2834

2835
2836
2837
2838






2839
2840
2841
2842
2843
2844
2845
2820
2821
2822
2823
2824
2825
2826

2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837




2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850







-
+









+
-
-
-
-
+
+
+
+
+
+







} -body {
    listbox .l
    catch {.l itemconfigure 0} result
    set result
} -cleanup {
    destroy .l
} -result {item number "0" out of range}
test listbox-23.2 {ConfigureListboxItem} -setup {
test listbox-23.2 {ConfigureListboxItem} -constraints nodeprecated -setup {
    destroy .l
} -body {
    listbox .l
    .l insert end a b c d
    .l itemconfigure 0
} -cleanup {
    destroy .l
} -result [list {-background background Background {} {}} \
	{-bg -background} \
	{-color color Color {} {}} \
	{-fg -foreground} \
	{-foreground foreground Foreground {} {}} \
	{-selectbackground selectBackground Foreground {} {}} \
	{-selectforeground selectForeground Background {} {}}]
	{-fg -color} \
	{-foreground -color} \
	{-selectbackground selectBackground SelectBackground {} {}} \
	{-selectcolor selectColor SelectColor {} {}} \
	{-selectfg -selectcolor} \
	{-selectforeground -selectcolor}]
test listbox-23.3 {ConfigureListboxItem, itemco shortcut} -setup {
    destroy .l
} -body {
    listbox .l
    .l insert end a b c d
    .l itemco 0 -background
} -cleanup {
2858
2859
2860
2861
2862
2863
2864
2865

2866
2867
2868
2869
2870
2871
2872



2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892


2893
2894

2895
2896
2897

2898
2899
2900
2901


2902
2903

2904
2905
2906

2907
2908
2909
2910


2911
2912

2913
2914
2915

2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928


2929
2930

2931
2932
2933

2934
2935
2936
2937
2938
2939
2940
2941
2942
2943

2944
2945
2946
2947
2948
2949
2950
2951
2952
2953


2954
2955
2956
2957
2958
2959
2960
2863
2864
2865
2866
2867
2868
2869

2870
2871
2872
2873
2874



2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895


2896
2897
2898

2899
2900
2901

2902
2903
2904


2905
2906
2907

2908
2909
2910

2911
2912
2913


2914
2915
2916

2917
2918
2919

2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931


2932
2933
2934

2935
2936
2937

2938
2939
2940
2941
2942
2943
2944
2945
2946
2947

2948
2949
2950
2951
2952
2953
2954
2955
2956


2957
2958
2959
2960
2961
2962
2963
2964
2965







-
+




-
-
-
+
+
+


















-
-
+
+

-
+


-
+


-
-
+
+

-
+


-
+


-
-
+
+

-
+


-
+











-
-
+
+

-
+


-
+









-
+








-
-
+
+







test listbox-23.5 {ConfigureListboxItem, multiple calls} -setup {
    destroy .l
} -body {
    listbox .l
    set i 0
    foreach color {red orange yellow green blue white violet} {
	.l insert end $color
	.l itemconfigure $i -bg $color
	.l itemconfigure $i -background $color
	incr i
    }
    pack .l
    update
    list [.l itemcget 0 -bg] [.l itemcget 1 -bg] [.l itemcget 2 -bg] \
	    [.l itemcget 3 -bg] [.l itemcget 4 -bg] [.l itemcget 5 -bg] \
	    [.l itemcget 6 -bg]
    list [.l itemcget 0 -background] [.l itemcget 1 -background] [.l itemcget 2 -background] \
	    [.l itemcget 3 -background] [.l itemcget 4 -background] [.l itemcget 5 -background] \
	    [.l itemcget 6 -background]
} -cleanup {
    destroy .l
} -result {red orange yellow green blue white violet}

# Listbox used in 23.6 -23.17 tests
destroy .l
listbox .l
.l insert end a b c d
test listbox-23.6 {configuration options} -body {
    .l itemconfigure 0 -background #ff0000
    list [lindex [.l itemconfigure 0 -background] 4] [.l itemcget 0 -background]
} -cleanup {
    .l configure -background #ffffff
} -result {{#ff0000} #ff0000}
test listbox-23.7 {configuration options} -body {
    .l configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test listbox-23.8 {configuration options} -body {
    .l itemconfigure 0 -bg #ff0000
    list [lindex [.l itemconfigure 0 -bg] 4] [.l itemcget 0 -bg]
    .l itemconfigure 0 -background #ff0000
    list [lindex [.l itemconfigure 0 -background] 4] [.l itemcget 0 -background]
} -cleanup {
    .l configure -bg #ffffff
    .l configure -background #ffffff
} -result {{#ff0000} #ff0000}
test listbox-23.9 {configuration options} -body {
    .l configure -bg non-existent
    .l configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test listbox-23.10 {configuration options} -body {
    .l itemconfigure 0 -fg #110022
    list [lindex [.l itemconfigure 0 -fg] 4] [.l itemcget 0 -fg]
    .l itemconfigure 0 -color #110022
    list [lindex [.l itemconfigure 0 -color] 4] [.l itemcget 0 -color]
} -cleanup {
    .l configure -fg #000000
    .l configure -color #000000
} -result {{#110022} #110022}
test listbox-23.11 {configuration options} -body {
    .l configure -fg bogus
    .l configure -color bogus
} -returnCodes error -result {unknown color name "bogus"}
test listbox-23.12 {configuration options} -body {
    .l itemconfigure 0 -foreground #110022
    list [lindex [.l itemconfigure 0 -foreground] 4] [.l itemcget 0 -foreground]
    .l itemconfigure 0 -color #110022
    list [lindex [.l itemconfigure 0 -color] 4] [.l itemcget 0 -color]
} -cleanup {
    .l configure -foreground #000000
    .l configure -color #000000
} -result {{#110022} #110022}
test listbox-23.13 {configuration options} -body {
    .l configure -foreground bogus
    .l configure -color bogus
} -returnCodes error -result {unknown color name "bogus"}
test listbox-23.14 {configuration options} -body {
    .l itemconfigure 0 -selectbackground #110022
    list [lindex [.l itemconfigure 0 -selectbackground] 4] [.l itemcget 0 -selectbackground]
} -cleanup {
    .l configure -selectbackground #c3c3c3
} -result {{#110022} #110022}
test listbox-23.15 {configuration options} -body {
    .l configure -selectbackground bogus
} -returnCodes error -result {unknown color name "bogus"}
test listbox-23.16 {configuration options} -body {
    .l itemconfigure 0 -selectforeground #654321
    list [lindex [.l itemconfigure 0 -selectforeground] 4] [.l itemcget 0 -selectforeground]
    .l itemconfigure 0 -selectcolor #654321
    list [lindex [.l itemconfigure 0 -selectcolor] 4] [.l itemcget 0 -selectcolor]
} -cleanup {
    .l configure -selectforeground #000000
    .l configure -selectcolor #000000
} -result {{#654321} #654321}
test listbox-23.17 {configuration options} -body {
    .l configure -selectforeground bogus
    .l configure -selectcolor bogus
} -returnCodes error -result {unknown color name "bogus"}


# ListboxWidgetObjCmd, itemcget
test listbox-24.1 {itemcget} -setup {
    destroy .l
} -body {
    listbox .l
    .l insert end a b c d
    .l itemcget 0 -fg
    .l itemcget 0 -color
} -cleanup {
    destroy .l
} -result {}
test listbox-24.2 {itemcget} -setup {
    destroy .l
} -body {
    listbox .l
    .l insert end a b c d
    .l itemconfigure 0 -fg red
    .l itemcget 0 -fg
    .l itemconfigure 0 -color red
    .l itemcget 0 -color
} -cleanup {
    destroy .l
} -result red
test listbox-24.3 {itemcget} -setup {
    destroy .l
} -body {
    listbox .l
2978
2979
2980
2981
2982
2983
2984
2985

2986
2987
2988

2989
2990
2991
2992
2993
2994
2995
2996
2997

2998
2999

3000
3001
3002
3003
3004
3005
3006
2983
2984
2985
2986
2987
2988
2989

2990
2991
2992

2993
2994
2995
2996
2997
2998
2999
3000
3001

3002
3003

3004
3005
3006
3007
3008
3009
3010
3011







-
+


-
+








-
+

-
+








# General item configuration issues
test listbox-25.1 {listbox item configurations and widget based deletions} -setup {
    destroy .l
} -body {
    listbox .l
    .l insert end a
    .l itemconfigure 0 -fg red
    .l itemconfigure 0 -color red
    .l delete 0 end
    .l insert end a
    .l itemcget 0 -fg
    .l itemcget 0 -color
} -cleanup {
    destroy .l
} -result {}
test listbox-25.2 {listbox item configurations and widget based inserts} -setup {
    destroy .l
} -body {
    listbox .l
    .l insert end a b c
    .l itemconfigure 0 -fg red
    .l itemconfigure 0 -color red
    .l insert 0 1 2 3 4
    list [.l itemcget 0 -fg] [.l itemcget 4 -fg]
    list [.l itemcget 0 -color] [.l itemcget 4 -color]
} -cleanup {
    destroy .l
} -result {{} red}


# state issues
test listbox-26.1 {listbox disabled state disallows inserts} -setup {
Changes to tests/menu.test.
1
2
3
4
5
6
7
8
9
10
11
12
13


14
15
16
17
18
19
20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22













+
+







# This file is a Tcl script to test menus in Tk.  It is
# organized in the standard fashion for Tcl tests.
#
# Copyright © 1995-1997 Sun Microsystems, Inc.
# Copyright © 1998-1999 by Scriptics Corporation.
# All rights reserved.

package require tcltest 2.2
namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
imageInit

testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}]

# find the earth.gif file for use in these tests (tests 2.*)
set earthPhotoFile [file join [file dirname [info script]] earth.gif]
testConstraint hasEarthPhoto [file exists $earthPhotoFile]

test menu-1.1 {Tk_MenuCmd procedure} -body {
    menu
} -returnCodes error -result {wrong # args: should be "menu pathName ?-option value ...?"}
163
164
165
166
167
168
169
170
171
172



173
174
175


176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196



197
198
199


200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220



221
222
223


224
225
226
227
228



229
230
231


232
233
234
235
236
237
238
239
240



241
242
243


244
245
246
247
248
249
250
165
166
167
168
169
170
171



172
173
174
175


176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195



196
197
198
199


200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219



220
221
222
223


224
225
226
227



228
229
230
231


232
233
234
235
236
237
238
239



240
241
242
243


244
245
246
247
248
249
250
251
252







-
-
-
+
+
+

-
-
+
+


















-
-
-
+
+
+

-
-
+
+


















-
-
-
+
+
+

-
-
+
+


-
-
-
+
+
+

-
-
+
+






-
-
-
+
+
+

-
-
+
+







    .m1 configure -activeborderwidth 1.3
    .m1 cget -activeborderwidth
} -result {1.3}
test menu-2.4 {configuration options -activeborderwidth badValue} -body {
    .m1 configure -activeborderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}

test menu-2.5 {configuration options -activeforeground #ff0000} -body {
    .m1 configure -activeforeground #ff0000
    .m1 cget -activeforeground
test menu-2.5 {configuration options -activecolor #ff0000} -body {
    .m1 configure -activecolor #ff0000
    .m1 cget -activecolor
} -result {#ff0000}
test menu-2.6 {configuration options -activeforeground non-existent} -body {
    .m1 configure -activeforeground non-existent
test menu-2.6 {configuration options -activecolor non-existent} -body {
    .m1 configure -activecolor non-existent
} -returnCodes error -result {unknown color name "non-existent"}

test menu-2.6a {configuration options -activerelief sunken} -body {
    .m1 configure -activerelief sunken
    .m1 cget -activerelief
} -result {sunken}
test menu-2.6b {configuration options -activerelief badValue} -body {
    .m1 configure -activerelief badValue
} -returnCodes error -result {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken}

test menu-2.7 {configuration options -background #ff0000} -body {
    .m1 configure -background #ff0000
    .m1 cget -background
} -result {#ff0000}
test menu-2.8 {configuration options -background non-existent} -body {
    .m1 configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}

test menu-2.9 {configuration options -bg #110022} -body {
    .m1 configure -bg #110022
    .m1 cget -bg
test menu-2.9 {configuration options -background #110022} -body {
    .m1 configure -background #110022
    .m1 cget -background
} -result {#110022}
test menu-2.10 {configuration options -bg bogus} -body {
    .m1 configure -bg bogus
test menu-2.10 {configuration options -background bogus} -body {
    .m1 configure -background bogus
} -returnCodes error -result {unknown color name "bogus"}

test menu-2.11 {configuration options -borderwidth 1.3} -body {
    .m1 configure -borderwidth 1.3
    .m1 cget -borderwidth
} -result {1.3}
test menu-2.12 {configuration options -borderwidth badValue} -body {
    .m1 configure -borderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}

test menu-2.13 {configuration options -cursor arrow} -body {
    .m1 configure -cursor arrow
    .m1 cget -cursor
} -result {arrow}
test menu-2.14 {configuration options -cursor badValue} -body {
    .m1 configure -cursor badValue
} -returnCodes error -result {bad cursor spec "badValue"}

test menu-2.15 {configuration options -disabledforeground #00ff00} -body {
    .m1 configure -disabledforeground #00ff00
    .m1 cget -disabledforeground
test menu-2.15 {configuration options -disabledcolor #00ff00} -body {
    .m1 configure -disabledcolor #00ff00
    .m1 cget -disabledcolor
} -result {#00ff00}
test menu-2.16 {configuration options -disabledforeground xyzzy} -body {
    .m1 configure -disabledforeground xyzzy
test menu-2.16 {configuration options -disabledcolor xyzzy} -body {
    .m1 configure -disabledcolor xyzzy
} -returnCodes error -result {unknown color name "xyzzy"}

test menu-2.17 {configuration options -fg #110022} -body {
    .m1 configure -fg #110022
    .m1 cget -fg
test menu-2.17 {configuration options -color #110022} -body {
    .m1 configure -color #110022
    .m1 cget -color
} -result {#110022}
test menu-2.18 {configuration options -fg bogus} -body {
    .m1 configure -fg bogus
test menu-2.18 {configuration options -color bogus} -body {
    .m1 configure -color bogus
} -returnCodes error -result {unknown color name "bogus"}

test menu-2.19 {configuration options -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*} -body {
    .m1 configure -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
    .m1 cget -font
} -result {-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*}
test menu-2.20 {configuration options -foreground #110022} -body {
    .m1 configure -foreground #110022
    .m1 cget -foreground
test menu-2.20 {configuration options -color #110022} -body {
    .m1 configure -color #110022
    .m1 cget -color
} -result {#110022}
test menu-2.21 {configuration options -foreground bogus} -body {
    .m1 configure -foreground bogus
test menu-2.21 {configuration options -color bogus} -body {
    .m1 configure -color bogus
} -returnCodes error -result {unknown color name "bogus"}

test menu-2.22 {configuration options -postcommand {any old string}} -body {
    .m1 configure -postcommand {any old string}
    .m1 cget -postcommand
} -result {any old string}
test menu-2.23 {configuration options -relief groove} -body {
348
349
350
351
352
353
354
355
356
357



358
359
360
361



362
363
364
365
366



367
368
369
370
371



372
373
374
375



376
377
378
379
380



381
382
383
384
385



386
387
388


389
390
391
392


393
394
395
396
397



398
399
400


401
402
403
404


405
406
407
408
409
410
411
350
351
352
353
354
355
356



357
358
359
360



361
362
363
364
365



366
367
368
369
370



371
372
373
374



375
376
377
378
379



380
381
382
383
384



385
386
387
388


389
390
391
392


393
394
395
396



397
398
399
400


401
402
403
404


405
406
407
408
409
410
411
412
413







-
-
-
+
+
+

-
-
-
+
+
+


-
-
-
+
+
+


-
-
-
+
+
+

-
-
-
+
+
+


-
-
-
+
+
+


-
-
-
+
+
+

-
-
+
+


-
-
+
+


-
-
-
+
+
+

-
-
+
+


-
-
+
+







    .m1 entryconfigure 4 -activebackground non-existent
} -returnCodes error -result {unknown color name "non-existent"}

test menu-2.42 {entry configuration options 5 -activebackground non-existent radiobutton} -body {
    .m1 entryconfigure 5 -activebackground non-existent
} -returnCodes error -result {unknown color name "non-existent"}

test menu-2.43 {entry configuration options 0 -activeforeground #ff0000 tearoff} -body {
    .m1 entryconfigure 0 -activeforeground #ff0000
} -returnCodes error -result {unknown option "-activeforeground"}
test menu-2.43 {entry configuration options 0 -activecolor #ff0000 tearoff} -body {
    .m1 entryconfigure 0 -activecolor #ff0000
} -returnCodes error -result {unknown option "-activecolor"}

test menu-2.44 {entry configuration options 1 -activeforeground #ff0000 command} -body {
    .m1 entryconfigure 1 -activeforeground #ff0000
    lindex [.m1 entryconfigure 1 -activeforeground] 4
test menu-2.44 {entry configuration options 1 -activecolor #ff0000 command} -body {
    .m1 entryconfigure 1 -activecolor #ff0000
    lindex [.m1 entryconfigure 1 -activecolor] 4
} -result {#ff0000}

test menu-2.45 {entry configuration options 2 -activeforeground #ff0000 cascade} -body {
    .m1 entryconfigure 2 -activeforeground #ff0000
    lindex [.m1 entryconfigure 2 -activeforeground] 4
test menu-2.45 {entry configuration options 2 -activecolor #ff0000 cascade} -body {
    .m1 entryconfigure 2 -activecolor #ff0000
    lindex [.m1 entryconfigure 2 -activecolor] 4
} -result {#ff0000}

test menu-2.46 {entry configuration options 3 -activeforeground #ff0000 separator} -body {
    .m1 entryconfigure 3 -activeforeground #ff0000
} -returnCodes error -result {unknown option "-activeforeground"}
test menu-2.46 {entry configuration options 3 -activecolor #ff0000 separator} -body {
    .m1 entryconfigure 3 -activecolor #ff0000
} -returnCodes error -result {unknown option "-activecolor"}

test menu-2.47 {entry configuration options 4 -activeforeground #ff0000 checkbutton} -body {
    .m1 entryconfigure 4 -activeforeground #ff0000
    lindex [.m1 entryconfigure 4 -activeforeground] 4
test menu-2.47 {entry configuration options 4 -activecolor #ff0000 checkbutton} -body {
    .m1 entryconfigure 4 -activecolor #ff0000
    lindex [.m1 entryconfigure 4 -activecolor] 4
} -result {#ff0000}

test menu-2.48 {entry configuration options 5 -activeforeground #ff0000 radiobutton} -body {
    .m1 entryconfigure 5 -activeforeground #ff0000
    lindex [.m1 entryconfigure 5 -activeforeground] 4
test menu-2.48 {entry configuration options 5 -activecolor #ff0000 radiobutton} -body {
    .m1 entryconfigure 5 -activecolor #ff0000
    lindex [.m1 entryconfigure 5 -activecolor] 4
} -result {#ff0000}

test menu-2.49 {entry configuration options 0 -activeforeground non-existent tearoff} -body {
    .m1 entryconfigure 0 -activeforeground non-existent
} -returnCodes error -result {unknown option "-activeforeground"}
test menu-2.49 {entry configuration options 0 -activecolor non-existent tearoff} -body {
    .m1 entryconfigure 0 -activecolor non-existent
} -returnCodes error -result {unknown option "-activecolor"}

test menu-2.50 {entry configuration options 1 -activeforeground non-existent command} -body {
    .m1 entryconfigure 1 -activeforeground non-existent
test menu-2.50 {entry configuration options 1 -activecolor non-existent command} -body {
    .m1 entryconfigure 1 -activecolor non-existent
} -returnCodes error -result {unknown color name "non-existent"}

test menu-2.51 {entry configuration options 2 -activeforeground non-existent cascade} -body {
    .m1 entryconfigure 2 -activeforeground non-existent
test menu-2.51 {entry configuration options 2 -activecolor non-existent cascade} -body {
    .m1 entryconfigure 2 -activecolor non-existent
} -returnCodes error -result {unknown color name "non-existent"}

test menu-2.52 {entry configuration options 3 -activeforeground non-existent separator} -body {
    .m1 entryconfigure 3 -activeforeground non-existent
} -returnCodes error -result {unknown option "-activeforeground"}
test menu-2.52 {entry configuration options 3 -activecolor non-existent separator} -body {
    .m1 entryconfigure 3 -activecolor non-existent
} -returnCodes error -result {unknown option "-activecolor"}

test menu-2.53 {entry configuration options 4 -activeforeground non-existent checkbutton} -body {
    .m1 entryconfigure 4 -activeforeground non-existent
test menu-2.53 {entry configuration options 4 -activecolor non-existent checkbutton} -body {
    .m1 entryconfigure 4 -activecolor non-existent
} -returnCodes error -result {unknown color name "non-existent"}

test menu-2.54 {entry configuration options 5 -activeforeground non-existent radiobutton} -body {
    .m1 entryconfigure 5 -activeforeground non-existent
test menu-2.54 {entry configuration options 5 -activecolor non-existent radiobutton} -body {
    .m1 entryconfigure 5 -activecolor non-existent
} -returnCodes error -result {unknown color name "non-existent"}

test menu-2.55 {entry configuration options 0 -accelerator Ctrl+S tearoff} -body {
    .m1 entryconfigure 0 -accelerator Ctrl+S
} -returnCodes error -result {unknown option "-accelerator"}

test menu-2.56 {entry configuration options 1 -accelerator Ctrl+S command} -body {
642
643
644
645
646
647
648
649
650
651



652
653
654
655



656
657
658
659
660



661
662
663
664
665



666
667
668
669



670
671
672
673
674



675
676
677
678
679



680
681
682


683
684
685
686


687
688
689
690
691



692
693
694


695
696
697
698


699
700
701
702
703
704
705
644
645
646
647
648
649
650



651
652
653
654



655
656
657
658
659



660
661
662
663
664



665
666
667
668



669
670
671
672
673



674
675
676
677
678



679
680
681
682


683
684
685
686


687
688
689
690



691
692
693
694


695
696
697
698


699
700
701
702
703
704
705
706
707







-
-
-
+
+
+

-
-
-
+
+
+


-
-
-
+
+
+


-
-
-
+
+
+

-
-
-
+
+
+


-
-
-
+
+
+


-
-
-
+
+
+

-
-
+
+


-
-
+
+


-
-
-
+
+
+

-
-
+
+


-
-
+
+







    .m1 entryconfigure 4 -font {kill rock stars}
} -returnCodes error -result {expected integer but got "rock"}

test menu-2.108 {entry configuration options 5 -font {kill rock stars} radiobutton} -body {
    .m1 entryconfigure 5 -font {kill rock stars}
} -returnCodes error -result {expected integer but got "rock"}

test menu-2.109 {entry configuration options 0 -foreground #110022 tearoff} -body {
    .m1 entryconfigure 0 -foreground #110022
} -returnCodes error -result {unknown option "-foreground"}
test menu-2.109 {entry configuration options 0 -color #110022 tearoff} -body {
    .m1 entryconfigure 0 -color #110022
} -returnCodes error -result {unknown option "-color"}

test menu-2.110 {entry configuration options 1 -foreground #110022 command} -body {
    .m1 entryconfigure 1 -foreground #110022
    lindex [.m1 entryconfigure 1 -foreground] 4
test menu-2.110 {entry configuration options 1 -color #110022 command} -body {
    .m1 entryconfigure 1 -color #110022
    lindex [.m1 entryconfigure 1 -color] 4
} -result {#110022}

test menu-2.111 {entry configuration options 2 -foreground #110022 cascade} -body {
    .m1 entryconfigure 2 -foreground #110022
    lindex [.m1 entryconfigure 2 -foreground] 4
test menu-2.111 {entry configuration options 2 -color #110022 cascade} -body {
    .m1 entryconfigure 2 -color #110022
    lindex [.m1 entryconfigure 2 -color] 4
} -result {#110022}

test menu-2.112 {entry configuration options 3 -foreground #110022 separator} -body {
    .m1 entryconfigure 3 -foreground #110022
} -returnCodes error -result {unknown option "-foreground"}
test menu-2.112 {entry configuration options 3 -color #110022 separator} -body {
    .m1 entryconfigure 3 -color #110022
} -returnCodes error -result {unknown option "-color"}

test menu-2.113 {entry configuration options 4 -foreground #110022 checkbutton} -body {
    .m1 entryconfigure 4 -foreground #110022
    lindex [.m1 entryconfigure 4 -foreground] 4
test menu-2.113 {entry configuration options 4 -color #110022 checkbutton} -body {
    .m1 entryconfigure 4 -color #110022
    lindex [.m1 entryconfigure 4 -color] 4
} -result {#110022}

test menu-2.114 {entry configuration options 5 -foreground #110022 radiobutton} -body {
    .m1 entryconfigure 5 -foreground #110022
    lindex [.m1 entryconfigure 5 -foreground] 4
test menu-2.114 {entry configuration options 5 -color #110022 radiobutton} -body {
    .m1 entryconfigure 5 -color #110022
    lindex [.m1 entryconfigure 5 -color] 4
} -result {#110022}

test menu-2.115 {entry configuration options 0 -foreground non-existent tearoff} -body {
    .m1 entryconfigure 0 -foreground non-existent
} -returnCodes error -result {unknown option "-foreground"}
test menu-2.115 {entry configuration options 0 -color non-existent tearoff} -body {
    .m1 entryconfigure 0 -color non-existent
} -returnCodes error -result {unknown option "-color"}

test menu-2.116 {entry configuration options 1 -foreground non-existent command} -body {
    .m1 entryconfigure 1 -foreground non-existent
test menu-2.116 {entry configuration options 1 -color non-existent command} -body {
    .m1 entryconfigure 1 -color non-existent
} -returnCodes error -result {unknown color name "non-existent"}

test menu-2.117 {entry configuration options 2 -foreground non-existent cascade} -body {
    .m1 entryconfigure 2 -foreground non-existent
test menu-2.117 {entry configuration options 2 -color non-existent cascade} -body {
    .m1 entryconfigure 2 -color non-existent
} -returnCodes error -result {unknown color name "non-existent"}

test menu-2.118 {entry configuration options 3 -foreground non-existent separator} -body {
    .m1 entryconfigure 3 -foreground non-existent
} -returnCodes error -result {unknown option "-foreground"}
test menu-2.118 {entry configuration options 3 -color non-existent separator} -body {
    .m1 entryconfigure 3 -color non-existent
} -returnCodes error -result {unknown option "-color"}

test menu-2.119 {entry configuration options 4 -foreground non-existent checkbutton} -body {
    .m1 entryconfigure 4 -foreground non-existent
test menu-2.119 {entry configuration options 4 -color non-existent checkbutton} -body {
    .m1 entryconfigure 4 -color non-existent
} -returnCodes error -result {unknown color name "non-existent"}

test menu-2.120 {entry configuration options 5 -foreground non-existent radiobutton} -body {
    .m1 entryconfigure 5 -foreground non-existent
test menu-2.120 {entry configuration options 5 -color non-existent radiobutton} -body {
    .m1 entryconfigure 5 -color non-existent
} -returnCodes error -result {unknown color name "non-existent"}

test menu-2.121 {entry configuration options 0 -image image1 tearoff} -constraints {
    hasEarthPhoto
} -body {
    .m1 entryconfigure 0 -image image1
} -returnCodes error -result {unknown option "-image"}
1356
1357
1358
1359
1360
1361
1362
1363

1364
1365
1366
1367
1368
1369
1370

1371
1372
1373
1374
1375
1376
1377
1358
1359
1360
1361
1362
1363
1364

1365
1366
1367
1368
1369
1370
1371

1372
1373
1374
1375
1376
1377
1378
1379







-
+






-
+







	destroy .m1
} -body {
    menu .m1
    .m1 clone .m1.clone1 tearoff
} -cleanup {
	destroy .m1
} -result {}
test menu-3.18 {MenuWidgetCmd procedure, "configure" option} -setup {
test menu-3.18 {MenuWidgetCmd procedure, "configure" option} -constraints nodeprecated -setup {
	destroy .m1
} -body {
    menu .m1
    llength [.m1 configure]
} -cleanup {
	destroy .m1
} -result 21
} -result 24
test menu-3.19 {MenuWidgetCmd procedure, "configure" option} -setup {
	destroy .m1
} -body {
    menu .m1
    .m1 configure -gorp
} -returnCodes error -result {unknown option "-gorp"}
test menu-3.20 {MenuWidgetCmd procedure, "configure" option} -setup {
1507
1508
1509
1510
1511
1512
1513
1514

1515
1516
1517
1518
1519
1520
1521
1522

1523
1524
1525
1526
1527
1528
1529
1509
1510
1511
1512
1513
1514
1515

1516
1517
1518
1519
1520
1521
1522
1523

1524
1525
1526
1527
1528
1529
1530
1531







-
+







-
+







} -returnCodes error -result {wrong # args: should be ".m1 entryconfigure index ?-option value ...?"}
test menu-3.35 {MenuWidgetCmd procedure, "entryconfigure" option} -setup {
	destroy .m1
} -body {
    menu .m1
    .m1 entryconfigure foo
} -returnCodes error -result {bad menu entry index "foo"}
test menu-3.36 {MenuWidgetCmd procedure, "entryconfigure" option} -setup {
test menu-3.36 {MenuWidgetCmd procedure, "entryconfigure" option} -constraints nodeprecated -setup {
	destroy .m1
} -body {
    menu .m1
    .m1 add command -label "test"
    llength [.m1 entryconfigure 1]
} -cleanup {
	destroy .m1
} -result 15
} -result 17
test menu-3.37 {MenuWidgetCmd procedure, "entryconfigure" option} -setup {
	destroy .m1
} -body {
    menu .m1
    .m1 add command -label "test"
    lindex [.m1 entryconfigure 1 -label] 4
} -cleanup {
2420
2421
2422
2423
2424
2425
2426
2427

2428
2429
2430
2431
2432
2433
2434
2435
2436
2437

2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448

2449
2450
2451
2452
2453
2454
2455
2456
2457

2458
2459
2460
2461
2462
2463
2464
2465
2466

2467
2468
2469
2470
2471
2472
2473
2422
2423
2424
2425
2426
2427
2428

2429
2430
2431
2432
2433
2434
2435
2436
2437
2438

2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449

2450
2451
2452
2453
2454
2455
2456
2457
2458

2459
2460
2461
2462
2463
2464
2465
2466
2467

2468
2469
2470
2471
2472
2473
2474
2475







-
+









-
+










-
+








-
+








-
+







    deleteWindows
} -result {{} beep}
test menu-9.4 {ConfigureMenu}  -setup {
    destroy .m1
} -body {
    menu .m1
    .m1 add command -label "test"
    .m1 configure -fg red
    .m1 configure -color red
} -cleanup {
    deleteWindows
} -result {}
test menu-9.5 {ConfigureMenu}  -setup {
    destroy .m1
} -body {
    menu .m1
    .m1 add command -label "test"
    .m1 add command -label "two"
    .m1 configure -fg red
    .m1 configure -color red
} -cleanup {
    deleteWindows
} -result {}
test menu-9.6 {ConfigureMenu}  -setup {
    destroy .m1
} -body {
    menu .m1
    .m1 add command -label "test"
    .m1 add command -label "two"
    .m1 add command -label "three"
    .m1 configure -fg red
    .m1 configure -color red
} -cleanup {
    deleteWindows
} -result {}
test menu-9.7 {ConfigureMenu} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 clone .m2 tearoff
    list [.m1 configure -fg red] [.m2 cget -fg]
    list [.m1 configure -color red] [.m2 cget -color]
} -cleanup {
    deleteWindows
} -result {{} red}
test menu-9.8 {ConfigureMenu} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 clone .m2 tearoff
    list [.m2 configure -fg red] [.m1 cget -fg]
    list [.m2 configure -color red] [.m1 cget -color]
} -cleanup {
    deleteWindows
} -result {{} red}
test menu-9.9 {ConfigureMenu}  -setup {
    destroy .m1
} -body {
    menu .m1
Changes to tests/menuDraw.test.
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
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







-
+















-
+






-
+







    destroy .m1
} -result {}
test menuDraw-4.2 {TkMenuEntryFreeDrawOptions} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add checkbutton -label "This is a test." -font "Courier 12" \
        -activeforeground red -background green -selectcolor purple
        -activecolor red -background green -selectcolor purple
    destroy .m1
} -result {}


test menuDraw-5.1 {TkMenuConfigureDrawOptions - new menu} -setup {
    deleteWindows
} -body {
    menu .m1
} -cleanup {
    deleteWindows
} -result {.m1}
test menuDraw-5.2 {TkMenuConfigureDrawOptions - old menu} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 configure -fg red
    .m1 configure -color red
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-5.3 {TkMenuConfigureDrawOptions - no disabledFg} -setup {
    deleteWindows
} -body {
    menu .m1 -disabledforeground ""
    menu .m1 -disabledcolor ""
} -cleanup {
    deleteWindows
} -result {.m1}


test menuDraw-6.1 {TkMenuConfigureEntryDrawOptions - no tkfont specified} -setup {
    deleteWindows
149
150
151
152
153
154
155
156

157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172

173
174
175
176
177
178
179
149
150
151
152
153
154
155

156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171

172
173
174
175
176
177
178
179







-
+















-
+







} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.9 {TkMenuConfigureEntryDrawOptions - foreground specified} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo" -foreground "red"
    .m1 add command -label "foo" -color "red"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.10 {TkMenuConfigureEntryDrawOptions - activeBorder specified} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo" -activebackground "red"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.11 {TkMenuConfigureEntryDrawOptions - activeforeground specified} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo" -activeforeground "red"
    .m1 add command -label "foo" -activecolor "red"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.12 {TkMenuConfigureEntryDrawOptions - selectcolor specified} -setup {
    deleteWindows
} -body {
    menu .m1
190
191
192
193
194
195
196
197
198


199
200
201
202
203
204
205

206
207

208
209
210
211
212
213
214
190
191
192
193
194
195
196


197
198
199
200
201
202
203
204

205
206

207
208
209
210
211
212
213
214







-
-
+
+






-
+

-
+







} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.14 {TkMenuConfigureEntryDrawOptions - activeGC disposal} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command -label "foo" -activeforeground "red"
    .m1 entryconfigure 1 -activeforeground "green"
    .m1 add command -label "foo" -activecolor "red"
    .m1 entryconfigure 1 -activecolor "green"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.15 {TkMenuConfigureEntryDrawOptions - disabledGC disposal} -setup {
    deleteWindows
} -body {
    menu .m1 -disabledforeground "red"
    menu .m1 -disabledcolor "red"
    .m1 add command -label "foo"
    .m1 configure -disabledforeground "green"
    .m1 configure -disabledcolor "green"
} -cleanup {
    deleteWindows
} -result {}
test menuDraw-6.16 {TkMenuConfigureEntryDrawOptions - indicatorGC disposal} -setup {
    deleteWindows
} -body {
    menu .m1
Changes to tests/menubut.test.
12
13
14
15
16
17
18


19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+








package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
namespace import -force tcltest::test
imageInit

testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}]

# Create entries in the option database to be sure that geometry options
# like border width have predictable values.

option add *Menubutton.borderWidth 2
option add *Menubutton.highlightThickness 2
option add *Menubutton.font {Helvetica -12 bold}
option add *Button.borderWidth 2
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
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
94







-
-
+
+

-
+


-
+




















-
-
+
+

-
+


-
+


-
-
+
+

-
+


-
+







} -cleanup {
    .mb configure -activebackground [lindex [.mb configure -activebackground] 3]
} -result {#012345}
test menubutton-1.2 {configuration options} -body {
    .mb configure -activebackground non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test menubutton-1.3 {configuration options} -body {
    .mb configure -activeforeground #ff0000
    .mb cget -activeforeground
    .mb configure -activecolor #ff0000
    .mb cget -activecolor
} -cleanup {
    .mb configure -activeforeground [lindex [.mb configure -activeforeground] 3]
    .mb configure -activecolor [lindex [.mb configure -activecolor] 3]
} -result {#ff0000}
test menubutton-1.4 {configuration options} -body {
    .mb configure -activeforeground non-existent
    .mb configure -activecolor non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test menubutton-1.5 {configuration options} -body {
    .mb configure -anchor nw
    .mb cget -anchor
} -cleanup {
    .mb configure -anchor [lindex [.mb configure -anchor] 3]
} -result {nw}
test menubutton-1.6 {configuration options} -body {
    .mb configure -anchor bogus
} -returnCodes error -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center}
test menubutton-1.7 {configuration options} -body {
    .mb configure -background #ff0000
    .mb cget -background
} -cleanup {
    .mb configure -background [lindex [.mb configure -background] 3]
} -result {#ff0000}
test menubutton-1.8 {configuration options} -body {
    .mb configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test menubutton-1.9 {configuration options} -body {
    .mb configure -bd 4
    .mb cget -bd
    .mb configure -borderwidth 4
    .mb cget -borderwidth
} -cleanup {
    .mb configure -bd [lindex [.mb configure -bd] 3]
    .mb configure -borderwidth [lindex [.mb configure -borderwidth] 3]
} -result 4
test menubutton-1.10 {configuration options} -body {
    .mb configure -bd badValue
    .mb configure -borderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}
test menubutton-1.11 {configuration options} -body {
    .mb configure -bg #ff0000
    .mb cget -bg
    .mb configure -background #ff0000
    .mb cget -background
} -cleanup {
    .mb configure -bg [lindex [.mb configure -bg] 3]
    .mb configure -background [lindex [.mb configure -background] 3]
} -result {#ff0000}
test menubutton-1.12 {configuration options} -body {
    .mb configure -bg non-existent
    .mb configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test menubutton-1.13 {configuration options} -body {
    .mb configure -bitmap questhead
    .mb cget -bitmap
} -cleanup {
    .mb configure -bitmap [lindex [.mb configure -bitmap] 3]
} -result {questhead}
117
118
119
120
121
122
123
124
125


126
127

128
129
130

131
132
133
134


135
136

137
138
139

140
141
142
143
144
145
146
147
148
149


150
151

152
153
154

155
156
157
158
159
160
161
119
120
121
122
123
124
125


126
127
128

129
130
131

132
133
134


135
136
137

138
139
140

141
142
143
144
145
146
147
148
149


150
151
152

153
154
155

156
157
158
159
160
161
162
163







-
-
+
+

-
+


-
+


-
-
+
+

-
+


-
+








-
-
+
+

-
+


-
+







} -cleanup {
    .mb configure -direction [lindex [.mb configure -direction] 3]
} -result {below}
test menubutton-1.20 {configuration options} -body {
    .mb configure -direction badValue
} -returnCodes error -result {bad direction "badValue": must be above, below, flush, left, or right}
test menubutton-1.21 {configuration options} -body {
    .mb configure -disabledforeground #00ff00
    .mb cget -disabledforeground
    .mb configure -disabledcolor #00ff00
    .mb cget -disabledcolor
} -cleanup {
    .mb configure -disabledforeground [lindex [.mb configure -disabledforeground] 3]
    .mb configure -disabledcolor [lindex [.mb configure -disabledcolor] 3]
} -result {#00ff00}
test menubutton-1.22 {configuration options} -body {
    .mb configure -disabledforeground xyzzy
    .mb configure -disabledcolor xyzzy
} -returnCodes error -result {unknown color name "xyzzy"}
test menubutton-1.23 {configuration options} -body {
    .mb configure -fg #110022
    .mb cget -fg
    .mb configure -color #110022
    .mb cget -color
} -cleanup {
    .mb configure -fg [lindex [.mb configure -fg] 3]
    .mb configure -color [lindex [.mb configure -color] 3]
} -result {#110022}
test menubutton-1.24 {configuration options} -body {
    .mb configure -fg bogus
    .mb configure -color bogus
} -returnCodes error -result {unknown color name "bogus"}
test menubutton-1.25 {configuration options} -body {
    .mb configure -font {Helvetica 12}
    .mb cget -font
} -cleanup {
    .mb configure -font [lindex [.mb configure -font] 3]
} -result {Helvetica 12}
test menubutton-1.26 {configuration options} -body {
    .mb configure -foreground #110022
    .mb cget -foreground
    .mb configure -color #110022
    .mb cget -color
} -cleanup {
    .mb configure -foreground [lindex [.mb configure -foreground] 3]
    .mb configure -color [lindex [.mb configure -color] 3]
} -result {#110022}
test menubutton-1.27 {configuration options} -body {
    .mb configure -foreground bogus
    .mb configure -color bogus
} -returnCodes error -result {unknown color name "bogus"}
test menubutton-1.28 {configuration options} -body {
    .mb configure -height 18
    .mb cget -height
} -cleanup {
    .mb configure -height [lindex [.mb configure -height] 3]
} -result 18
361
362
363
364
365
366
367
368

369
370

371
372
373
374
375
376


377
378
379
380



381
382
383
384
385
386
387
363
364
365
366
367
368
369

370
371

372
373
374
375
376


377
378
379



380
381
382
383
384
385
386
387
388
389







-
+

-
+




-
-
+
+

-
-
-
+
+
+







test menubutton-3.5 {ButtonWidgetCmd procedure, "cget" option} -body {
    .mb cget -gorp
} -returnCodes error -result {unknown option "-gorp"}
test menubutton-3.6 {ButtonWidgetCmd procedure, "cget" option} -body {
    .mb configure -highlightthickness 3
    .mb cget -highlightthickness
} -result 3
test menubutton-3.7 {ButtonWidgetCmd procedure, "configure" option} -body {
test menubutton-3.7 {ButtonWidgetCmd procedure, "configure" option} -constraints nodeprecated -body {
    llength [.mb configure]
} -result 33
} -result 36
test menubutton-3.8 {ButtonWidgetCmd procedure, "configure" option} -body {
    .mb configure -gorp
} -returnCodes error -result {unknown option "-gorp"}
test menubutton-3.9 {ButtonWidgetCmd procedure, "configure" option} -body {
    .mb co -bg #ffffff -fg
} -returnCodes error -result {value for "-fg" missing}
    .mb co -background #ffffff -color
} -returnCodes error -result {value for "-color" missing}
test menubutton-3.10 {ButtonWidgetCmd procedure, "configure" option} -body {
    .mb configure -fg #123456
    .mb configure -bg #654321
    lindex [.mb configure -fg] 4
    .mb configure -color #123456
    .mb configure -background #654321
    lindex [.mb configure -color] 4
} -result {#123456}
test menubutton-3.11 {ButtonWidgetCmd procedure, "configure" option} -body {
    .mb foobar
} -returnCodes error -result {bad option "foobar": must be cget or configure}
deleteWindows

# XXX Need to add tests for several procedures here.   The tests for   XXX
517
518
519
520
521
522
523
524

525
526
527

528
529
530
531
532
533
534
519
520
521
522
523
524
525

526
527
528

529
530
531
532
533
534
535
536







-
+


-
+








# XXX Need to add tests for several procedures here. XXX

test menubutton-5.1 {MenuButtonEventProc procedure} -setup {
    deleteWindows
    set x {}
} -body {
    menubutton .mb1 -bg #543210
    menubutton .mb1 -background #543210
    rename .mb1 .mb2
    lappend x [winfo children .]
    lappend x [.mb2 cget -bg]
    lappend x [.mb2 cget -background]
    destroy .mb1
    lappend x [info command .mb*] [winfo children .]
} -cleanup {
    deleteWindows
} -result {.mb1 #543210 {} {}}


549
550
551
552
553
554
555
556

557
558
559
560
561
562
563
564
565
566
567
568
569

570
571
572
573
574
575
576
577
578
579
580
581
582

583
584
585
586
587
588
589
590
591
592
593
594
595

596
597
598
599
600
601
602
603
604
605
606
607
608
609

610
611
612
613
614
615
616
617
618
619
620

621
622
623
624
625
626
627
628
629
630

631
632
633
634
635
636
637
638
639
640

641
642
643
644
645
646
647
648
649
650
651
652

653
654
655
656
657
658
659
660
661
662
663
664

665
666
667
668
669
670
671
672
673
674
675
676

677
678
679
680
681
682
683
684
685
686
687
688

689
690
691
692
693
694
695
696
697
698
699
700

701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716

717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733

734
735
736
737
738
739
740
551
552
553
554
555
556
557

558
559
560
561
562
563
564
565
566
567
568
569
570

571
572
573
574
575
576
577
578
579
580
581
582
583

584
585
586
587
588
589
590
591
592
593
594
595
596

597
598
599
600
601
602
603
604
605
606
607
608
609
610

611
612
613
614
615
616
617
618
619
620
621

622
623
624
625
626
627
628
629
630
631

632
633
634
635
636
637
638
639
640
641

642
643
644
645
646
647
648
649
650
651
652
653

654
655
656
657
658
659
660
661
662
663
664
665

666
667
668
669
670
671
672
673
674
675
676
677

678
679
680
681
682
683
684
685
686
687
688
689

690
691
692
693
694
695
696
697
698
699
700
701

702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717

718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734

735
736
737
738
739
740
741
742







-
+












-
+












-
+












-
+













-
+










-
+









-
+









-
+











-
+











-
+











-
+











-
+











-
+















-
+
















-
+







}
test menubutton-7.1 {ComputeMenuButtonGeometry procedure} -constraints {
    testImageType
} -setup {
    deleteWindows
    image create test image1
} -body {
    menubutton .mb -image image1 -bd 4 -highlightthickness 0
    menubutton .mb -image image1 -borderwidth 4 -highlightthickness 0
    pack .mb
    list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
    deleteWindows
    imageCleanup
} -result [list [expr {38 + $extraWidth}] 23]
test menubutton-7.2 {ComputeMenuButtonGeometry procedure} -constraints {
    testImageType
} -setup {
    deleteWindows
    image create test image1
} -body {
    menubutton .mb -image image1 -bd 3 -highlightthickness 1
    menubutton .mb -image image1 -borderwidth 3 -highlightthickness 1
    pack .mb
    list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
    deleteWindows
    imageCleanup
} -result [list [expr {38 + $extraWidth}] 23]
test menubutton-7.3 {ComputeMenuButtonGeometry procedure} -constraints {
    testImageType
} -setup {
    deleteWindows
    image create test image1
} -body {
    menubutton .mb -image image1 -bd 1 -highlightthickness 3 -padx 5 -pady 5
    menubutton .mb -image image1 -borderwidth 1 -highlightthickness 3 -padx 5 -pady 5
    pack .mb
    list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
    deleteWindows
    imageCleanup
} -result [list [expr {38 + $extraWidth}] 23]
test menubutton-7.4 {ComputeMenuButtonGeometry procedure} -constraints {
    testImageType
} -setup {
    deleteWindows
    image create test image1
} -body {
    menubutton .mb -image image1 -bd 2 -relief raised -width 40 \
    menubutton .mb -image image1 -borderwidth 2 -relief raised -width 40 \
        -highlightthickness 2
    pack .mb
    list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
    deleteWindows
    imageCleanup
} -result [list [expr {48 + $extraWidth}] 23]
test menubutton-7.5 {ComputeMenuButtonGeometry procedure} -constraints {
    testImageType
} -setup {
    deleteWindows
    image create test image1
} -body {
    menubutton .mb -image image1 -bd 2 -relief raised -height 30 \
    menubutton .mb -image image1 -borderwidth 2 -relief raised -height 30 \
        -highlightthickness 2
    pack .mb
    list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
    deleteWindows
    imageCleanup
} -result [list [expr {38 + $extraWidth}] 38]
test menubutton-7.6 {ComputeMenuButtonGeometry procedure} -setup {
    deleteWindows
} -body {
    menubutton .mb -bitmap question -bd 2 -relief raised \
    menubutton .mb -bitmap question -borderwidth 2 -relief raised \
        -highlightthickness 2
    pack .mb
    list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
    deleteWindows
} -result [list [expr {25 + $extraWidth}] 35]
test menubutton-7.7 {ComputeMenuButtonGeometry procedure} -setup {
    deleteWindows
} -body {
    menubutton .mb -bitmap question -bd 2 -relief raised -width 40 \
    menubutton .mb -bitmap question -borderwidth 2 -relief raised -width 40 \
        -highlightthickness 1
    pack .mb
    list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
    deleteWindows
} -result [list [expr {46 + $extraWidth}] 33]
test menubutton-7.8 {ComputeMenuButtonGeometry procedure} -setup {
    deleteWindows
} -body {
    menubutton .mb -bitmap question -bd 2 -relief raised -height 50 \
    menubutton .mb -bitmap question -borderwidth 2 -relief raised -height 50 \
        -highlightthickness 1
    pack .mb
    list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
    deleteWindows
} -result [list [expr {23 + $extraWidth}] 56]
test menubutton-7.9 {ComputeMenuButtonGeometry procedure} -constraints {
    fonts
} -setup {
    deleteWindows
} -body {
    menubutton .mb -text String -bd 2 -relief raised -padx 0 -pady 0 \
    menubutton .mb -text String -borderwidth 2 -relief raised -padx 0 -pady 0 \
        -highlightthickness 1
    pack .mb
    list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
    deleteWindows
} -result {42 20}
test menubutton-7.10 {ComputeMenuButtonGeometry procedure} -constraints {
    fonts
} -setup {
    deleteWindows
} -body {
    menubutton .mb -text String -bd 2 -relief raised -width 20 \
    menubutton .mb -text String -borderwidth 2 -relief raised -width 20 \
        -padx 0 -pady 0 -highlightthickness 1
    pack .mb
    list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
    deleteWindows
} -result {146 20}
test menubutton-7.11 {ComputeMenuButtonGeometry procedure} -constraints {
    fonts
} -setup {
    deleteWindows
} -body {
    menubutton .mb -text String -bd 2 -relief raised -height 2 \
    menubutton .mb -text String -borderwidth 2 -relief raised -height 2 \
        -padx 0 -pady 0 -highlightthickness 1
    pack .mb
    list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
    deleteWindows
} -result {42 34}
test menubutton-7.12 {ComputeMenuButtonGeometry procedure} -constraints {
    fonts
} -setup {
    deleteWindows
} -body {
    menubutton .mb -text String -bd 2 -relief raised -padx 10 -pady 5 \
    menubutton .mb -text String -borderwidth 2 -relief raised -padx 10 -pady 5 \
        -highlightthickness 1
    pack .mb
    list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
    deleteWindows
} -result {62 30}
test menubutton-7.13 {ComputeMenuButtonGeometry procedure} -constraints {
    nonPortable fonts
} -setup {
    deleteWindows
} -body {
    menubutton .mb -text String -bd 2 -relief raised \
    menubutton .mb -text String -borderwidth 2 -relief raised \
        -highlightthickness 1 -indicatoron 1
    pack .mb
    list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
    deleteWindows
} -result {78 28}
test menubutton-7.14 {ComputeMenuButtonGeometry procedure} -constraints {
    testImageType unix nonPortable
} -setup {
    deleteWindows
    image create test image1
} -body {
    # The following test is non-portable because the indicator's pixel
    # size varies to maintain constant absolute size.

    menubutton .mb -image image1 -bd 2 -relief raised \
    menubutton .mb -image image1 -borderwidth 2 -relief raised \
        -highlightthickness 2 -indicatoron 1
    pack .mb
    list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
    deleteWindows
    imageCleanup
} -result {64 23}
test menubutton-7.15 {ComputeMenuButtonGeometry procedure} -constraints {
    testImageType win nonPortable
} -setup {
    deleteWindows
    image create test image1
} -body {
    # The following test is non-portable because the indicator's pixel
    # size varies to maintain constant absolute size.

    menubutton .mb -image image1 -bd 2 -relief raised \
    menubutton .mb -image image1 -borderwidth 2 -relief raised \
        -highlightthickness 2 -indicatoron 1
    pack .mb
    list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
    deleteWindows
    imageCleanup
} -result {65 23}
Changes to tests/message.test.
1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21













+







# This file is a Tcl script to test out the "message" command
# of Tk.  It is organized in the standard fashion for Tcl tests.
#
# Copyright © 1994 The Regents of the University of California.
# Copyright © 1994-1996 Sun Microsystems, Inc.
# Copyright © 1998-2000 by Ajuba Solutions.
# All rights reserved.

package require tcltest 2.2
namespace import ::tcltest::*
tcltest::loadTestedCommands
eval tcltest::configure $argv

testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}]

test message-1.1 {configuration option: "anchor"} -setup {
    message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .m
    update
} -body {
    .m configure -anchor w
73
74
75
76
77
78
79
80
81


82
83
84
85
86
87
88
89
90

91
92
93
94
95

96
97
98
99
100
101


102
103
104
105

106
107
108
109
110

111
112
113
114
115
116
117
74
75
76
77
78
79
80


81
82
83
84
85
86
87
88
89
90

91
92
93
94
95

96
97
98
99
100


101
102
103
104
105

106
107
108
109
110

111
112
113
114
115
116
117
118







-
-
+
+








-
+




-
+




-
-
+
+



-
+




-
+







} -returnCodes {error} -result {unknown color name "non-existent"}

test message-1.7 {configuration option: "bd"} -setup {
    message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .m
    update
} -body {
    .m configure -bd 4
    .m cget -bd
    .m configure -borderwidth 4
    .m cget -borderwidth
} -cleanup {
    destroy .m
} -result 4
test message-1.8 {configuration option: "bd"} -setup {
    message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .m
    update
} -body {
    .m configure -bd badValue
    .m configure -borderwidth badValue
} -cleanup {
    destroy .m
} -returnCodes {error} -result {bad screen distance "badValue"}

test message-1.9 {configuration option: "bg"} -setup {
test message-1.9 {configuration option: "background"} -setup {
    message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .m
    update
} -body {
    .m configure -bg #ff0000
    .m cget -bg
    .m configure -background #ff0000
    .m cget -background
} -cleanup {
    destroy .m
} -result {#ff0000}
test message-1.10 {configuration option: "bg"} -setup {
test message-1.10 {configuration option: "background"} -setup {
    message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .m
    update
} -body {
    .m configure -bg non-existent
    .m configure -background non-existent
} -cleanup {
    destroy .m
} -returnCodes {error} -result {unknown color name "non-existent"}

test message-1.11 {configuration option: "borderwidth"} -setup {
    message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .m
153
154
155
156
157
158
159
160
161


162
163
164
165
166
167
168
169
170

171
172
173
174
175
176
177
154
155
156
157
158
159
160


161
162
163
164
165
166
167
168
169
170

171
172
173
174
175
176
177
178







-
-
+
+








-
+







} -returnCodes {error} -result {bad cursor spec "badValue"}

test message-1.15 {configuration option: "fg"} -setup {
    message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .m
    update
} -body {
    .m configure -fg #00ff00
    .m cget -fg
    .m configure -color #00ff00
    .m cget -color
} -cleanup {
    destroy .m
} -result {#00ff00}
test message-1.16 {configuration option: "fg"} -setup {
    message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .m
    update
} -body {
    .m configure -fg badValue
    .m configure -color badValue
} -cleanup {
    destroy .m
} -returnCodes {error} -result {unknown color name "badValue"}

test message-1.17 {configuration option: "font"} -setup {
    message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .m
188
189
190
191
192
193
194
195

196
197
198
199
200
201


202
203
204
205

206
207
208
209
210

211
212
213
214
215
216
217
189
190
191
192
193
194
195

196
197
198
199
200


201
202
203
204
205

206
207
208
209
210

211
212
213
214
215
216
217
218







-
+




-
-
+
+



-
+




-
+







    update
} -body {
    .m configure -font {}
} -cleanup {
    destroy .m
} -returnCodes {error} -result {font "" doesn't exist}

test message-1.19 {configuration option: "-foreground"} -setup {
test message-1.19 {configuration option: "-color"} -setup {
    message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .m
    update
} -body {
    .m configure -foreground  green
    .m cget -foreground
    .m configure -color  green
    .m cget -color
} -cleanup {
    destroy .m
} -result {green}
test message-1.20 {configuration option: "-foreground"} -setup {
test message-1.20 {configuration option: "-color"} -setup {
    message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .m
    update
} -body {
    .m configure -foreground  badValue
    .m configure -color  badValue
} -cleanup {
    destroy .m
} -returnCodes {error} -result {unknown color name "badValue"}

test message-1.21 {configuration option: "highlightbackground"} -setup {
    message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
    pack .m
442
443
444
445
446
447
448
449

450
451
452
453
454
455

456
457
458
459
460
461
462
463
464
465
466
467
468



469
470
471
472
473
474
475
443
444
445
446
447
448
449

450
451
452
453
454
455

456
457
458
459
460
461
462
463
464
465
466



467
468
469
470
471
472
473
474
475
476







-
+





-
+










-
-
-
+
+
+







    message .m
} -body {
    .m configure -text foobar
    lindex [.m configure -text] 4
} -cleanup {
    destroy .m
} -result {foobar}
test message-3.5 {MessageWidgetObjCmd procedure, "configure"} -setup {
test message-3.5 {MessageWidgetObjCmd procedure, "configure"} -constraints nodeprecated -setup {
    message .m
} -body {
    llength [.m configure]
} -cleanup {
    destroy .m
} -result 21
} -result 22
test message-3.6 {MessageWidgetObjCmd procedure, "configure"} -setup {
    message .m
} -body {
    .m configure -foo
} -cleanup {
    destroy .m
} -returnCodes error -result {unknown option "-foo"}
test message-3.7 {MessageWidgetObjCmd procedure, "configure"} -setup {
    message .m
} -body {
    .m configure -bd 4
    .m configure -bg #ffffff
    lindex [.m configure -bd] 4
    .m configure -borderwidth 4
    .m configure -background #ffffff
    lindex [.m configure -borderwidth] 4
} -cleanup {
    destroy .m
} -result 4

test message-4.1 {Bug [5d991b822e]} {
    # Want this not to segfault, or write to variable with empty name
    unset -nocomplain {}
Changes to tests/oldpack.test.
14
15
16
17
18
19
20
21

22
23
24

25
26
27

28
29
30

31
32
33
34
35
36
37
14
15
16
17
18
19
20

21
22
23

24
25
26

27
28
29

30
31
32
33
34
35
36
37







-
+


-
+


-
+


-
+








# First, test a single window packed in various ways in a parent

destroy .pack
frame .pack
place .pack -width 100 -height 100
frame .pack.red -width 10 -height 20
label .pack.red.l -text R -bd 2 -relief raised
label .pack.red.l -text R -borderwidth 2 -relief raised
place .pack.red.l -relwidth 1.0 -relheight 1.0
frame .pack.green -width 30 -height 40
label .pack.green.l -text G -bd 2 -relief raised
label .pack.green.l -text G -borderwidth 2 -relief raised
place .pack.green.l -relwidth 1.0 -relheight 1.0
frame .pack.blue -width 40 -height 40
label .pack.blue.l -text B -bd 2 -relief raised
label .pack.blue.l -text B -borderwidth 2 -relief raised
place .pack.blue.l -relwidth 1.0 -relheight 1.0
frame .pack.violet -width 80 -height 20
label .pack.violet.l -text P -bd 2 -relief raised
label .pack.violet.l -text P -borderwidth 2 -relief raised
place .pack.violet.l -relwidth 1.0 -relheight 1.0

if {![catch {pack ap .pack .pack.red top}]} {

# Don't execute any of this file if Tk is compiled with -DTCL_NO_DEPRECATED


364
365
366
367
368
369
370
371
372


373
374
375
376
377
378
379
364
365
366
367
368
369
370


371
372
373
374
375
376
377
378
379







-
-
+
+







    winfo reqheight .pack} -result 120
destroy .pack.violet
update
test oldpack-6.3 {geometry propagation} -body {
    winfo reqwidth .pack} -result 40
test oldpack-6.4 {geometry propagation} -body {
    winfo reqheight .pack} -result 100
frame .pack.violet -width 80 -height 20 -bg violet
label .pack.violet.l -text P -bd 2 -relief raised
frame .pack.violet -width 80 -height 20 -background violet
label .pack.violet.l -text P -borderwidth 2 -relief raised
place .pack.violet.l -relwidth 1.0 -relheight 1.0
pack append .pack .pack.red left .pack.green right .pack.blue bottom \
    .pack.violet top
update
test oldpack-6.5 {geometry propagation} -body {
    winfo reqwidth .pack} -result 120
test oldpack-6.6 {geometry propagation} -body {
463
464
465
466
467
468
469
470

471
472
473
474
475
476
477
478
479
480
481
482
483
484

485
486
487
488
489
490
491
463
464
465
466
467
468
469

470
471
472
473
474
475
476
477
478
479
480
481
482
483

484
485
486
487
488
489
490
491







-
+













-
+







} -returnCodes error -result {bad option "a": must be configure, content, forget, info, or propagate}
test oldpack-8.5 {syntax errors} -body {
    pack after foobar
} -returnCodes error -result {bad window path name "foobar"}
test oldpack-8.6 {syntax errors} -setup {
    destroy .pack.yellow
} -body {
    frame .pack.yellow -bg yellow
    frame .pack.yellow -background yellow
    pack after .pack.yellow
} -cleanup {
    destroy .pack.yellow
} -returnCodes error -result {window ".pack.yellow" isn't packed}
test oldpack-8.7 {syntax errors} -body {
    pack append foobar
} -returnCodes error -result {bad window path name "foobar"}
test oldpack-8.8 {syntax errors} -body {
    pack before foobar
} -returnCodes error -result {bad window path name "foobar"}
test oldpack-8.9 {syntax errors} -setup {
    destroy .pack.yellow
} -body {
    frame .pack.yellow -bg yellow
    frame .pack.yellow -background yellow
    pack before .pack.yellow
} -cleanup {
    destroy .pack.yellow
} -returnCodes error -result {window ".pack.yellow" isn't packed}
test oldpack-8.10 {syntax errors} -body {
    pack info .pack help
} -returnCodes error -result {wrong # args: should be "pack info window"}
Changes to tests/pack.test.
694
695
696
697
698
699
700
701

702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717

718
719
720
721
722
723
724
694
695
696
697
698
699
700

701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716

717
718
719
720
721
722
723
724







-
+















-
+







        [winfo geometry .pack.c] [winfo geometry .pack.d]
} -result {100x200+0+0 200x100+100+0 160x100+140+100 40x100+100+100}
test pack-6.12 {-expand option} -setup {
    toplevel .pack2 -height 400 -width 400
    wm geometry .pack2 +0+0
    pack propagate .pack2 0
    foreach i {w1 w2 w3} {
        frame .pack2.$i -width 30 -height 30 -bd 2 -relief raised
        frame .pack2.$i -width 30 -height 30 -borderwidth 2 -relief raised
        label .pack2.$i.l -text $i
        place .pack2.$i.l -relwidth 1.0 -relheight 1.0
    }
} -body {
    pack .pack2.w1 .pack2.w2 .pack2.w3 -padx 5 -ipadx 4 -pady 2 -ipady 6 -expand 1 -side left
    update
    list [winfo geometry .pack2.w1] [winfo geometry .pack2.w2] [winfo geometry .pack2.w3]
} -cleanup {
    destroy .pack2
} -result {38x42+47+179 38x42+180+179 38x42+314+179}
test pack-6.13 {-expand option} -setup {
    toplevel .pack2 -height 400 -width 400
    wm geometry .pack2 +0+0
    pack propagate .pack2 0
    foreach i {w1 w2 w3} {
        frame .pack2.$i -width 30 -height 30 -bd 2 -relief raised
        frame .pack2.$i -width 30 -height 30 -borderwidth 2 -relief raised
        label .pack2.$i.l -text $i
        place .pack2.$i.l -relwidth 1.0 -relheight 1.0
    }
} -body {
    pack .pack2.w1 .pack2.w2 .pack2.w3 -padx 5 -ipadx 4 -pady 2 \
        -ipady 6 -expand 1 -side top
    update
788
789
790
791
792
793
794
795
796


797
798
799
800
801
802
803
788
789
790
791
792
793
794


795
796
797
798
799
800
801
802
803







-
-
+
+







# For the tests below, create a couple of "pad" windows to shrink
# the available space for the remaining windows.  The tests have to
# be done this way rather than shrinking the whole window, because
# some window managers like mwm won't let a top-level window get
# very small.

pack forget .pack.a .pack.b .pack.c .pack.d
frame .pack.right -width 200 -height 10 -bd 2 -relief raised
frame .pack.bottom -width 10 -height 150 -bd 2 -relief raised
frame .pack.right -width 200 -height 10 -borderwidth 2 -relief raised
frame .pack.bottom -width 10 -height 150 -borderwidth 2 -relief raised
pack .pack.right -side right
pack .pack.bottom -side bottom
pack .pack.a .pack.b .pack.c -side top
update
test pack-8.1 {insufficient space} -body {
    list [winfo geometry .pack.a] [winfo ismapped .pack.a] \
        [winfo geometry .pack.b] [winfo ismapped .pack.b] \
1456
1457
1458
1459
1460
1461
1462
1463

1464
1465
1466
1467
1468
1469
1470
1456
1457
1458
1459
1460
1461
1462

1463
1464
1465
1466
1467
1468
1469
1470







-
+







    destroy .pack.f
} -result {1 0}
test pack-15.4 {managing geometry with -in option} -setup {
    pack forget .pack.a .pack.b .pack.c .pack.d
    destroy .pack.f1 .pack.f2
} -body {
    foreach i {1 2} {
        frame .pack.f$i -width 100 -height 40 -bd 2 -relief raised
        frame .pack.f$i -width 100 -height 40 -borderwidth 2 -relief raised
        lower .pack.f$i
        pack propagate .pack.f$i 0
        pack .pack.f$i -side top
    }
    pack .pack.b -in .pack.f1 -side right
    update
    set result {}
1482
1483
1484
1485
1486
1487
1488
1489

1490
1491
1492
1493
1494
1495
1496
1482
1483
1484
1485
1486
1487
1488

1489
1490
1491
1492
1493
1494
1495
1496







-
+







    destroy .pack.f1 .pack.f2
} -result {50x30+48+5 1 50x30+25+48 1 50x30+25+28 1 50x30+25+28 0}
test pack-15.5 {managing geometry with -in option} -setup {
    pack forget .pack.a .pack.b .pack.c .pack.d
    destroy .pack.f1 .pack.f2
} -body {
    foreach i {1 2} {
        frame .pack.f$i -width 100 -height 20 -bd 2 -relief raised
        frame .pack.f$i -width 100 -height 20 -borderwidth 2 -relief raised
        lower .pack.f$i
        pack propagate .pack.f$i 0
        pack .pack.f$i -side top
    }
    pack .pack.b -in .pack.f2 -side top
    update
    set result {}
1555
1556
1557
1558
1559
1560
1561
1562

1563
1564
1565
1566
1567
1568
1569
1555
1556
1557
1558
1559
1560
1561

1562
1563
1564
1565
1566
1567
1568
1569







-
+







    wm geometry .pack +100+100

    # On the PC, when the width/height is configured while the window is
    # unmapped, the changes don't take effect until the window is remapped.
    # Who knows why?

    eval destroy [winfo child .pack]
    frame .pack.a -width 100 -height 50 -relief raised -bd 2
    frame .pack.a -width 100 -height 50 -relief raised -borderwidth 2
    pack .pack.a
    update idletasks
    set result [winfo ismapped .pack.a]
    wm iconify .pack
    lappend result [winfo ismapped .pack.a]
    .pack.a configure -width 200 -height 75
    update idletasks
1578
1579
1580
1581
1582
1583
1584
1585
1586


1587
1588
1589
1590
1591
1592
1593
1578
1579
1580
1581
1582
1583
1584


1585
1586
1587
1588
1589
1590
1591
1592
1593







-
-
+
+







    eval destroy [winfo child .pack]
} -body {
    # adjust the position of .pack before test to avoid a screen switch
    # that occurs with window managers that have desktops four times as big
    # as the screen (screen switch causes scale and other tests to fail).

    wm geometry .pack +100+100
    frame .pack.a -relief raised -bd 2
    frame .pack.b -width 70 -height 30 -relief sunken -bd 2
    frame .pack.a -relief raised -borderwidth 2
    frame .pack.b -width 70 -height 30 -relief sunken -borderwidth 2
    pack .pack.a
    pack .pack.b -in .pack.a
    update idletasks
    set result [winfo ismapped .pack.b]
    wm iconify .pack
    lappend result [winfo ismapped .pack.b]
    .pack.b configure -width 100 -height 30
Changes to tests/panedwindow.test.
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
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







-
-
-
+
+
+

-
+

-
-
+
+

-
-
-
+
+
+

-
+

-
-
+
+







    list [lindex [.p configure -background] 4] [.p cget -background]
} -cleanup {
    .p configure -background [lindex [.p configure -background] 3]
} -result {{#ff0000} #ff0000}
test panedwindow-1.2 {configuration options: -background (bad)} -body {
    .p configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test panedwindow-1.3 {configuration options: -bd (good)} -body {
    .p configure -bd 4
    list [lindex [.p configure -bd] 4] [.p cget -bd]
test panedwindow-1.3 {configuration options: -borderwidth (good)} -body {
    .p configure -borderwidth 4
    list [lindex [.p configure -borderwidth] 4] [.p cget -borderwidth]
} -cleanup {
    .p configure -bd [lindex [.p configure -bd] 3]
    .p configure -borderwidth [lindex [.p configure -borderwidth] 3]
} -result {4 4}
test panedwindow-1.4 {configuration options: -bd (bad)} -body {
    .p configure -bd badValue
test panedwindow-1.4 {configuration options: -borderwidth (bad)} -body {
    .p configure -borderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}
test panedwindow-1.5 {configuration options: -bg (good)} -body {
    .p configure -bg #ff0000
    list [lindex [.p configure -bg] 4] [.p cget -bg]
test panedwindow-1.5 {configuration options: -background (good)} -body {
    .p configure -background #ff0000
    list [lindex [.p configure -background] 4] [.p cget -background]
} -cleanup {
    .p configure -bg [lindex [.p configure -bg] 3]
    .p configure -background [lindex [.p configure -background] 3]
} -result {{#ff0000} #ff0000}
test panedwindow-1.6 {configuration options: -bg (bad)} -body {
    .p configure -bg non-existent
test panedwindow-1.6 {configuration options: -background (bad)} -body {
    .p configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test panedwindow-1.7 {configuration options: -borderwidth (good)} -body {
    .p configure -borderwidth 1.3
    list [lindex [.p configure -borderwidth] 4] [.p cget -borderwidth]
} -cleanup {
    .p configure -borderwidth [lindex [.p configure -borderwidth] 3]
} -result {1 1}
732
733
734
735
736
737
738
739

740
741
742
743
744
745
746
732
733
734
735
736
737
738

739
740
741
742
743
744
745
746







-
+







} -cleanup {
	deleteWindows
} -result [list 15 0]
test panedwindow-10.9 {sash place subcommand, respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [frame .f -width 20 -height 20 -bg pink]
    .p add [frame .f -width 20 -height 20 -background pink]
    .p sash place 0 2 0
} -cleanup {
	deleteWindows
} -returnCodes error -result {invalid sash index}


test panedwindow-11.1 {moving sash changes size of pane to left} -setup {
955
956
957
958
959
960
961
962

963
964
965
966
967
968
969
955
956
957
958
959
960
961

962
963
964
965
966
967
968
969







-
+







	deleteWindows
} -result [list 2 2 2 18 2 34]
test panedwindow-12.3 {horizontal panedwindow lays out widgets properly} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    foreach {win color} {.p.f blue .p.f2 green} {
	    .p add [frame $win -width 20 -height 20 -bg $color] -padx 10 -pady 5 \
	    .p add [frame $win -width 20 -height 20 -background $color] -padx 10 -pady 5 \
            -sticky ""
    }
    pack .p
    update
    set result [list [winfo reqwidth .p] [winfo reqheight .p]]
    foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]}
    .p paneconfigure .p.f -padx 0 -pady 0
1316
1317
1318
1319
1320
1321
1322
1323

1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334

1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345

1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356

1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367

1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378

1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389

1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400

1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411

1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422

1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433

1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444

1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455

1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466

1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477

1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488

1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501

1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516

1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537

1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553

1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573

1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593

1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609

1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624

1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640

1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656

1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673

1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691

1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712

1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728

1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744

1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759

1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775

1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791

1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808

1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829

1830
1831
1832
1833
1834
1835
1836
1316
1317
1318
1319
1320
1321
1322

1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333

1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344

1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355

1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366

1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377

1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388

1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399

1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410

1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421

1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432

1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443

1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454

1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465

1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476

1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487

1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500

1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515

1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536

1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552

1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572

1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592

1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608

1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623

1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639

1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655

1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672

1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690

1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711

1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727

1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743

1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758

1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774

1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790

1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807

1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828

1829
1830
1831
1832
1833
1834
1835
1836







-
+










-
+










-
+










-
+










-
+










-
+










-
+










-
+










-
+










-
+










-
+










-
+










-
+










-
+










-
+










-
+












-
+














-
+




















-
+















-
+



















-
+



















-
+















-
+














-
+















-
+















-
+
















-
+

















-
+




















-
+















-
+















-
+














-
+















-
+















-
+
















-
+




















-
+







} -result {}


test panedwindow-15.1 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky {}
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky {}
    place .p -width 40 -height 40
    update
    list {} [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {{} 10 10 20 20}
test panedwindow-15.2 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky n
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky n
    place .p -width 40 -height 40
    update
    list n [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {n 10 0 20 20}
test panedwindow-15.3 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky s
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky s
    place .p -width 40 -height 40
    update
    list s [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {s 10 20 20 20}
test panedwindow-15.4 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky e
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky e
    place .p -width 40 -height 40
    update
    list e [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {e 20 10 20 20}
test panedwindow-15.5 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky w
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky w
    place .p -width 40 -height 40
    update
    list w [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {w 0 10 20 20}
test panedwindow-15.6 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky ns
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky ns
    place .p -width 40 -height 40
    update
    list ns [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {ns 10 0 20 40}
test panedwindow-15.7 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky ew
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky ew
    place .p -width 40 -height 40
    update
    list ew [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {ew 0 10 40 20}
test panedwindow-15.8 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky nw
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky nw
    place .p -width 40 -height 40
    update
    list nw [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {nw 0 0 20 20}
test panedwindow-15.9 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky ne
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky ne
    place .p -width 40 -height 40
    update
    list ne [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {ne 20 0 20 20}
test panedwindow-15.10 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky se
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky se
    place .p -width 40 -height 40
    update
    list se [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {se 20 20 20 20}
test panedwindow-15.11 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky sw
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky sw
    place .p -width 40 -height 40
    update
    list sw [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {sw 0 20 20 20}
test panedwindow-15.12 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky nse
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky nse
    place .p -width 40 -height 40
    update
    list nse [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {nse 20 0 20 40}
test panedwindow-15.13 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky nsw
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky nsw
    place .p -width 40 -height 40
    update
    list nsw [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {nsw 0 0 20 40}
test panedwindow-15.14 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky sew
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky sew
    place .p -width 40 -height 40
    update
    list sew [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {sew 0 20 40 20}
test panedwindow-15.15 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky new
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky new
    place .p -width 40 -height 40
    update
    list new [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {new 0 0 40 20}
test panedwindow-15.16 {panedwindow sticky works} -setup {
    deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    .p add [frame .p.f -height 20 -width 20 -bg red] -sticky news
    .p add [frame .p.f -height 20 -width 20 -background red] -sticky news
    place .p -width 40 -height 40
    update
    list news [winfo x .p.f] [winfo y .p.f]  [winfo width .p.f] [winfo height .p.f]
} -cleanup {
    deleteWindows
} -result {news 0 0 40 40}


test panedwindow-16.1 {setting minsize when pane is too small snaps width} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .p.f -height 20 -width 20 -bg red]
    .p add [frame .p.f -height 20 -width 20 -background red]
    set result [winfo reqwidth .p]
    .p paneconfigure .p.f -minsize 40
    lappend result [winfo reqwidth .p]
} -cleanup {
	deleteWindows
} -result [list 20 40]


test panedwindow-17.1 {MoveSash, move right} -setup {
	deleteWindows
    set result {}
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    # Get the requested width of the paned window
    lappend result [winfo reqwidth .p]

    .p sash place 0 30 0

    # Get the reqwidth again, to make sure it hasn't changed
    lappend result [winfo reqwidth .p]

    # Check that the sash moved
    lappend result [.p sash coord 0]
} -cleanup {
	deleteWindows
} -result [list 42 42 {30 0}]
test panedwindow-17.2 {MoveSash, move right (unmapped) clipped by reqwidth} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    .p sash place 0 100 0

    # Get the new sash coord; it should be clipped by the reqwidth of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 40 0]
test panedwindow-17.3 {MoveSash, move right (mapped, width < reqwidth) clipped by width} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    # Put the panedwindow up on the display and give it a width < reqwidth
    place .p -x 0 -y 0 -width 32
    update

    .p sash place 0 100 0

    # Get the new sash coord; it should be clipped by the visible width of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 30 0]
test panedwindow-17.4 {MoveSash, move right (mapped, width > reqwidth) clipped by width} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    # Put the panedwindow up on the display and give it a width > reqwidth
    place .p -x 0 -y 0 -width 102
    update

    .p sash place 0 200 0

    # Get the new sash coord; it should be clipped by the visible width of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 100 0]
test panedwindow-17.5 {MoveSash, move right respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew -minsize 10
    }

    .p sash place 0 100 0

    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 30 0]
test panedwindow-17.6 {MoveSash, move right respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew -minsize 10
    }

    .p sash place 0 100 0

    # Get the new sash coord; it should have moved as far as possible.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 40 0]
test panedwindow-17.7 {MoveSash, move right pushes other sashes} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    .p sash place 0 100 0

    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 62 0]
test panedwindow-17.8 {MoveSash, move right pushes other sashes, respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew -minsize 10
    }

    .p sash place 0 100 0

    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 52 0]
test panedwindow-17.9 {MoveSash, move right respects minsize, exludes pad} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
	    .p add [frame $w -height 20 -width 20 -background $c] \
		    -sticky nsew -minsize 10 -padx 5
    }

    .p sash place 0 100 0

    # Get the new sash coord; it should have moved as far as possible,
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 50 0]
test panedwindow-17.10 {MoveSash, move right, negative minsize becomes 0} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
	    .p add [frame $w -height 20 -width 20 -background $c] \
		    -sticky nsew -minsize -50
    }

    .p sash place 0 50 0

    # Get the new sash coord; it should have moved as far as possible,
    # respecting minsizes.
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
	deleteWindows
} -result [list [list 50 0] [list 52 0]]
test panedwindow-17.11 {MoveSash, move left} -setup {
	deleteWindows
} -body {
    set result {}
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    # Get the requested width of the paned window
    lappend result [winfo reqwidth .p]

    .p sash place 0 10 0

    # Get the reqwidth again, to make sure it hasn't changed
    lappend result [winfo reqwidth .p]

    # Check that the sash moved
    lappend result [.p sash coord 0]
} -cleanup {
	deleteWindows
} -result [list 42 42 {10 0}]
test panedwindow-17.12 {MoveSash, move left, can't move outside of window} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    .p sash place 0 -100 0

    # Get the new sash coord; it should be clipped by the reqwidth of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 0]
test panedwindow-17.13 {MoveSash, move left respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew -minsize 10
    }

    .p sash place 0 0 0

    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 10 0]
test panedwindow-17.14 {MoveSash, move left respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew -minsize 10
    }

    .p sash place 1 0 0

    # Get the new sash coord; it should have moved as far as possible.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 22 0]
test panedwindow-17.15 {MoveSash, move left pushes other sashes} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    .p sash place 1 0 0

    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 0]
test panedwindow-17.16 {MoveSash, move left pushes other sashes, respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew -minsize 10
    }

    .p sash place 1 0 0

    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 10 0]
test panedwindow-17.17 {MoveSash, move left respects minsize, exludes pad} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
	    .p add [frame $w -height 20 -width 20 -background $c] \
		    -sticky nsew -minsize 10 -padx 5
    }

    .p sash place 1 0 0

    # Get the new sash coord; it should have moved as far as possible,
    # respecting minsizes.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 42 0]
test panedwindow-17.18 {MoveSash, move left, negative minsize becomes 0} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    foreach w {.f1 .f2 .f3} c {red blue green} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
	    .p add [frame $w -height 20 -width 20 -background $c] \
		    -sticky nsew -minsize -50
    }

    .p sash place 1 10 0

    # Get the new sash coord; it should have moved as far as possible,
    # respecting minsizes.
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
	deleteWindows
} -result [list [list 8 0] [list 10 0]]


test panedwindow-18.1 {MoveSash, move down} -setup {
	deleteWindows
} -body {
    set result {}
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    # Get the requested width of the paned window
    lappend result [winfo reqheight .p]

    .p sash place 0 0 30

1844
1845
1846
1847
1848
1849
1850
1851

1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868

1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889

1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910

1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927

1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944

1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961

1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978

1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996

1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015

2016
2017
2018
2019
2020
2021
2022
1844
1845
1846
1847
1848
1849
1850

1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867

1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888

1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909

1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926

1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943

1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960

1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977

1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995

1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014

2015
2016
2017
2018
2019
2020
2021
2022







-
+
















-
+




















-
+




















-
+
















-
+
















-
+
















-
+
















-
+

















-
+


















-
+







} -result [list 42 42 {0 30}]
test panedwindow-18.2 {MoveSash, move down (unmapped) clipped by reqheight} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    .p sash place 0 0 100

    # Get the new sash coord; it should be clipped by the reqheight of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 40]
test panedwindow-18.3 {MoveSash, move down (mapped, height < reqheight) clipped by height} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    # Put the panedwindow up on the display and give it a height < reqheight
    place .p -x 0 -y 0 -height 32
    update

    .p sash place 0 0 100

    # Get the new sash coord; it should be clipped by the visible height of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 30]
test panedwindow-18.4 {MoveSash, move down (mapped, height > reqheight) clipped by height} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    # Put the panedwindow up on the display and give it a width > reqwidth
    place .p -x 0 -y 0 -height 102
    update

    .p sash place 0 0 200

    # Get the new sash coord; it should be clipped by the visible width of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 100]
test panedwindow-18.5 {MoveSash, move down respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew -minsize 10
    }

    .p sash place 0 0 100

    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 30]
test panedwindow-18.6 {MoveSash, move down respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew -minsize 10
    }

    .p sash place 0 0 100

    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 40]
test panedwindow-18.7 {MoveSash, move down pushes other sashes} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    .p sash place 0 0 100

    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 0 62]
test panedwindow-18.8 {MoveSash, move down pushes other sashes, respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew -minsize 10
    }

    .p sash place 0 0 100

    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 0 52]
test panedwindow-18.9 {MoveSash, move down respects minsize, exludes pad} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
	    .p add [frame $w -height 20 -width 20 -background $c] \
		    -sticky nsew -minsize 10 -pady 5
    }

    .p sash place 0 0 100

    # Get the new sash coord; it should have moved as far as possible,
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 50]
test panedwindow-18.10 {MoveSash, move right, negative minsize becomes 0} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
	    .p add [frame $w -height 20 -width 20 -background $c] \
		    -sticky nsew -minsize -50
    }

    .p sash place 0 0 50

    # Get the new sash coord; it should have moved as far as possible,
    # respecting minsizes.
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
	deleteWindows
} -result [list [list 0 50] [list 0 52]]
test panedwindow-18.11 {MoveSash, move up} -setup {
	deleteWindows
} -body {
    set result {}
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    # Get the requested width of the paned window
    lappend result [winfo reqheight .p]

    .p sash place 0 0 10

2030
2031
2032
2033
2034
2035
2036
2037

2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054

2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071

2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087

2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104

2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121

2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139

2140
2141
2142
2143
2144
2145
2146
2030
2031
2032
2033
2034
2035
2036

2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053

2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070

2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086

2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103

2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120

2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138

2139
2140
2141
2142
2143
2144
2145
2146







-
+
















-
+
















-
+















-
+
















-
+
















-
+

















-
+







} -result [list 42 42 {0 10}]
test panedwindow-18.12 {MoveSash, move up, can't move outside of window} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    .p sash place 0 0 -100

    # Get the new sash coord; it should be clipped by the reqwidth of
    # the panedwindow.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 0]
test panedwindow-18.13 {MoveSash, move up respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew -minsize 10
    }

    .p sash place 0 0 0

    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 10]
test panedwindow-18.14 {MoveSash, move up respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew -minsize 10
    }

    .p sash place 1 0 0

    # Get the new sash coord; it should have moved as far as possible.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 0 22]
test panedwindow-18.15 {MoveSash, move up pushes other sashes} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew
    }

    .p sash place 1 0 0

    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 0]
test panedwindow-18.16 {MoveSash, move up pushes other sashes, respects minsize} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
	    .p add [frame $w -height 20 -width 20 -background $c] -sticky nsew -minsize 10
    }

    .p sash place 1 0 0

    # Get the new sash coord; it should have moved as far as possible while
    # respecting minsizes.
    .p sash coord 0
} -cleanup {
	deleteWindows
} -result [list 0 10]
test panedwindow-18.17 {MoveSash, move up respects minsize, exludes pad} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
	    .p add [frame $w -height 20 -width 20 -background $c] \
		    -sticky nsew -minsize 10 -pady 5
    }

    .p sash place 1 0 0

    # Get the new sash coord; it should have moved as far as possible,
    # respecting minsizes.
    .p sash coord 1
} -cleanup {
	deleteWindows
} -result [list 0 42]
test panedwindow-18.18 {MoveSash, move up, negative minsize becomes 0} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    foreach w {.f1 .f2 .f3} c {red blue green} {
	    .p add [frame $w -height 20 -width 20 -bg $c] \
	    .p add [frame $w -height 20 -width 20 -background $c] \
		    -sticky nsew -minsize -50
    }

    .p sash place 1 0 10

    # Get the new sash coord; it should have moved as far as possible,
    # respecting minsizes.
2155
2156
2157
2158
2159
2160
2161
2162

2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176

2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190

2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205

2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220

2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235

2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252

2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264

2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277

2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291

2292
2293
2294
2295
2296
2297
2298
2155
2156
2157
2158
2159
2160
2161

2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175

2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189

2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204

2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219

2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234

2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251

2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263

2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276

2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290

2291
2292
2293
2294
2295
2296
2297
2298







-
+













-
+













-
+














-
+














-
+














-
+
















-
+











-
+












-
+













-
+







# geometry.

test panedwindow-19.1 {ComputeGeometry, reqheight taken from widgets} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    foreach w {.f1 .f2 .f3} {
	    .p add [frame $w -width 20 -height 20 -bg blue]
	    .p add [frame $w -width 20 -height 20 -background blue]
    }
    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
    .f3 configure -height 40
    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
	deleteWindows
} -result [list [list 60 20] [list 60 40]]

test panedwindow-19.2 {ComputeGeometry, reqheight taken from widgets} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    foreach w {.f1 .f2 .f3} {
	    .p add [frame $w -width 20 -height 20 -bg blue]
	    .p add [frame $w -width 20 -height 20 -background blue]
    }
    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
    .p paneconfigure .f3 -height 40
    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
	deleteWindows
} -result [list [list 60 20] [list 60 40]]

test panedwindow-19.3 {ComputeGeometry, reqheight taken from widgets} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
    foreach w {.f1 .f2 .f3} {
	    .p add [frame $w -width 20 -height 20 -bg blue] -pady 20
	    .p add [frame $w -width 20 -height 20 -background blue] -pady 20
    }
    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
    .p paneconfigure .f3 -height 40
    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
	deleteWindows
} -result [list [list 60 60] [list 60 80]]

test panedwindow-19.4 {ComputeGeometry, reqwidth taken from widgets} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
            -orient vertical
    foreach w {.f1 .f2 .f3} {
	.p add [frame $w -width 20 -height 20 -bg blue]
	.p add [frame $w -width 20 -height 20 -background blue]
    }
    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
    .f3 configure -width 40
    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
	deleteWindows
} -result [list [list 20 60] [list 40 60]]

test panedwindow-19.5 {ComputeGeometry, reqwidth taken from widgets} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
            -orient vertical
    foreach w {.f1 .f2 .f3} {
	.p add [frame $w -width 20 -height 20 -bg blue]
	.p add [frame $w -width 20 -height 20 -background blue]
    }
    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
    .p paneconfigure .f3 -width 40
    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
	deleteWindows
} -result [list [list 20 60] [list 40 60]]

test panedwindow-19.6 {ComputeGeometry, reqwidth taken from widgets} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
            -orient vertical
    foreach w {.f1 .f2 .f3} {
	.p add [frame $w -width 20 -height 20 -bg blue] -padx 20
	.p add [frame $w -width 20 -height 20 -background blue] -padx 20
    }
    set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
    .p paneconfigure .f3 -width 40
    lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
	deleteWindows
} -result [list [list 60 60] [list 80 60]]

test panedwindow-19.7 {ComputeGeometry, one pane, reqsize set properly} -setup {
    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.8 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {60 20}

test panedwindow-19.9 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{20 0} {40 0}}

test panedwindow-19.10 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
2308
2309
2310
2311
2312
2313
2314
2315

2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329

2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344

2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359

2360
2361
2362
2363
2364
2365
2366
2308
2309
2310
2311
2312
2313
2314

2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328

2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343

2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358

2359
2360
2361
2362
2363
2364
2365
2366







-
+













-
+














-
+














-
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.12 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 60}

test panedwindow-19.13 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 20} {0 40}}

test panedwindow-19.14 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
2374
2375
2376
2377
2378
2379
2380
2381

2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393

2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406

2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420

2421
2422
2423
2424
2425
2426
2427
2374
2375
2376
2377
2378
2379
2380

2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392

2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405

2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419

2420
2421
2422
2423
2424
2425
2426
2427







-
+











-
+












-
+













-
+







    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {22 20}

test panedwindow-19.16 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {72 20}

test panedwindow-19.17 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{23 0} {49 0}}

test panedwindow-19.18 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
2437
2438
2439
2440
2441
2442
2443
2444

2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458

2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473

2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488

2489
2490
2491
2492
2493
2494
2495
2437
2438
2439
2440
2441
2442
2443

2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457

2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472

2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487

2488
2489
2490
2491
2492
2493
2494
2495







-
+













-
+














-
+














-
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 22}

test panedwindow-19.20 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 72}

test panedwindow-19.21 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 23} {0 49}}

test panedwindow-19.22 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
2503
2504
2505
2506
2507
2508
2509
2510

2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522

2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535

2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549

2550
2551
2552
2553
2554
2555
2556
2503
2504
2505
2506
2507
2508
2509

2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521

2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534

2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548

2549
2550
2551
2552
2553
2554
2555
2556







-
+











-
+












-
+













-
+







    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.24 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {66 20}

test panedwindow-19.25 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{20 0} {43 0}}

test panedwindow-19.26 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
2566
2567
2568
2569
2570
2571
2572
2573

2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587

2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602

2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617

2618
2619
2620
2621
2622
2623
2624
2566
2567
2568
2569
2570
2571
2572

2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586

2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601

2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616

2617
2618
2619
2620
2621
2622
2623
2624







-
+













-
+














-
+














-
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.28 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 66}

test panedwindow-19.29 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 20} {0 43}}

test panedwindow-19.30 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
2632
2633
2634
2635
2636
2637
2638
2639

2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651

2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664

2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678

2679
2680
2681
2682
2683
2684
2685
2632
2633
2634
2635
2636
2637
2638

2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650

2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663

2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677

2678
2679
2680
2681
2682
2683
2684
2685







-
+











-
+












-
+













-
+







    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {22 20}

test panedwindow-19.32 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {72 20}

test panedwindow-19.33 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{21 0} {47 0}}

test panedwindow-19.34 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
2695
2696
2697
2698
2699
2700
2701
2702

2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716

2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731

2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746

2747
2748
2749
2750
2751
2752
2753
2695
2696
2697
2698
2699
2700
2701

2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715

2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730

2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745

2746
2747
2748
2749
2750
2751
2752
2753







-
+













-
+














-
+














-
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 22}

test panedwindow-19.36 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 72}

test panedwindow-19.37 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 21} {0 47}}

test panedwindow-19.38 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
2761
2762
2763
2764
2765
2766
2767
2768

2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780

2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793

2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807

2808
2809
2810
2811
2812
2813
2814
2761
2762
2763
2764
2765
2766
2767

2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779

2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792

2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806

2807
2808
2809
2810
2811
2812
2813
2814







-
+











-
+












-
+













-
+







    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.40 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {80 20}

test panedwindow-19.41 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{25 0} {55 0}}

test panedwindow-19.42 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
2824
2825
2826
2827
2828
2829
2830
2831

2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845

2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860

2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875

2876
2877
2878
2879
2880
2881
2882
2824
2825
2826
2827
2828
2829
2830

2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844

2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859

2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874

2875
2876
2877
2878
2879
2880
2881
2882







-
+













-
+














-
+














-
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.44 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 80}

test panedwindow-19.45 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 25} {0 55}}

test panedwindow-19.46 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
2890
2891
2892
2893
2894
2895
2896
2897

2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909

2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922

2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936

2937
2938
2939
2940
2941
2942
2943
2890
2891
2892
2893
2894
2895
2896

2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908

2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921

2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935

2936
2937
2938
2939
2940
2941
2942
2943







-
+











-
+












-
+













-
+







    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {22 20}

test panedwindow-19.48 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {92 20}

test panedwindow-19.49 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{28 0} {64 0}}

test panedwindow-19.50 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
2953
2954
2955
2956
2957
2958
2959
2960

2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974

2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989

2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004

3005
3006
3007
3008
3009
3010
3011
2953
2954
2955
2956
2957
2958
2959

2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973

2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988

2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003

3004
3005
3006
3007
3008
3009
3010
3011







-
+













-
+














-
+














-
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 22}

test panedwindow-19.52 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 92}

test panedwindow-19.53 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 28} {0 64}}

test panedwindow-19.54 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3019
3020
3021
3022
3023
3024
3025
3026

3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038

3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051

3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065

3066
3067
3068
3069
3070
3071
3072
3019
3020
3021
3022
3023
3024
3025

3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037

3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050

3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064

3065
3066
3067
3068
3069
3070
3071
3072







-
+











-
+












-
+













-
+







    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.56 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {86 20}

test panedwindow-19.57 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{25 0} {58 0}}

test panedwindow-19.58 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3082
3083
3084
3085
3086
3087
3088
3089

3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103

3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118

3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133

3134
3135
3136
3137
3138
3139
3140
3082
3083
3084
3085
3086
3087
3088

3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102

3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117

3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132

3133
3134
3135
3136
3137
3138
3139
3140







-
+













-
+














-
+














-
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 20}

test panedwindow-19.60 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 86}

test panedwindow-19.61 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 25} {0 58}}

test panedwindow-19.62 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3148
3149
3150
3151
3152
3153
3154
3155

3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167

3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180

3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194

3195
3196
3197
3198
3199
3200
3201
3148
3149
3150
3151
3152
3153
3154

3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166

3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179

3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193

3194
3195
3196
3197
3198
3199
3200
3201







-
+











-
+












-
+













-
+







    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {22 20}

test panedwindow-19.64 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {92 20}

test panedwindow-19.65 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{26 0} {62 0}}

test panedwindow-19.66 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3211
3212
3213
3214
3215
3216
3217
3218

3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232

3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247

3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262

3263
3264
3265
3266
3267
3268
3269
3211
3212
3213
3214
3215
3216
3217

3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231

3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246

3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261

3262
3263
3264
3265
3266
3267
3268
3269







-
+













-
+














-
+














-
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 22}

test panedwindow-19.68 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {20 92}

test panedwindow-19.69 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{0 26} {0 62}}

test panedwindow-19.70 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3277
3278
3279
3280
3281
3282
3283
3284

3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296

3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309

3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323

3324
3325
3326
3327
3328
3329
3330
3277
3278
3279
3280
3281
3282
3283

3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295

3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308

3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322

3323
3324
3325
3326
3327
3328
3329
3330







-
+











-
+












-
+













-
+







    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.72 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {64 24}

test panedwindow-19.73 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{22 2} {42 2}}

test panedwindow-19.74 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3340
3341
3342
3343
3344
3345
3346
3347

3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361

3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376

3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391

3392
3393
3394
3395
3396
3397
3398
3340
3341
3342
3343
3344
3345
3346

3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360

3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375

3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390

3391
3392
3393
3394
3395
3396
3397
3398







-
+













-
+














-
+














-
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.76 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 64}

test panedwindow-19.77 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 22} {2 42}}

test panedwindow-19.78 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3406
3407
3408
3409
3410
3411
3412
3413

3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425

3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438

3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452

3453
3454
3455
3456
3457
3458
3459
3406
3407
3408
3409
3410
3411
3412

3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424

3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437

3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451

3452
3453
3454
3455
3456
3457
3458
3459







-
+











-
+












-
+













-
+







    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {26 24}

test panedwindow-19.80 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {76 24}

test panedwindow-19.81 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{25 2} {51 2}}

test panedwindow-19.82 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3469
3470
3471
3472
3473
3474
3475
3476

3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490

3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505

3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520

3521
3522
3523
3524
3525
3526
3527
3469
3470
3471
3472
3473
3474
3475

3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489

3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504

3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519

3520
3521
3522
3523
3524
3525
3526
3527







-
+













-
+














-
+














-
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 26}

test panedwindow-19.84 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 76}

test panedwindow-19.85 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 25} {2 51}}

test panedwindow-19.86 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3535
3536
3537
3538
3539
3540
3541
3542

3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554

3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567

3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581

3582
3583
3584
3585
3586
3587
3588
3535
3536
3537
3538
3539
3540
3541

3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553

3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566

3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580

3581
3582
3583
3584
3585
3586
3587
3588







-
+











-
+












-
+













-
+







    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.88 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {70 24}

test panedwindow-19.89 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{22 2} {45 2}}

test panedwindow-19.90 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3598
3599
3600
3601
3602
3603
3604
3605

3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619

3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634

3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649

3650
3651
3652
3653
3654
3655
3656
3598
3599
3600
3601
3602
3603
3604

3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618

3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633

3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648

3649
3650
3651
3652
3653
3654
3655
3656







-
+













-
+














-
+














-
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.92 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 70}

test panedwindow-19.93 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 22} {2 45}}

test panedwindow-19.94 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3664
3665
3666
3667
3668
3669
3670
3671

3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683

3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696

3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710

3711
3712
3713
3714
3715
3716
3717
3664
3665
3666
3667
3668
3669
3670

3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682

3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695

3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709

3710
3711
3712
3713
3714
3715
3716
3717







-
+











-
+












-
+













-
+







    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {26 24}

test panedwindow-19.96 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {76 24}

test panedwindow-19.97 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{23 2} {49 2}}

test panedwindow-19.98 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3727
3728
3729
3730
3731
3732
3733
3734

3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748

3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763

3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778

3779
3780
3781
3782
3783
3784
3785
3727
3728
3729
3730
3731
3732
3733

3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747

3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762

3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777

3778
3779
3780
3781
3782
3783
3784
3785







-
+













-
+














-
+














-
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 26}

test panedwindow-19.100 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 76}

test panedwindow-19.101 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 23} {2 49}}

test panedwindow-19.102 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 0 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3793
3794
3795
3796
3797
3798
3799
3800

3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812

3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825

3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839

3840
3841
3842
3843
3844
3845
3846
3793
3794
3795
3796
3797
3798
3799

3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811

3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824

3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838

3839
3840
3841
3842
3843
3844
3845
3846







-
+











-
+












-
+













-
+







    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.104 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {84 24}

test panedwindow-19.105 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{27 2} {57 2}}

test panedwindow-19.106 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3856
3857
3858
3859
3860
3861
3862
3863

3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877

3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892

3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907

3908
3909
3910
3911
3912
3913
3914
3856
3857
3858
3859
3860
3861
3862

3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876

3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891

3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906

3907
3908
3909
3910
3911
3912
3913
3914







-
+













-
+














-
+














-
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.108 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 84}

test panedwindow-19.109 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 27} {2 57}}

test panedwindow-19.110 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3922
3923
3924
3925
3926
3927
3928
3929

3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941

3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954

3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968

3969
3970
3971
3972
3973
3974
3975
3922
3923
3924
3925
3926
3927
3928

3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940

3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953

3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967

3968
3969
3970
3971
3972
3973
3974
3975







-
+











-
+












-
+













-
+







    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {26 24}

test panedwindow-19.112 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {96 24}

test panedwindow-19.113 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{30 2} {66 2}}

test panedwindow-19.114 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
3985
3986
3987
3988
3989
3990
3991
3992

3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006

4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021

4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036

4037
4038
4039
4040
4041
4042
4043
3985
3986
3987
3988
3989
3990
3991

3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005

4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020

4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035

4036
4037
4038
4039
4040
4041
4042
4043







-
+













-
+














-
+














-
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -orient vertical -sashwidth 0 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 26}

test panedwindow-19.116 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 96}

test panedwindow-19.117 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 30} {2 66}}

test panedwindow-19.118 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 0 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
4051
4052
4053
4054
4055
4056
4057
4058

4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070

4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083

4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097

4098
4099
4100
4101
4102
4103
4104
4051
4052
4053
4054
4055
4056
4057

4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069

4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082

4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096

4097
4098
4099
4100
4101
4102
4103
4104







-
+











-
+












-
+













-
+







    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 0 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 0 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.120 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {90 24}

test panedwindow-19.121 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{27 2} {60 2}}

test panedwindow-19.122 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
4114
4115
4116
4117
4118
4119
4120
4121

4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135

4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150

4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165

4166
4167
4168
4169
4170
4171
4172
4114
4115
4116
4117
4118
4119
4120

4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134

4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149

4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164

4165
4166
4167
4168
4169
4170
4171
4172







-
+













-
+














-
+














-
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 0
    .p add [frame .f -width 20 -height 20 -bg red] -pady 0 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 0 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 24}

test panedwindow-19.124 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 90}

test panedwindow-19.125 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 27} {2 60}}

test panedwindow-19.126 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 0 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
4180
4181
4182
4183
4184
4185
4186
4187

4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199

4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212

4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226

4227
4228
4229
4230
4231
4232
4233
4180
4181
4182
4183
4184
4185
4186

4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198

4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211

4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225

4226
4227
4228
4229
4230
4231
4232
4233







-
+











-
+












-
+













-
+







    deleteWindows
} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    .p add [frame .p.f -width 20 -height 20 -bg red] -padx 1 -sticky ""
    .p add [frame .p.f -width 20 -height 20 -background red] -padx 1 -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {26 24}

test panedwindow-19.128 {ComputeGeometry, three panes, reqsize set properly} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] -sticky ""
        .p add [frame $w -width 20 -height 20 -background blue] -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {96 24}

test panedwindow-19.129 {ComputeGeometry, sash coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{28 2} {64 2}}

test panedwindow-19.130 {ComputeGeometry/ArrangePanes, pane coords} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 3 -padx 11
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
4243
4244
4245
4246
4247
4248
4249
4250

4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264

4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279

4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294

4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314

4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325


4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338


4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351


4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363


4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376


4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390


4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403


4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416


4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428


4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443


4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458


4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473


4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486


4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497

4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510

4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524


4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546


4547
4548
4549
4550
4551
4552
4553
4243
4244
4245
4246
4247
4248
4249

4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263

4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278

4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293

4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313

4314
4315
4316
4317
4318
4319
4320
4321
4322
4323


4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336


4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349


4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361


4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374


4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388


4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401


4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414


4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426


4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441


4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456


4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471


4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484


4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496

4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509

4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522


4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544


4545
4546
4547
4548
4549
4550
4551
4552
4553







-
+













-
+














-
+














-
+



















-
+









-
-
+
+











-
-
+
+











-
-
+
+










-
-
+
+











-
-
+
+












-
-
+
+











-
-
+
+











-
-
+
+










-
-
+
+













-
-
+
+













-
-
+
+













-
-
+
+











-
-
+
+










-
+












-
+












-
-
+
+




















-
-
+
+







} -body {
    # With just one pane, sashpad and sashwidth should not
    # affect the panedwindow's geometry, since no sash should
    # ever be drawn.
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -orient vertical -sashwidth 3 -handlesize 6 \
        -showhandle 1
    .p add [frame .f -width 20 -height 20 -bg red] -pady 1 \
    .p add [frame .f -width 20 -height 20 -background red] -pady 1 \
                    -sticky ""
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 26}

test panedwindow-19.132 {ComputeGeometry, three panes, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {24 96}

test panedwindow-19.133 {ComputeGeometry, sash coords, vertical} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.f1 .f2 .f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
                            -sticky ""
    }
    list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
    deleteWindows
} -result {{2 28} {2 64}}

test panedwindow-19.134 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup {
    deleteWindows
} -body {
    panedwindow .p -borderwidth 2 -sashpad 5 \
        -sashwidth 3 -handlesize 6 -showhandle 1 \
        -orient vertical
    foreach w {.p.f1 .p.f2 .p.f3} {
        .p add [frame $w -width 20 -height 20 -bg blue] \
        .p add [frame $w -width 20 -height 20 -background blue] \
            -sticky nsew -pady 11 -padx 3
    }
    pack .p
    update
    set result {}
    foreach w {.p.f1 .p.f2 .p.f3} {
        lappend result [list [winfo x $w] [winfo y $w] \
            [winfo width $w] [winfo height $w]]
        }
    return $result
} -cleanup {
    deleteWindows
} -result {{5 13 20 20} {5 71 20 20} {5 129 20 20}}


test panedwindow-20.1 {destroyed widgets are removed from panedwindow} -setup {
	deleteWindows
} -body {
    panedwindow .p
    .p add [frame .f -width 20 -height 20 -bg blue]
    .p add [frame .f -width 20 -height 20 -background blue]
    destroy .f
    .p panes
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-20.2 {destroyed pane causes geometry recomputation} -setup {
	deleteWindows
} -body {
    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .f -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red]
    .p add [frame .f -width 20 -height 20 -background blue] \
	    [frame .f2 -width 20 -height 20 -background red]
    destroy .f
    winfo reqwidth .p
} -cleanup {
    deleteWindows
} -result 20


test panedwindow-21.1 {ArrangePanes, extra space is given to the last pane} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
    .p add [frame .f1 -width 20 -height 20 -background blue] \
	    [frame .f2 -width 20 -height 20 -background red] -sticky nsew
    place .p -width 100 -x 0 -y 0
    update
    winfo width .f2
} -cleanup {
    deleteWindows
} -result 78
test panedwindow-21.2 {ArrangePanes, extra space is given to the last pane} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
    .p add [frame .f1 -width 20 -height 20 -background blue] \
	    [frame .f2 -width 20 -height 20 -background red] -sticky nsew
    place .p -height 100 -x 0 -y 0
    update
    winfo height .f2
} -cleanup {
    deleteWindows
} -result 78
test panedwindow-21.3 {ArrangePanes, explicit height/width are preferred} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red] -sticky ""
    .p add [frame .f1 -width 20 -height 20 -background blue] \
	    [frame .f2 -width 20 -height 20 -background red] -sticky ""
    .p paneconfigure .f1 -width 10 -height 15
    pack .p
    update
    list [winfo width .f1] [winfo height .f1]
} -cleanup {
	deleteWindows
} -result {10 15}
test panedwindow-21.4 {ArrangePanes, panes clipped by size of pane} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red]
    .p add [frame .f1 -width 20 -height 20 -background blue] \
	    [frame .f2 -width 20 -height 20 -background red]
    .p sash place 0 10 0
    pack .p
    update
    list [winfo width .f1] [winfo height .f1]
} -cleanup {
	deleteWindows
} -result {10 20}
test panedwindow-21.5 {ArrangePanes, panes clipped by size of pane} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red]
    .p add [frame .f1 -width 20 -height 20 -background blue] \
	    [frame .f2 -width 20 -height 20 -background red]
    .p sash place 0 0 10
    pack .p
    update
    list [winfo width .f1] [winfo height .f1]
} -cleanup {
	deleteWindows
} -result {20 10}
test panedwindow-21.6 {ArrangePanes, height of pane taken from total height} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
	    [frame .p.f2 -width 20 -height 40 -bg red] -sticky ""
    .p add [frame .p.f1 -width 20 -height 20 -background blue] \
	    [frame .p.f2 -width 20 -height 40 -background red] -sticky ""
    pack .p
    update
    winfo y .p.f1
} -cleanup {
    deleteWindows
} -result 10
test panedwindow-21.7 {ArrangePanes, width of pane taken from total width} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
	    [frame .p.f2 -width 40 -height 40 -bg red] -sticky ""
    .p add [frame .p.f1 -width 20 -height 20 -background blue] \
	    [frame .p.f2 -width 40 -height 40 -background red] -sticky ""
    pack .p
    update
    winfo x .p.f1
} -cleanup {
    deleteWindows
} -result 10
test panedwindow-21.8 {ArrangePanes, panes with width <= 0 are unmapped} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 40 -bg red]
    .p add [frame .f1 -width 20 -height 20 -background blue] \
	    [frame .f2 -width 20 -height 40 -background red]
    pack .p
    update
    set result [winfo ismapped .f1]
    .p sash place 0 0 0
    update
    lappend result [winfo ismapped .f1]
} -cleanup {
	deleteWindows
} -result {1 0}
test panedwindow-21.9 {ArrangePanes, panes with width <= 0 are unmapped} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
	    [frame .p.f2 -width 20 -height 40 -bg red]
    .p add [frame .p.f1 -width 20 -height 20 -background blue] \
	    [frame .p.f2 -width 20 -height 40 -background red]
    pack .p
    update
    set result [winfo ismapped .p.f1]
    .p sash place 0 0 0
    update
    lappend result [winfo ismapped .p.f1]
} -cleanup {
	deleteWindows
} -result {1 0}
test panedwindow-21.10 {ArrangePanes, panes with width <= 0 are unmapped} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 -orient vertical
    .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
	    [frame .p.f2 -width 20 -height 40 -bg red]
    .p add [frame .p.f1 -width 20 -height 20 -background blue] \
	    [frame .p.f2 -width 20 -height 40 -background red]
    pack .p
    update
    set result [winfo ismapped .p.f1]
    .p sash place 0 0 0
    update
    lappend result [winfo ismapped .p.f1]
} -cleanup {
	deleteWindows
} -result {1 0}
test panedwindow-21.11 {ArrangePanes, last pane shrinks} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
    .p add [frame .f1 -width 20 -height 20 -background blue] \
	    [frame .f2 -width 20 -height 20 -background red] -sticky nsew
    place .p -width 40 -x 0 -y 0
    update
    winfo width .f2
} -cleanup {
    deleteWindows
} -result 18
test panedwindow-21.12 {ArrangePanes, last pane shrinks} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
            -orient vertical
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
    .p add [frame .f1 -width 20 -height 20 -background blue] \
	    [frame .f2 -width 20 -height 20 -background red] -sticky nsew
    place .p -height 40 -x 0 -y 0
    update
    winfo height .f2
} -cleanup {
    deleteWindows
} -result 18
test panedwindow-21.13 {ArrangePanes, panedwindow resizes} -setup {
	deleteWindows
} -body {
	panedwindow .p -width 200 -borderwidth 0
	frame .f1 -height 50 -bg blue
	frame .f1 -height 50 -background blue
	set result [list]
	lappend result [winfo reqwidth .p] [winfo reqheight .p]
	.p add .f1
	pack .p
	lappend result [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {200 1 200 50}
test panedwindow-21.14 {ArrangePanes, panedwindow resizes} -setup {
	deleteWindows
} -body {
	panedwindow .p -height 200 -borderwidth 0 -orient vertical
	frame .f1 -width 50 -bg blue
	frame .f1 -width 50 -background blue
	set result [list]
	lappend result [winfo reqwidth .p] [winfo reqheight .p]
	.p add .f1
	pack .p
	lappend result [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
    deleteWindows
} -result {1 200 50 200}
test panedwindow-21.15 {ArrangePanes, last pane grows} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -height 50
	.p add [frame .f1 -width 50 -bg red] [frame .f2 -width 50 -bg white] \
		[frame .f3 -width 50 -bg blue] [frame .f4 -width 50 -bg green]
	.p add [frame .f1 -width 50 -background red] [frame .f2 -width 50 -background white] \
		[frame .f3 -width 50 -background blue] [frame .f4 -width 50 -background green]
	.p sash place 1 250 0
	pack .p
	update
	set result [list]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4] [winfo width .p]
	.p configure -width 300
	update
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4] [winfo width .p]
} -cleanup {
    deleteWindows
} -result {50 150 1 1 211 50 150 1 89 300}


test panedwindow-22.1 {PanedWindowReqProc, react to pane geometry changes} -setup {
	deleteWindows
} -body {
    # Basically just want to make sure that the PanedWindowReqProc is called
    panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 2
    .p add [frame .f1 -width 20 -height 20 -bg blue] \
	    [frame .f2 -width 20 -height 40 -bg red]
    .p add [frame .f1 -width 20 -height 20 -background blue] \
	    [frame .f2 -width 20 -height 40 -background red]
    set result [winfo reqheight .p]
    .f1 configure -height 80
    lappend result [winfo reqheight .p]
} -cleanup {
	deleteWindows
} -result {40 80}
test panedwindow-22.2 {PanedWindowReqProc, react to pane geometry changes} -setup {
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915




4916
4917
4918
4919
4920
4921
4922
4905
4906
4907
4908
4909
4910
4911




4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922







-
-
-
-
+
+
+
+







} -cleanup {
	deleteWindows
} -result {}
test panedwindow-23.29 {ConfigurePanes, -hide works} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false
	frame .f1 -width 40 -height 100 -bg red
	frame .f2 -width 40 -height 100 -bg white
	frame .f3 -width 40 -height 100 -bg blue
	frame .f4 -width 40 -height 100 -bg green
	frame .f1 -width 40 -height 100 -background red
	frame .f2 -width 40 -height 100 -background white
	frame .f3 -width 40 -height 100 -background blue
	frame .f4 -width 40 -height 100 -background green
	.p add .f1 .f2 .f3 .f4
	pack .p
	update
	set result [list]
	lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
		[winfo ismapped .f3] [winfo ismapped .f4]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940




4941
4942
4943
4944
4945
4946
4947
4930
4931
4932
4933
4934
4935
4936




4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947







-
-
-
-
+
+
+
+







} -cleanup {
    deleteWindows
} -result {1 1 1 1 40 40 40 40 171 1 0 1 1 40 40 40 40 128}
test panedwindow-23.30 {ConfigurePanes, -hide works} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -width 130 -height 100
	frame .f1 -width 40 -bg red
	frame .f2 -width 40 -bg white
	frame .f3 -width 40 -bg blue
	frame .f4 -width 40 -bg green
	frame .f1 -width 40 -background red
	frame .f2 -width 40 -background white
	frame .f3 -width 40 -background blue
	frame .f4 -width 40 -background green
	.p add .f1 .f2 .f3 .f4
	pack .p
	update
	set result [list]
	lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
		[winfo ismapped .f3] [winfo ismapped .f4]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996



4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015



5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035




5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056




5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077




5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098




5099
5100
5101
5102
5103
5104
5105
4987
4988
4989
4990
4991
4992
4993



4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012



5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031




5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052




5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073




5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094




5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105







-
-
-
+
+
+
















-
-
-
+
+
+
















-
-
-
-
+
+
+
+

















-
-
-
-
+
+
+
+

















-
-
-
-
+
+
+
+

















-
-
-
-
+
+
+
+







} -cleanup {
    deleteWindows
} -result {{1 1 1 1 1} {1 1 0 1 1} {1 0 0 0 0} {1 1 0 1 1}}
test panedwindow-23.31 {ConfigurePanes, -hide works, last pane stretches} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -width 200 -height 200 -borderwidth 0
	frame .f1 -width 50 -bg red
	frame .f2 -width 50 -bg green
	frame .f3 -width 50 -bg blue
	frame .f1 -width 50 -background red
	frame .f2 -width 50 -background green
	frame .f3 -width 50 -background blue
	.p add .f1 .f2 .f3
	pack .p
	update
	set result [list]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3]
	.p paneconfigure .f2 -hide 1
	update
    lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3]
} -cleanup {
    deleteWindows
} -result {50 50 94 50 50 147}
test panedwindow-23.32 {ConfigurePanes, -hide works, last pane stretches} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -width 200 -height 200 \
		-borderwidth 0 -orient vertical
	frame .f1 -height 50 -bg red
	frame .f2 -height 50 -bg green
	frame .f3 -height 50 -bg blue
	frame .f1 -height 50 -background red
	frame .f2 -height 50 -background green
	frame .f3 -height 50 -background blue
	.p add .f1 .f2 .f3
	pack .p
	update
	set result [list]
	lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3]
	.p paneconfigure .f2 -hide 1
	update
	lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3]
} -cleanup {
    deleteWindows
} -result {50 50 94 50 50 147}

test panedwindow-23.33 {ConfigurePanes, -stretch first} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -height 100 -width 182
	frame .f1 -width 40 -bg red
	frame .f2 -width 40 -bg white
	frame .f3 -width 40 -bg blue
	frame .f4 -width 40 -bg green
	frame .f1 -width 40 -background red
	frame .f2 -width 40 -background white
	frame .f3 -width 40 -background blue
	frame .f4 -width 40 -background green
	.p add .f1 .f2 .f3 .f4 -stretch first
	pack .p
	update
	set result [list]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4]
	.p paneconfigure .f2 -hide 1
	update
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4]
} -cleanup {
    deleteWindows
} -result {51 40 40 40 94 40 40 40}
test panedwindow-23.34 {ConfigurePanes, -stretch middle} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -height 100 -width 182
	frame .f1 -width 40 -bg red
	frame .f2 -width 40 -bg white
	frame .f3 -width 40 -bg blue
	frame .f4 -width 40 -bg green
	frame .f1 -width 40 -background red
	frame .f2 -width 40 -background white
	frame .f3 -width 40 -background blue
	frame .f4 -width 40 -background green
	.p add .f1 .f2 .f3 .f4 -stretch middle
	pack .p
	update
	set result [list]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4]
	.p paneconfigure .f2 -hide 1
	update
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4]
} -cleanup {
    deleteWindows
} -result {40 45 46 40 40 45 94 40}
test panedwindow-23.35 {ConfigurePanes, -stretch always} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -height 100 -width 182
	frame .f1 -width 40 -bg red
	frame .f2 -width 40 -bg white
	frame .f3 -width 40 -bg blue
	frame .f4 -width 40 -bg green
	frame .f1 -width 40 -background red
	frame .f2 -width 40 -background white
	frame .f3 -width 40 -background blue
	frame .f4 -width 40 -background green
	.p add .f1 .f2 .f3 .f4 -stretch always
	pack .p
	update
	set result [list]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4]
	.p paneconfigure .f2 -hide 1
	update
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4]
} -cleanup {
    deleteWindows
} -result {42 43 43 43 58 43 58 58}
test panedwindow-23.36 {ConfigurePanes, -stretch never} -setup {
	deleteWindows
} -body {
	panedwindow .p -showhandle false -height 100 -width 182
	frame .f1 -width 40 -bg red
	frame .f2 -width 40 -bg white
	frame .f3 -width 40 -bg blue
	frame .f4 -width 40 -bg green
	frame .f1 -width 40 -background red
	frame .f2 -width 40 -background white
	frame .f3 -width 40 -background blue
	frame .f4 -width 40 -background green
	.p add .f1 .f2 .f3 .f4 -stretch never
	pack .p
	update
	set result [list]
	lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
		[winfo width .f4]
	.p paneconfigure .f2 -hide 1
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177



5178
5179
5180
5181
5182
5183
5184
5185
5186
5187



5188
5189
5190
5191
5192
5193
5194
5195
5196
5197



5198
5199
5200
5201
5202
5203
5204
5205
5206
5207



5208
5209
5210
5211
5212
5213
5214
5215
5216
5217



5218
5219
5220
5221
5222
5223
5224
5225
5226
5227



5228
5229
5230
5231
5232
5233
5234
5235
5236
5237



5238
5239
5240
5241
5242
5243
5244
5245

5246
5247
5248


5249
5250
5251
5252
5253
5254
5255
5256

5257
5258
5259


5260
5261
5262
5263
5264
5265
5266
5267

5268
5269
5270


5271
5272
5273
5274
5275
5276
5277
5278

5279
5280
5281


5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292




5293
5294
5295
5296
5297
5298
5299
5168
5169
5170
5171
5172
5173
5174



5175
5176
5177
5178
5179
5180
5181
5182
5183
5184



5185
5186
5187
5188
5189
5190
5191
5192
5193
5194



5195
5196
5197
5198
5199
5200
5201
5202
5203
5204



5205
5206
5207
5208
5209
5210
5211
5212
5213
5214



5215
5216
5217
5218
5219
5220
5221
5222
5223
5224



5225
5226
5227
5228
5229
5230
5231
5232
5233
5234



5235
5236
5237
5238
5239
5240
5241
5242
5243
5244

5245
5246


5247
5248
5249
5250
5251
5252
5253
5254
5255

5256
5257


5258
5259
5260
5261
5262
5263
5264
5265
5266

5267
5268


5269
5270
5271
5272
5273
5274
5275
5276
5277

5278
5279


5280
5281
5282
5283
5284
5285
5286
5287
5288




5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299







-
-
-
+
+
+







-
-
-
+
+
+







-
-
-
+
+
+







-
-
-
+
+
+







-
-
-
+
+
+







-
-
-
+
+
+







-
-
-
+
+
+







-
+

-
-
+
+







-
+

-
-
+
+







-
+

-
-
+
+







-
+

-
-
+
+







-
-
-
-
+
+
+
+







	deleteWindows
} -result {1 0 0 1 1}


test panedwindow-26.1 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 0 0
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-26.2 {PanedWindowIdentifyCoords, padding is included} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 20 0
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.3 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 22 0
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.4 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 24 0
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.5 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 26 0
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.6 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 26 -1
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-26.7 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 26 100
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-26.8 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 6
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 22 4
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.9 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 6
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 22 5
} -cleanup {
	deleteWindows
} -result {0 handle}
test panedwindow-26.10 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 8
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 20 5
} -cleanup {
	deleteWindows
} -result {0 handle}
test panedwindow-26.11 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 8
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 20 0
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.12 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -bd 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20] \
	    [frame .f3 -bg green -width 20 -height 20]
    panedwindow .p -showhandle false -borderwidth 0 -sashwidth 2 -sashpad 2
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20] \
	    [frame .f3 -background green -width 20 -height 20]
    .p identify 48 0
} -cleanup {
	deleteWindows
} -result {1 sash}
test panedwindow-26.13 {identify subcommand errors} -setup {
	deleteWindows
} -body {
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326



5327
5328
5329
5330
5331
5332
5333
5334
5335
5336



5337
5338
5339
5340
5341
5342
5343
5344
5345
5346



5347
5348
5349
5350
5351
5352
5353
5354
5355
5356



5357
5358
5359
5360
5361
5362
5363
5364
5365
5366



5367
5368
5369
5370
5371
5372
5373
5374
5375
5376



5377
5378
5379
5380
5381
5382
5383
5384
5385
5386



5387
5388
5389
5390
5391
5392
5393
5394

5395
5396
5397


5398
5399
5400
5401
5402
5403
5404
5405

5406
5407
5408


5409
5410
5411
5412
5413
5414
5415
5416

5417
5418
5419


5420
5421
5422
5423
5424
5425
5426
5427

5428
5429
5430


5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441




5442
5443
5444
5445
5446
5447
5448
5317
5318
5319
5320
5321
5322
5323



5324
5325
5326
5327
5328
5329
5330
5331
5332
5333



5334
5335
5336
5337
5338
5339
5340
5341
5342
5343



5344
5345
5346
5347
5348
5349
5350
5351
5352
5353



5354
5355
5356
5357
5358
5359
5360
5361
5362
5363



5364
5365
5366
5367
5368
5369
5370
5371
5372
5373



5374
5375
5376
5377
5378
5379
5380
5381
5382
5383



5384
5385
5386
5387
5388
5389
5390
5391
5392
5393

5394
5395


5396
5397
5398
5399
5400
5401
5402
5403
5404

5405
5406


5407
5408
5409
5410
5411
5412
5413
5414
5415

5416
5417


5418
5419
5420
5421
5422
5423
5424
5425
5426

5427
5428


5429
5430
5431
5432
5433
5434
5435
5436
5437




5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448







-
-
-
+
+
+







-
-
-
+
+
+







-
-
-
+
+
+







-
-
-
+
+
+







-
-
-
+
+
+







-
-
-
+
+
+







-
-
-
+
+
+







-
+

-
-
+
+







-
+

-
-
+
+







-
+

-
-
+
+







-
+

-
-
+
+







-
-
-
-
+
+
+
+







    .p identify 0 bar
} -cleanup {
	deleteWindows
} -returnCodes error -result {expected integer but got "bar"}
test panedwindow-26.16 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 0 0
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-26.17 {PanedWindowIdentifyCoords, padding is included} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 0 20
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.18 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 0 22
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.19 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 0 24
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.20 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 0 26
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.21 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify -1 26
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-26.22 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 100 26
} -cleanup {
	deleteWindows
} -result {}
test panedwindow-26.23 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 6 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 4 22
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.24 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 6 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 5 22
} -cleanup {
	deleteWindows
} -result {0 handle}
test panedwindow-26.25 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 8 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 5 20
} -cleanup {
	deleteWindows
} -result {0 handle}
test panedwindow-26.26 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
    panedwindow .p -borderwidth 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
	    -handlesize 8 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20]
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20]
    .p identify 0 20
} -cleanup {
	deleteWindows
} -result {0 sash}
test panedwindow-26.27 {PanedWindowIdentifyCoords} -setup {
	deleteWindows
} -body {
    panedwindow .p -showhandle false -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -bg red -width 20 -height 20] \
	    [frame .f2 -bg blue -width 20 -height 20] \
	    [frame .f3 -bg green -width 20 -height 20]
    panedwindow .p -showhandle false -borderwidth 0 -sashwidth 2 -sashpad 2 -orient vertical
    .p add [frame .f -background red -width 20 -height 20] \
	    [frame .f2 -background blue -width 20 -height 20] \
	    [frame .f3 -background green -width 20 -height 20]
    .p identify 0 48
} -cleanup {
	deleteWindows
} -result {1 sash}


test panedwindow-27.1 {destroy the window cleanly on error [Bug #616589]} -setup {
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472



5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495



5496
5497
5498
5499
5500
5501
5502
5463
5464
5465
5466
5467
5468
5469



5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492



5493
5494
5495
5496
5497
5498
5499
5500
5501
5502







-
-
-
+
+
+




















-
-
-
+
+
+







	deleteWindows
} -result 0


test panedwindow-28.1 {resizing width} -setup {
	deleteWindows
} -body {
    panedwindow .p -bd 5
    frame .f1 -width 100 -height 50 -bg blue
    frame .f2 -width 100 -height 50 -bg red
    panedwindow .p -borderwidth 5
    frame .f1 -width 100 -height 50 -background blue
    frame .f2 -width 100 -height 50 -background red

    .p add .f1 -sticky news
    .p add .f2 -sticky news
    pack .p -side top -fill both -expand 1
    wm geometry . ""
    update
    # Note the width
    set a [winfo width .f2]
    # Increase the size by 10
    regexp {^(\d+)x(\d+)} [wm geometry .] -> w h
    wm geometry . [expr {$w + 10}]x$h
    update
    set b "$a [winfo width .f2]"
} -cleanup {
    deleteWindows
} -result {100 110}

test panedwindow-28.2 {resizing height} -setup {
	deleteWindows
} -body {
    panedwindow .p -orient vertical -bd 5
    frame .f1 -width 50 -height 100 -bg blue
    frame .f2 -width 50 -height 100 -bg red
    panedwindow .p -orient vertical -borderwidth 5
    frame .f1 -width 50 -height 100 -background blue
    frame .f2 -width 50 -height 100 -background red

    .p add .f1 -sticky news
    .p add .f2 -sticky news
    pack .p -side top -fill both -expand 1
    wm geometry . ""
    update
    # Note the height
Changes to tests/place.test.
16
17
18
19
20
21
22
23

24
25

26
27

28
29
30
31
32
33
34
16
17
18
19
20
21
22

23
24

25
26

27
28
29
30
31
32
33
34







-
+

-
+

-
+







testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]

# XXX - This test file is woefully incomplete.  At present, only a
# few of the features are tested.

# Widgets used in tests 1.* - 8.*
toplevel .t -width 300 -height 200 -bd 0
toplevel .t -width 300 -height 200 -borderwidth 0
wm geom .t +0+0
frame .t.f -width 154 -height 84 -bd 2 -relief raised
frame .t.f -width 154 -height 84 -borderwidth 2 -relief raised
place .t.f -x 48 -y 38
frame .t.f2 -width 30 -height 60 -bd 2 -relief raised
frame .t.f2 -width 30 -height 60 -borderwidth 2 -relief raised
update

test place-1.1 {Tk_PlaceCmd procedure, "info" option} -setup {
    place forget .t.f2
} -body {
    place .t.f2 -x 0
    place info .t.f2
217
218
219
220
221
222
223
224

225
226
227
228
229
230
231
217
218
219
220
221
222
223

224
225
226
227
228
229
230
231







-
+







    place .t.f2 -in .t.f -x 1.6 -y 2.7
    update
    winfo geometry .t.f2
} -result {30x60+52+43}
test place-7.6 {ReconfigurePlacement procedure, position rounding} -setup {
    destroy .t.f3
} -body {
    frame .t.f3 -width 100 -height 100 -bg #f00000 -bd 0
    frame .t.f3 -width 100 -height 100 -background #f00000 -borderwidth 0
    place .t.f3 -x 0 -y 0
    raise .t.f2
    place forget .t.f2
    place .t.f2 -in .t.f3 -relx .303 -rely .406 -relwidth .304 -relheight .206
    update
    winfo geometry .t.f2
} -cleanup {
Changes to tests/raise.test.
17
18
19
20
21
22
23
24

25
26
27
28
29
30
31
17
18
19
20
21
22
23

24
25
26
27
28
29
30
31







-
+







# make it easy to detect differences in order.

proc raise_setup {} {
    foreach i [winfo child .raise] {
	        destroy $i
        }
    foreach i {a b c d e} {
	    label .raise.$i -text $i -relief raised -bd 2
	    label .raise.$i -text $i -relief raised -borderwidth 2
    }
    place .raise.a -x 20 -y 60 -width 60 -height 80
    place .raise.b -x 60 -y 60 -width 60 -height 80
    place .raise.c -x 100 -y 60 -width 60 -height 80
    place .raise.d -x 40 -y 20 -width 100 -height 60
    place .raise.e -x 40 -y 120 -width 100 -height 60
}
Changes to tests/scale.test.
1
2
3
4
5
6
7
8
9
10
11
12
13


14
15
16
17
18
19
20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22













+
+







# This file is a Tcl script to test out the "scale" command
# of Tk.  It is organized in the standard fashion for Tcl tests.
#
# Copyright © 1994 The Regents of the University of California.
# Copyright © 1994-1996 Sun Microsystems, Inc.
# Copyright © 1998-1999 by Scriptics Corporation.
# All rights reserved.

package require tcltest 2.2
namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands

testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}]

# Create entries in the option database to be sure that geometry options
# like border width have predictable values.

option add *Scale.borderWidth 2
option add *Scale.highlightThickness 2
option add *Scale.font {Helvetica -12 bold}

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
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







-
-
+
+

-
+


-
+











-
-
+
+

-
+


-
+







} -cleanup {
    .s configure -background [lindex [.s configure -background] 3]
} -result {#ff0000}
test scale-1.4 {configuration options} -body {
        .s configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test scale-1.5 {configuration options} -body {
    .s configure -bd 4
    .s cget -bd
    .s configure -borderwidth 4
    .s cget -borderwidth
} -cleanup {
    .s configure -bd [lindex [.s configure -bd] 3]
    .s configure -borderwidth [lindex [.s configure -borderwidth] 3]
} -result 4
test scale-1.6 {configuration options} -body {
        .s configure -bd badValue
        .s configure -borderwidth badValue
} -returnCodes error -result {bad screen distance "badValue"}
test scale-1.7 {configuration options} -body {
    .s configure -bigincrement 12.5
    .s cget -bigincrement
} -cleanup {
    .s configure -bigincrement [lindex [.s configure -bigincrement] 3]
} -result {12.5}
test scale-1.8 {configuration options} -body {
        .s configure -bigincrement badValue
} -returnCodes error -result {expected floating-point number but got "badValue"}
test scale-1.9 {configuration options} -body {
    .s configure -bg #ff0000
    .s cget -bg
    .s configure -background #ff0000
    .s cget -background
} -cleanup {
    .s configure -bg [lindex [.s configure -bg] 3]
    .s configure -background [lindex [.s configure -background] 3]
} -result {#ff0000}
test scale-1.10 {configuration options} -body {
        .s configure -bg non-existent
        .s configure -background non-existent
} -returnCodes error -result {unknown color name "non-existent"}
test scale-1.11 {configuration options} -body {
    .s configure -borderwidth 1.3
    .s cget -borderwidth
} -cleanup {
    .s configure -borderwidth [lindex [.s configure -borderwidth] 3]
} -result 1
98
99
100
101
102
103
104
105
106


107
108

109
110
111

112
113
114
115
116
117
118
119
120
121


122
123

124
125
126

127
128
129
130
131
132
133
100
101
102
103
104
105
106


107
108
109

110
111
112

113
114
115
116
117
118
119
120
121


122
123
124

125
126
127

128
129
130
131
132
133
134
135







-
-
+
+

-
+


-
+








-
-
+
+

-
+


-
+







} -cleanup {
    .s configure -digits [lindex [.s configure -digits] 3]
} -result 5
test scale-1.18 {configuration options} -body {
        .s configure -digits badValue
} -returnCodes error -result {expected integer but got "badValue"}
test scale-1.19 {configuration options} -body {
    .s configure -fg #00ff00
    .s cget -fg
    .s configure -color #00ff00
    .s cget -color
} -cleanup {
    .s configure -fg [lindex [.s configure -fg] 3]
    .s configure -color [lindex [.s configure -color] 3]
} -result {#00ff00}
test scale-1.20 {configuration options} -body {
        .s configure -fg badValue
        .s configure -color badValue
} -returnCodes error -result {unknown color name "badValue"}
test scale-1.21 {configuration options} -body {
    .s configure -font fixed
    .s cget -font
} -cleanup {
    .s configure -font [lindex [.s configure -font] 3]
} -result {fixed}
test scale-1.23 {configuration options} -body {
    .s configure -foreground green
    .s cget -foreground
    .s configure -color green
    .s cget -color
} -cleanup {
    .s configure -foreground [lindex [.s configure -foreground] 3]
    .s configure -color [lindex [.s configure -color] 3]
} -result {green}
test scale-1.24 {configuration options} -body {
        .s configure -foreground badValue
        .s configure -color badValue
} -returnCodes error -result {unknown color name "badValue"}
test scale-1.25 {configuration options} -body {
    .s configure -from -15.0
    .s cget -from
} -cleanup {
    .s configure -from [lindex [.s configure -from] 3]
} -result {-15.0}
356
357
358
359
360
361
362
363
364
365



366
367
368
369
370
371


372
373
374
375
376
377
378
358
359
360
361
362
363
364



365
366
367
368
369
370
371


372
373
374
375
376
377
378
379
380







-
-
-
+
+
+




-
-
+
+







test scale-3.4 {ScaleWidgetCmd procedure, cget option} -body {
    .s cget -gorp
} -returnCodes error -result {unknown option "-gorp"}
test scale-3.5 {ScaleWidgetCmd procedure, cget option} -body {
    .s configure -highlightthickness 2
    .s cget -highlightthickness
} -result 2
test scale-3.6 {ScaleWidgetCmd procedure, configure option} -body {
    list [llength [.s configure]] [lindex [.s configure] 6]
} -result {33 {-command command Command {} {}}}
test scale-3.6 {ScaleWidgetCmd procedure, configure option} -constraints nodeprecated -body {
    list [llength [.s configure]] [lindex [.s configure] 7]
} -result {34 {-command command Command {} {}}}
test scale-3.7 {ScaleWidgetCmd procedure, configure option} -body {
    .s configure -foo
} -returnCodes error -result {unknown option "-foo"}
test scale-3.8 {ScaleWidgetCmd procedure, configure option} -body {
    .s configure -borderwidth 2 -bg
} -returnCodes error -result {value for "-bg" missing}
    .s configure -borderwidth 2 -background
} -returnCodes error -result {value for "-background" missing}
test scale-3.9 {ScaleWidgetCmd procedure, coords option} -body {
    .s coords a b
} -returnCodes error -result {wrong # args: should be ".s coords ?value?"}
test scale-3.10 {ScaleWidgetCmd procedure, coords option} -body {
    .s coords bad
} -returnCodes error -result {expected floating-point number but got "bad"}
test scale-3.11 {ScaleWidgetCmd procedure} -constraints {
734
735
736
737
738
739
740
741

742
743
744
745
746
747
748
736
737
738
739
740
741
742

743
744
745
746
747
748
749
750







-
+







    deleteWindows
} -result {22 108}
test scale-7.4 {ComputeScaleGeometry procedure} -constraints {
    fonts
} -setup {
    deleteWindows
} -body {
    scale .s -from 0 -to 1000 -orient vertical -showvalue 0 -bd 5 \
    scale .s -from 0 -to 1000 -orient vertical -showvalue 0 -borderwidth 5 \
        -relief sunken
    pack .s
    update
    list [winfo reqwidth .s] [winfo reqheight .s]
} -cleanup {
    deleteWindows
} -result {39 114}
782
783
784
785
786
787
788
789

790
791
792
793
794
795
796
797
798
799
800
801
802
803
804

805
806
807
808
809
810
811
812
813
814
815
816
817
818

819
820
821
822
823
824
825
826
827
828
829
830
831
832

833
834
835
836
837
838
839
840
841
842
843
844

845
846
847
848
849
850
851
852
853
854
855
856
857
858
859

860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875

876
877
878
879
880
881
882
883
884
885
886
887
888

889
890
891
892
893
894
895
896
897
898
899
900
901

902
903
904
905
906
907
908
909
910
911
912
913
914

915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930

931
932
933
934
935

936
937
938
939
940

941
942
943
944
945

946
947
948
949
950

951
952
953
954
955

956
957
958
959
960

961
962
963
964
965

966
967
968
969
970

971
972
973
974
975
976
977
978
979
980
981
982
983

984
985
986
987
988
989
990
991
992
993
994
995
996

997
998
999
1000
1001
1002
1003
784
785
786
787
788
789
790

791
792
793
794
795
796
797
798
799
800
801
802
803
804
805

806
807
808
809
810
811
812
813
814
815
816
817
818
819

820
821
822
823
824
825
826
827
828
829
830
831
832
833

834
835
836
837
838
839
840
841
842
843
844
845

846
847
848
849
850
851
852
853
854
855
856
857
858
859
860

861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876

877
878
879
880
881
882
883
884
885
886
887
888
889

890
891
892
893
894
895
896
897
898
899
900
901
902

903
904
905
906
907
908
909
910
911
912
913
914
915

916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931

932
933
934
935
936

937
938
939
940
941

942
943
944
945
946

947
948
949
950
951

952
953
954
955
956

957
958
959
960
961

962
963
964
965
966

967
968
969
970
971

972
973
974
975
976
977
978
979
980
981
982
983
984

985
986
987
988
989
990
991
992
993
994
995
996
997

998
999
1000
1001
1002
1003
1004
1005







-
+














-
+













-
+













-
+











-
+














-
+















-
+












-
+












-
+












-
+















-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+












-
+












-
+







    list [winfo reqwidth .s] [winfo reqheight .s]
} -cleanup {
    deleteWindows
} -result {108 27}
test scale-7.8 {ComputeScaleGeometry procedure} -setup {
    deleteWindows
} -body {
    scale .s -from 0 -to 1000 -orient horizontal -showvalue 0 -bd 5 \
    scale .s -from 0 -to 1000 -orient horizontal -showvalue 0 -borderwidth 5 \
        -relief raised -highlightthickness 2
    pack .s
    update
    list [winfo reqwidth .s] [winfo reqheight .s]
} -cleanup {
    deleteWindows
} -result {114 39}


test scale-8.1 {ScaleElement procedure} -constraints {
    fonts
} -setup {
    deleteWindows
} -body {
    scale .s -from 0 -to 100 -orient vertical -bd 1 -tick 20 -length 300
    scale .s -from 0 -to 100 -orient vertical -borderwidth 1 -tick 20 -length 300
    pack .s
    .s set 30
    update
    list [.s identify 53 52] [.s identify 54 52] [.s identify 70 52] \
        [.s identify 71 52]
} -cleanup {
    deleteWindows
} -result {{} trough1 trough1 {}}
test scale-8.2 {ScaleElement procedure} -constraints {
    fonts
} -setup {
    deleteWindows
} -body {
    scale .s -from 0 -to 100 -orient vertical -bd 1 -tick 20 -length 300
    scale .s -from 0 -to 100 -orient vertical -borderwidth 1 -tick 20 -length 300
    pack .s
    .s set 30
    update
    list [.s identify 60 2] [.s identify 60 3] [.s identify 60 302] \
        [.s identify 60 303]
} -cleanup {
    deleteWindows
} -result {{} trough1 trough2 {}}
test scale-8.3 {ScaleElement procedure} -constraints {
    fonts
} -setup {
    deleteWindows
} -body {
    scale .s -from 0 -to 100 -orient vertical -bd 1 -tick 20 -length 300
    scale .s -from 0 -to 100 -orient vertical -borderwidth 1 -tick 20 -length 300
    pack .s
    .s set 30
    update
    list [.s identify 60 83] [.s identify 60 84] [.s identify 60 113] \
        [.s identify 60 114] \
} -cleanup {
    deleteWindows
} -result {trough1 slider slider trough2}
test scale-8.4 {ScaleElement procedure} -setup {
    deleteWindows
} -body {
    scale .s -from 0 -to 100 -orient vertical -bd 4 -width 10 \
    scale .s -from 0 -to 100 -orient vertical -borderwidth 4 -width 10 \
        -highlightthickness 1 -length 300 -showvalue 0
    pack .s
    .s set 30
    update
    list [.s identify 4 40] [.s identify 5 40] [.s identify 22 40] \
        [.s identify 23 40] \
} -cleanup {
    deleteWindows
} -result {{} trough1 trough1 {}}
test scale-8.5 {ScaleElement procedure} -constraints {
    fonts
} -setup {
    deleteWindows
} -body {
    scale .s -from 0 -to 100 -orient horizontal -bd 1 \
    scale .s -from 0 -to 100 -orient horizontal -borderwidth 1 \
        -highlightthickness 2 -tick 20 -sliderlength 20 \
        -length 200 -label Test
    pack .s
    .s set 30
    update
    list [.s identify 150 36] [.s identify 150 37] [.s identify 150 53] \
        [.s identify 150 54]
} -cleanup {
    deleteWindows
} -result {{} trough2 trough2 {}}
test scale-8.6 {ScaleElement procedure} -constraints {
    fonts
} -setup {
    deleteWindows
} -body {
    scale .s -from 0 -to 100 -orient horizontal -bd 2 \
    scale .s -from 0 -to 100 -orient horizontal -borderwidth 2 \
        -highlightthickness 1 -tick 20 -length 200
    pack .s
    .s set 30
    update
    list [.s identify 150 20] [.s identify 150 21] [.s identify 150 39] \
        [.s identify 150 40]
} -cleanup {
    deleteWindows
} -result {{} trough2 trough2 {}}
test scale-8.7 {ScaleElement procedure} -setup {
    deleteWindows
} -body {
    scale .s -from 0 -to 100 -orient horizontal -bd 4 -highlightthickness 2 \
    scale .s -from 0 -to 100 -orient horizontal -borderwidth 4 -highlightthickness 2 \
        -length 200 -width 10 -showvalue 0
    pack .s
    .s set 30
    update
    list [.s identify 30 5] [.s identify 30 6] [.s identify 30 23] \
        [.s identify 30 24]
} -cleanup {
    deleteWindows
} -result {{} trough1 trough1 {}}
test scale-8.8 {ScaleElement procedure} -setup {
    deleteWindows
} -body {
    scale .s -from 0 -to 100 -orient horizontal -bd 1 -highlightthickness 2 \
    scale .s -from 0 -to 100 -orient horizontal -borderwidth 1 -highlightthickness 2 \
        -tick 20 -sliderlength 20 -length 200 -label Test -showvalue 0
    pack .s
    .s set 30
    update
    list [.s identify 2 28] [.s identify 3 28] [.s identify 202 28] \
        [.s identify 203 28]
} -cleanup {
    deleteWindows
} -result {{} trough1 trough2 {}}
test scale-8.9 {ScaleElement procedure} -setup {
    deleteWindows
} -body {
    scale .s -from 0 -to 100 -orient horizontal -bd 1 -highlightthickness 2 \
    scale .s -from 0 -to 100 -orient horizontal -borderwidth 1 -highlightthickness 2 \
        -tick 20 -sliderlength 20 -length 200 -label Test -showvalue 0
    pack .s
    .s set 80
    update
    list [.s identify 145 28] [.s identify 146 28] [.s identify 165 28] \
        [.s identify 166 28]
} -cleanup {
    deleteWindows
} -result {trough1 slider slider trough2}


#widget used in 9.* tests
destroy .s
pack [scale .s]
test scale-9.1 {PixelToValue procedure} -body {
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
    update
    .s get 46 0
} -result 0
test scale-9.2 {PixelToValue procedure} -body {
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
    update
    .s get -10 9
} -result 0
test scale-9.3 {PixelToValue procedure} -body {
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
    update
    .s get -10 12
} -result 1
test scale-9.4 {PixelToValue procedure} -body {
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
    update
    .s get -10 46
} -result 35
test scale-9.5 {PixelToValue procedure} -body {
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
    update
    .s get -10 110
} -result 99
test scale-9.6 {PixelToValue procedure} -body {
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
    update
    .s get -10 111
} -result 100
test scale-9.7 {PixelToValue procedure} -body {
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
    update
    .s get -10 112
} -result 100
test scale-9.8 {PixelToValue procedure} -body {
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2
    update
    .s get -10 154
} -result 100
test scale-9.9 {PixelToValue procedure} -body {
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2 \
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2 \
        -orient horizontal
    update
    .s get 76 152
} -result 65
destroy .s


test scale-10.1 {ValueToPixel procedure} -constraints {
    fonts
} -setup {
    deleteWindows
} -body {
    scale .s -from 0 -to 100 -sliderlength 20 -length 124 -bd 2 \
    scale .s -from 0 -to 100 -sliderlength 20 -length 124 -borderwidth 2 \
        -orient horizontal -label Test -tick 20
    pack .s
    update
    list [.s coords -10] [.s coords 40] [.s coords 1000]
} -cleanup {
    deleteWindows
} -result {{16 47} {56 47} {116 47}}
test scale-10.2 {ValueToPixel procedure} -constraints {
    fonts
} -setup {
    deleteWindows
} -body {
    scale .s -from 100 -to 0 -sliderlength 20 -length 122 -bd 1 \
    scale .s -from 100 -to 0 -sliderlength 20 -length 122 -borderwidth 1 \
        -orient vertical -label Test -tick 20
    pack .s
    update
    list [.s coords -10] [.s coords 40] [.s coords 1000]
} -cleanup {
    deleteWindows
} -result {{62 114} {62 74} {62 14}}
1026
1027
1028
1029
1030
1031
1032
1033

1034
1035
1036

1037
1038
1039
1040
1041
1042
1043
1028
1029
1030
1031
1032
1033
1034

1035
1036
1037

1038
1039
1040
1041
1042
1043
1044
1045







-
+


-
+







    rename killScale {}
    deleteWindows
} -result {initial 1 0 {}}
test scale-11.2 {ScaleEventProc procedure} -setup {
    deleteWindows
    set x {}
} -body {
    scale .s1 -bg #543210
    scale .s1 -background #543210
    rename .s1 .s2
    lappend x [winfo children .]
    lappend x [.s2 cget -bg]
    lappend x [.s2 cget -background]
    destroy .s1
    lappend x [info command .s*] [winfo children .]
} -cleanup {
    deleteWindows
} -result {.s1 #543210 {} {}}

test scale-12.1 {ScaleCmdDeletedProc procedure} -setup {
1101
1102
1103
1104
1105
1106
1107
1108

1109
1110
1111
1112
1113
1114

1115
1116
1117
1118
1119
1120
1121

1122
1123
1124
1125
1126
1127

1128
1129
1130
1131
1132
1133
1134

1135
1136
1137
1138
1139
1140

1141
1142
1143
1144
1145
1146
1147

1148
1149
1150
1151
1152
1153

1154
1155
1156
1157
1158
1159
1160

1161
1162
1163
1164
1165
1166

1167
1168
1169
1170
1171
1172
1173

1174
1175
1176
1177
1178
1179

1180
1181
1182
1183
1184
1185
1186
1103
1104
1105
1106
1107
1108
1109

1110
1111
1112
1113
1114
1115

1116
1117
1118
1119
1120
1121
1122

1123
1124
1125
1126
1127
1128

1129
1130
1131
1132
1133
1134
1135

1136
1137
1138
1139
1140
1141

1142
1143
1144
1145
1146
1147
1148

1149
1150
1151
1152
1153
1154

1155
1156
1157
1158
1159
1160
1161

1162
1163
1164
1165
1166
1167

1168
1169
1170
1171
1172
1173
1174

1175
1176
1177
1178
1179
1180

1181
1182
1183
1184
1185
1186
1187
1188







-
+





-
+






-
+





-
+






-
+





-
+






-
+





-
+






-
+





-
+






-
+





-
+









# Widget used in 14.* tests
destroy .s
pack [scale .s]
update
test scale-14.1 {RoundValueToResolution procedure} -body {
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2 \
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2 \
        -orient horizontal -resolution 4.0
    update
    .s get 84 152
} -result 72
test scale-14.2 {RoundValueToResolution procedure} -body {
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -bd 2 \
    .s configure -from 0 -to 100 -sliderlength 10 -length 114 -borderwidth 2 \
        -orient horizontal -resolution 4.0
    update
    .s get 86 152
} -result 76

test scale-14.3 {RoundValueToResolution procedure} -body {
    .s configure -from 100 -to 0 -sliderlength 10 -length 114 -bd 2 \
    .s configure -from 100 -to 0 -sliderlength 10 -length 114 -borderwidth 2 \
        -orient horizontal -resolution 4.0
    update
    .s get 84 152
} -result 28
test scale-14.4 {RoundValueToResolution procedure} -body {
    .s configure -from 100 -to 0 -sliderlength 10 -length 114 -bd 2 \
    .s configure -from 100 -to 0 -sliderlength 10 -length 114 -borderwidth 2 \
        -orient horizontal -resolution 4.0
    update
    .s get 86 152
} -result 24

test scale-14.5 {RoundValueToResolution procedure} -body {
    .s configure -from -100 -to 0 -sliderlength 10 -length 114 -bd 2 \
    .s configure -from -100 -to 0 -sliderlength 10 -length 114 -borderwidth 2 \
        -orient horizontal -resolution 4.0
    update
    .s get 84 152
} -result -28
test scale-14.6 {RoundValueToResolution procedure} -body {
    .s configure -from -100 -to 0 -sliderlength 10 -length 114 -bd 2 \
    .s configure -from -100 -to 0 -sliderlength 10 -length 114 -borderwidth 2 \
        -orient horizontal -resolution 4.0
    update
    .s get 86 152
} -result -24

test scale-14.7 {RoundValueToResolution procedure} -body {
    .s configure -from 0 -to -100 -sliderlength 10 -length 114 -bd 2 \
    .s configure -from 0 -to -100 -sliderlength 10 -length 114 -borderwidth 2 \
        -orient horizontal -resolution 4.0
    update
    .s get 84 152
} -result -72
test scale-14.8 {RoundValueToResolution procedure} -body {
    .s configure -from 0 -to -100 -sliderlength 10 -length 114 -bd 2 \
    .s configure -from 0 -to -100 -sliderlength 10 -length 114 -borderwidth 2 \
        -orient horizontal -resolution 4.0
    update
    .s get 86 152
} -result -76

test scale-14.9 {RoundValueToResolution procedure} -body {
    .s configure -from 0 -to 2.25  -sliderlength 10 -length 114 -bd 2 \
    .s configure -from 0 -to 2.25  -sliderlength 10 -length 114 -borderwidth 2 \
        -orient horizontal -resolution 0
    update
    .s get 84 152
} -result {1.64}
test scale-14.10 {RoundValueToResolution procedure} -body {
    .s configure -from 0 -to 2.25  -sliderlength 10 -length 114 -bd 2 \
    .s configure -from 0 -to 2.25  -sliderlength 10 -length 114 -borderwidth 2 \
        -orient horizontal -resolution 0
    update
    .s get 86 152
} -result {1.69}

test scale-14.11 {RoundValueToResolution procedure} -body {
    .s configure -from 0 -to 225 -sliderlength 10 -length 114 -bd 2 \
    .s configure -from 0 -to 225 -sliderlength 10 -length 114 -borderwidth 2 \
        -orient horizontal -resolution 0 -digits 5
    update
    .s get 84 152
} -result {164.25}
test scale-14.12 {RoundValueToResolution procedure} -body {
    .s configure -from 0 -to 225 -sliderlength 10 -length 114 -bd 2 \
    .s configure -from 0 -to 225 -sliderlength 10 -length 114 -borderwidth 2 \
        -orient horizontal -resolution 0 -digits 5
    update
    .s get 86 152
} -result {168.75}
destroy .s

test scale-14.13 {RoundValueToResolution procedure, round-off errors} -setup {
1196
1197
1198
1199
1200
1201
1202
1203

1204
1205
1206
1207
1208
1209
1210
1211
1212
1213

1214
1215
1216
1217
1218
1219
1220
1198
1199
1200
1201
1202
1203
1204

1205
1206
1207
1208
1209
1210
1211
1212
1213
1214

1215
1216
1217
1218
1219
1220
1221
1222







-
+









-
+







    destroy .s
} -result {NotSet}

test scale-14a.1 {RoundValueToResolution, RoundIntervalToResolution procedures} -setup {
    pack [scale .s -orient horizontal]
    update
} -body {
    .s configure -length 400 -bd 0 -from 1 -to 9 -resolution 2 -tickinterval 1
    .s configure -length 400 -borderwidth 0 -from 1 -to 9 -resolution 2 -tickinterval 1
    update
    .s get 200 0
} -cleanup {
    destroy .s
} -result 5
test scale-14a.2 {RoundValueToResolution, RoundIntervalToResolution procedures} -setup {
    pack [scale .s -orient horizontal]
    update
} -body {
    .s configure -length 400 -bd 0 -from -1.5 -to 1.5 -resolution 1 \
    .s configure -length 400 -borderwidth 0 -from -1.5 -to 1.5 -resolution 1 \
            -tickinterval 1 -digits 2
    update
    .s get 250 0
} -cleanup {
    destroy .s
} -result {0.5}

Changes to tests/scrollbar.test.
1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
21
22
23
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

17
18
19
20
21
22
23













+


-







# This file is a Tcl script to test out scrollbar widgets and
# the "scrollbar" command of Tk.  It is organized in the standard
# fashion for Tcl tests.
#
# Copyright © 1994 The Regents of the University of California.
# Copyright © 1994-1997 Sun Microsystems, Inc.
# Copyright © 1998-1999 by Scriptics Corporation.
# All rights reserved.

package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands

testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}]
testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}]

proc scroll args {
    global scrollInfo
    set scrollInfo $args
}

proc getTroughSize {w} {
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
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







-
+




-
+






-
+



-
+







    } else {
        if {[tk windowingsystem] eq "x11"} {
            # Calculations here assume that the arrow area is a square.
	    if [string match v* [$w cget -orient]] {
	        return [expr {[winfo height $w] \
		        - ([winfo width $w] \
			    - [$w cget -highlightthickness] \
			    - [$w cget -bd] + 1)*2}]
			    - [$w cget -borderwidth] + 1)*2}]
	    } else {
	        return [expr {[winfo width $w] \
		        - ([winfo height $w] \
			    - [$w cget -highlightthickness] \
			    - [$w cget -bd] + 1)*2}]
			    - [$w cget -borderwidth] + 1)*2}]
	    }
        } else {
            # macOS aqua
	    if [string match v* [$w cget -orient]] {
	        return [expr {[winfo height $w] \
			- ([$w cget -highlightthickness] \
			  +[$w cget -bd])*2}]
			  +[$w cget -borderwidth])*2}]
	    } else {
	        return [expr {[winfo width $w] \
			- ([$w cget -highlightthickness] \
			  +[$w cget -bd])*2}]
			  +[$w cget -borderwidth])*2}]
	    }
        }
    }
}

# XXX Note: this test file is woefully incomplete.  Right now there are
# only bits and pieces of tests.  Please make this file more complete
75
76
77
78
79
80
81
82
83


84
85
86
87
88
89
90
75
76
77
78
79
80
81


82
83
84
85
86
87
88
89
90







-
-
+
+







foreach test {
    {-activebackground #ff0000 #ff0000 non-existent
	    {unknown color name "non-existent"}}
    {-activerelief sunken sunken non-existent
	    {bad relief "non-existent": must be flat, groove, raised, ridge, solid, or sunken}}
    {-background #ff0000 #ff0000 non-existent
	    {unknown color name "non-existent"}}
    {-bd 4 4 badValue {bad screen distance "badValue"}}
    {-bg #ff0000 #ff0000 non-existent
    {-borderwidth 4 4 badValue {bad screen distance "badValue"}}
    {-background #ff0000 #ff0000 non-existent
	    {unknown color name "non-existent"}}
    {-borderwidth 1.3 1 badValue {bad screen distance "badValue"}}
    {-command "set x" {set x} {} {}}
    {-elementborderwidth 4 4 badValue {bad screen distance "badValue"}}
    {-cursor arrow arrow badValue {bad cursor spec "badValue"}}
    {-highlightbackground #112233 #112233 ugly {unknown color name "ugly"}}
    {-highlightcolor #123456 #123456 bogus {unknown color name "bogus"}}
137
138
139
140
141
142
143
144

145
146
147
148
149
150
151
137
138
139
140
141
142
143

144
145
146
147
148
149
150
151







-
+







    catch {destroy .s}
} -body {
    scrollbar .s
} -cleanup {
    destroy .s
} -result .s

scrollbar .s -orient vertical -command scroll -highlightthickness 2 -bd 2
scrollbar .s -orient vertical -command scroll -highlightthickness 2 -borderwidth 2
pack .s -side right -fill y
update
test scrollbar-3.1 {ScrollbarWidgetCmd procedure} {
    list [catch {.s} msg] $msg
} {1 {wrong # args: should be ".s option ?arg ...?"}}
test scrollbar-3.2 {ScrollbarWidgetCmd procedure, "cget" option} {
    list [catch {.s cget} msg] $msg
177
178
179
180
181
182
183
184

185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202

203
204
205
206
207
208
209
177
178
179
180
181
182
183

184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201

202
203
204
205
206
207
208
209







-
+

















-
+







    list [catch {.s activate trough1} msg] $msg
} {0 {}}
test scrollbar-3.10 {ScrollbarWidgetCmd procedure, "cget" option} {
    list [catch {.s cget -orient} msg] $msg
} {0 vertical}
scrollbar .s2
test scrollbar-3.11 {ScrollbarWidgetCmd procedure, "cget" option} {
    expr {[.s2 cget -bd] == [lindex [.s2 configure -bd] 3]}
    expr {[.s2 cget -borderwidth] == [lindex [.s2 configure -borderwidth] 3]}
} 1
test scrollbar-3.12 {ScrollbarWidgetCmd procedure, "cget" option} emptyTest {
    # empty test; duplicated scrollbar-3.11
} {}
test scrollbar-3.12.1 {ScrollbarWidgetCmd procedure, "cget" option} emptyTest {
    # empty test; duplicated scrollbar-3.11
} {}
test scrollbar-3.13 {ScrollbarWidgetCmd procedure, "cget" option} {
    expr {[.s2 cget -highlightthickness] == [lindex [.s2 configure -highlightthickness] 3]}
} 1
test scrollbar-3.14 {ScrollbarWidgetCmd procedure, "cget" option} emptyTest {
    # empty test; duplicated scrollbar-3.13
} {}
test scrollbar-3.14.1 {ScrollbarWidgetCmd procedure, "cget" option} emptyTest {
    # empty test; duplicated scrollbar-3.13
} {}
destroy .s2
test scrollbar-3.15 {ScrollbarWidgetCmd procedure, "configure" option} {
test scrollbar-3.15 {ScrollbarWidgetCmd procedure, "configure" option} nodeprecated {
    llength [.s configure]
} 20
test scrollbar-3.16 {ScrollbarWidgetCmd procedure, "configure" option} {
    list [catch {.s configure -bad} msg] $msg
} {1 {unknown option "-bad"}}
test scrollbar-3.17 {ScrollbarWidgetCmd procedure, "configure" option} {
    .s configure -orient
300
301
302
303
304
305
306
307

308
309
310

311
312
313
314
315
316
317
300
301
302
303
304
305
306

307
308
309

310
311
312
313
314
315
316
317







-
+


-
+







    format {%.6g} [.t.s fraction 100 0]
} {0.5}
if {[testConstraint testmetrics]} {
    # Only Windows has [testmetrics]
    place configure .t.s -width [expr {2*[testmetrics cxhscroll .t.s]+1}]
} else {
    if {[tk windowingsystem] eq "x11"} {
        place configure .t.s -width [expr {[winfo height .t.s] - 2*([.t.s cget -highlightthickness] + [.t.s cget -bd] + 1)}]
        place configure .t.s -width [expr {[winfo height .t.s] - 2*([.t.s cget -highlightthickness] + [.t.s cget -borderwidth] + 1)}]
    } else {
        # macOS aqua
        place configure .t.s -width [expr {2*([.t.s cget -highlightthickness] + [.t.s cget -bd])}]
        place configure .t.s -width [expr {2*([.t.s cget -highlightthickness] + [.t.s cget -borderwidth])}]
    }
}
update
test scrollbar-3.42 {ScrollbarWidgetCmd procedure, "fraction" option} {
    format {%.6g} [.t.s fraction 100 0]
} 0
destroy .t
438
439
440
441
442
443
444
445

446
447
448
449

450
451
452
453
454
455
456
457
458
459
460
461
462

463
464
465
466
467
468
469
438
439
440
441
442
443
444

445
446
447
448

449
450
451
452
453
454
455
456
457
458
459
460
461

462
463
464
465
466
467
468
469







-
+



-
+












-
+







} {1 {bad option "bogus": must be activate, cget, configure, delta, fraction, get, identify, or set}}
test scrollbar-3.74 {ScrollbarWidgetCmd procedure} {
    list [catch {.s c} msg] $msg
} {1 {ambiguous option "c": must be activate, cget, configure, delta, fraction, get, identify, or set}}

test scrollbar-4.1 {ScrollbarEventProc procedure} {
    catch {destroy .s1}
    scrollbar .s1 -bg #543210
    scrollbar .s1 -background #543210
    rename .s1 .s2
    set x {}
    lappend x [winfo exists .s1]
    lappend x [.s2 cget -bg]
    lappend x [.s2 cget -background]
    destroy .s1
    lappend x [info command .s?] [winfo exists .s1] [winfo exists .s2]
} {1 #543210 {} 0 0}

test scrollbar-5.1 {ScrollbarCmdDeletedProc procedure} {
    catch {destroy .s1}
    scrollbar .s1
    rename .s1 {}
    list [info command .s?] [winfo exists .s1]
} {{} 0}

catch {destroy .s}
scrollbar .s -orient vertical -relief sunken -bd 2 -highlightthickness 2
scrollbar .s -orient vertical -relief sunken -borderwidth 2 -highlightthickness 2
pack .s -side left -fill y
.s set .2 .4
update

test scrollbar-6.1 {ScrollbarPosition procedure} unix {
    .s identify 8 3
} {}
586
587
588
589
590
591
592
593

594
595
596
597
598
599
600
586
587
588
589
590
591
592

593
594
595
596
597
598
599
600







-
+







test scrollbar-6.38 {ScrollbarPosition procedure} win {
    .s identify [expr {[winfo width .s] - 1}] 100
} {trough2}

catch {destroy .t}
toplevel .t -width 250 -height 150
wm geometry .t +0+0
scrollbar .t.s -orient horizontal -relief sunken -bd 2 -highlightthickness 2
scrollbar .t.s -orient horizontal -relief sunken -borderwidth 2 -highlightthickness 2
place .t.s -width 200
.t.s set .2 .4
update

test scrollbar-6.39.1 {ScrollbarPosition procedure} x11 {
    .t.s identify 4 8
} {arrow1}
Changes to tests/spinbox.test.
1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21













+







# This file is a Tcl script to test spinbox widgets in Tk.  It is
# organized in the standard fashion for Tcl tests.
#
# Copyright © 1994 The Regents of the University of California.
# Copyright © 1994-1997 Sun Microsystems, Inc.
# Copyright © 1998-1999 by Scriptics Corporation.
# All rights reserved.

package require tcltest 2.2
namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands

testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}]
testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
testConstraint failsOnUbuntuNoXft [expr {[testConstraint failsOnUbuntu] || (![catch {tk::pkgconfig get fontsystem} fs] && ($fs eq "xft"))}]

# For xscrollcommand
set scrollInfo {}
proc scroll args {
        global scrollInfo
89
90
91
92
93
94
95
96
97


98
99
100
101
102
103
104
105
106
107

108
109
110
111
112
113
114
115
116
117
118
119


120
121
122
123
124
125
126
127
128
129

130
131
132
133
134
135
136
90
91
92
93
94
95
96


97
98
99
100
101
102
103
104
105
106
107

108
109
110
111
112
113
114
115
116
117
118


119
120
121
122
123
124
125
126
127
128
129

130
131
132
133
134
135
136
137







-
-
+
+









-
+










-
-
+
+









-
+








test spinbox-1.5 {configuration option: "bd"} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
    pack .e
    update
} -body {
    .e configure -bd 4
    .e cget -bd
    .e configure -borderwidth 4
    .e cget -borderwidth
} -cleanup {
    destroy .e
} -result 4
test spinbox-1.6 {configuration option: "bd" for spinbox} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
    pack .e
    update
} -body {
    .e configure -bd badValue
    .e configure -borderwidth badValue
} -cleanup {
    destroy .e
} -returnCodes {error} -result {bad screen distance "badValue"}

test spinbox-1.7 {configuration option: "bg"} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
    pack .e
    update
} -body {
    .e configure -bg #ff0000
    .e cget -bg
    .e configure -background #ff0000
    .e cget -background
} -cleanup {
    destroy .e
} -result {#ff0000}
test spinbox-1.8 {configuration option: "bg" for spinbox} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
    pack .e
    update
} -body {
    .e configure -bg non-existent
    .e configure -background non-existent
} -cleanup {
    destroy .e
} -returnCodes {error} -result {unknown color name "non-existent"}

test spinbox-1.9 {configuration option: "borderwidth"} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
255
256
257
258
259
260
261
262
263


264
265
266
267
268
269
270
271
272
273

274
275
276
277
278
279
280
256
257
258
259
260
261
262


263
264
265
266
267
268
269
270
271
272
273

274
275
276
277
278
279
280
281







-
-
+
+









-
+








test spinbox-1.20 {configuration option: "disabledforeground"} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
    pack .e
    update
} -body {
    .e configure -disabledforeground #110022
    .e cget -disabledforeground
    .e configure -disabledcolor #110022
    .e cget -disabledcolor
} -cleanup {
    destroy .e
} -result {#110022}
test spinbox-1.21 {configuration option: "disabledforeground" for spinbox} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
    pack .e
    update
} -body {
    .e configure -disabledforeground bogus
    .e configure -disabledcolor bogus
} -cleanup {
    destroy .e
} -returnCodes {error} -result {unknown color name "bogus"}

test spinbox-1.22 {configuration option: "exportselection"} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
299
300
301
302
303
304
305
306
307


308
309
310
311
312
313
314
315
316
317

318
319
320
321
322
323
324
300
301
302
303
304
305
306


307
308
309
310
311
312
313
314
315
316
317

318
319
320
321
322
323
324
325







-
-
+
+









-
+








test spinbox-1.24 {configuration option: "fg"} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
    pack .e
    update
} -body {
    .e configure -fg #110022
    .e cget -fg
    .e configure -color #110022
    .e cget -color
} -cleanup {
    destroy .e
} -result {#110022}
test spinbox-1.25 {configuration option: "fg" for spinbox} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
    pack .e
    update
} -body {
    .e configure -fg bogus
    .e configure -color bogus
} -cleanup {
    destroy .e
} -returnCodes {error} -result {unknown color name "bogus"}

test spinbox-1.26 {configuration option: "font"} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
343
344
345
346
347
348
349
350
351


352
353
354
355
356
357
358
359
360
361

362
363
364
365
366
367
368
344
345
346
347
348
349
350


351
352
353
354
355
356
357
358
359
360
361

362
363
364
365
366
367
368
369







-
-
+
+









-
+








test spinbox-1.28 {configuration option: "foreground"} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
    pack .e
    update
} -body {
    .e configure -foreground #110022
    .e cget -foreground
    .e configure -color #110022
    .e cget -color
} -cleanup {
    destroy .e
} -result {#110022}
test spinbox-1.29 {configuration option: "foreground" for spinbox} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
    pack .e
    update
} -body {
    .e configure -foreground bogus
    .e configure -color bogus
} -cleanup {
    destroy .e
} -returnCodes {error} -result {unknown color name "bogus"}

test spinbox-1.30 {configuration option: "format"} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
603
604
605
606
607
608
609
610

611
612
613
614
615
616
617
604
605
606
607
608
609
610

611
612
613
614
615
616
617
618







-
+







} -body {
    .e configure -invalidcommand "a command"
    .e cget -invalidcommand
} -cleanup {
    destroy .e
} -result {a command}

test spinbox-1.52 {configuration option: "invcmd"} -setup {
test spinbox-1.52 {configuration option: "invcmd"} -constraints nodeprecated -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
    pack .e
    update
} -body {
    .e configure -invcmd "a command"
    .e cget -invcmd
775
776
777
778
779
780
781
782
783


784
785
786
787
788
789
790
791
792
793

794
795
796
797
798
799
800
776
777
778
779
780
781
782


783
784
785
786
787
788
789
790
791
792
793

794
795
796
797
798
799
800
801







-
-
+
+









-
+








test spinbox-1.67 {configuration option: "selectforeground"} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
    pack .e
    update
} -body {
    .e configure -selectforeground #654321
    .e cget -selectforeground
    .e configure -selectcolor #654321
    .e cget -selectcolor
} -cleanup {
    destroy .e
} -result {#654321}
test spinbox-1.68 {configuration option: "selectforeground" for spinbox} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
    pack .e
    update
} -body {
    .e configure -selectforeground bogus
    .e configure -selectcolor bogus
} -cleanup {
    destroy .e
} -returnCodes {error} -result {unknown color name "bogus"}

test spinbox-1.69 {configuration option: "state"} -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
915
916
917
918
919
920
921
922

923
924
925
926
927
928
929
916
917
918
919
920
921
922

923
924
925
926
927
928
929
930







-
+







    update
} -body {
    .e configure -values {bad {}list}
} -cleanup {
    destroy .e
} -returnCodes {error} -result {list element in braces followed by "list" instead of space}

test spinbox-1.80 {configuration option: "vcmd"} -setup {
test spinbox-1.80 {configuration option: "vcmd"} -constraints nodeprecated -setup {
        spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \
        -relief sunken
    pack .e
    update
} -body {
    .e configure -vcmd "a command"
    .e cget -vcmd
1150
1151
1152
1153
1154
1155
1156
1157
1158


1159
1160
1161
1162

1163
1164
1165
1166
1167
1168
1169
1170

1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183



1184
1185
1186
1187
1188
1189
1190
1151
1152
1153
1154
1155
1156
1157


1158
1159
1160
1161
1162

1163
1164
1165
1166
1167
1168
1169
1170

1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181



1182
1183
1184
1185
1186
1187
1188
1189
1190
1191







-
-
+
+



-
+







-
+










-
-
-
+
+
+







    .e cget -gorp
} -cleanup {
    destroy .e
} -returnCodes error -result {unknown option "-gorp"}
test spinbox-3.14 {SpinboxWidgetCmd procedure, "cget" widget command} -setup {
    spinbox .e
} -body {
    .e configure -bd 4
    .e cget -bd
    .e configure -borderwidth 4
    .e cget -borderwidth
} -cleanup {
    destroy .e
} -result 4
test spinbox-3.15 {SpinboxWidgetCmd procedure, "configure" widget command} -setup {
test spinbox-3.15 {SpinboxWidgetCmd procedure, "configure" widget command} -constraints nodeprecated -setup {
    spinbox .e
    pack .e
    update
} -body {
    llength [.e configure]
} -cleanup {
    destroy .e
} -result 51
} -result 55
test spinbox-3.16 {SpinboxWidgetCmd procedure, "configure" widget command} -setup {
    spinbox .e
} -body {
    .e configure -foo
} -cleanup {
    destroy .e
} -returnCodes error -result {unknown option "-foo"}
test spinbox-3.17 {SpinboxWidgetCmd procedure, "configure" widget command} -setup {
    spinbox .e
} -body {
    .e configure -bd 4
    .e configure -bg #ffffff
    lindex [.e configure -bd] 4
    .e configure -borderwidth 4
    .e configure -background #ffffff
    lindex [.e configure -borderwidth] 4
} -cleanup {
    destroy .e
} -result 4
test spinbox-3.18 {SpinboxWidgetCmd procedure, "delete" widget command} -setup {
    spinbox .e
} -body {
    .e delete
2044
2045
2046
2047
2048
2049
2050
2051

2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064

2065
2066
2067
2068
2069
2070
2071
2045
2046
2047
2048
2049
2050
2051

2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064

2065
2066
2067
2068
2069
2070
2071
2072







-
+












-
+







} -result {79x37+0+0}
test spinbox-5.9 {ConfigureSpinbox procedure} -constraints {
    fonts
} -setup {
    spinbox .e -borderwidth 2 -highlightthickness 2
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief raised
    .e configure -font {Courier -12} -borderwidth 2 -relief raised
    .e insert end "0123"
    update
    list [.e index @10] [.e index @11] [.e index @12] [.e index @13]
} -cleanup {
    destroy .e
} -result {0 0 1 1}
test spinbox-5.10 {ConfigureSpinbox procedure} -constraints {
    fonts
} -setup {
    spinbox .e -borderwidth 2 -highlightthickness 2
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief flat
    .e configure -font {Courier -12} -borderwidth 2 -relief flat
    .e insert end "0123"
    update
    list [.e index @10] [.e index @11] [.e index @12] [.e index @13]
} -cleanup {
    destroy .e
} -result {0 0 1 1}
test spinbox-5.11 {ConfigureSpinbox procedure} -setup {
2099
2100
2101
2102
2103
2104
2105
2106

2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119

2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133

2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145

2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157

2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171

2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185

2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198

2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211

2212
2213
2214
2215
2216
2217
2218
2219
2220
2221

2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239

2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255

2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269

2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283

2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297

2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311

2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323

2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334

2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346

2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361

2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374

2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391

2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408

2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424

2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440

2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456

2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472

2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486

2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502

2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515

2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531

2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547

2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560

2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573

2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586

2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599

2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612

2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625

2626
2627
2628
2629
2630
2631
2632
2100
2101
2102
2103
2104
2105
2106

2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119

2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133

2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145

2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157

2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171

2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185

2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198

2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211

2212
2213
2214
2215
2216
2217
2218
2219
2220
2221

2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239

2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255

2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269

2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283

2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297

2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311

2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323

2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334

2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346

2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361

2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374

2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391

2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408

2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424

2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440

2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456

2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472

2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486

2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502

2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515

2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531

2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547

2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560

2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573

2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586

2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599

2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612

2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625

2626
2627
2628
2629
2630
2631
2632
2633







-
+












-
+













-
+











-
+











-
+













-
+













-
+












-
+












-
+









-
+

















-
+















-
+













-
+













-
+













-
+













-
+











-
+










-
+











-
+














-
+












-
+
















-
+
















-
+















-
+















-
+















-
+















-
+













-
+















-
+












-
+















-
+















-
+












-
+












-
+












-
+












-
+












-
+












-
+








test spinbox-6.1 {SpinboxComputeGeometry procedure} -constraints {
    fonts
} -setup {
    spinbox .e
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief raised -width 20 -highlightthickness 3
    .e configure -font {Courier -12} -borderwidth 2 -relief raised -width 20 -highlightthickness 3
    .e insert end 012\t45
    update
    list [.e index @61] [.e index @62]
} -cleanup {
    destroy .e
} -result {3 4}
test spinbox-6.2 {SpinboxComputeGeometry procedure} -constraints {
    fonts
} -setup {
    spinbox .e
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief raised -width 20 -justify center \
    .e configure -font {Courier -12} -borderwidth 2 -relief raised -width 20 -justify center \
	    -highlightthickness 3
    .e insert end 012\t45
    update
    list [.e index @96] [.e index @97]
} -cleanup {
    destroy .e
} -result {3 4}
test spinbox-6.3 {SpinboxComputeGeometry procedure} -constraints {
    fonts
} -setup {
    spinbox .e
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief raised -width 20 -justify right \
    .e configure -font {Courier -12} -borderwidth 2 -relief raised -width 20 -justify right \
	    -highlightthickness 3
    .e insert end 012\t45
    update
    list [.e index @131] [.e index @132]
} -cleanup {
    destroy .e
} -result {3 4}
test spinbox-6.4 {SpinboxComputeGeometry procedure} -setup {
    spinbox .e
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief raised -width 5
    .e configure -font {Courier -12} -borderwidth 2 -relief raised -width 5
    .e insert end "01234567890"
    update
    .e xview 6
    .e index @0
} -cleanup {
    destroy .e
} -result 6
test spinbox-6.5 {SpinboxComputeGeometry procedure} -setup {
    spinbox .e -highlightthickness 2
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief raised -width 5
    .e configure -font {Courier -12} -borderwidth 2 -relief raised -width 5
    .e insert end "01234567890"
    update
    .e xview 7
    .e index @0
} -cleanup {
    destroy .e
} -result 6
test spinbox-6.6 {SpinboxComputeGeometry procedure} -constraints {
    fonts
} -setup {
    spinbox .e -highlightthickness 2
    pack .e
} -body {
    .e configure -font {Courier -12} -bd 2 -relief raised -width 10
    .e configure -font {Courier -12} -borderwidth 2 -relief raised -width 10
    .e insert end "01234\t67890"
    update
    .e xview 3
    list [.e index @39] [.e index @40]
} -cleanup {
    destroy .e
} -result {5 6}
test spinbox-6.7 {SpinboxComputeGeometry procedure} -constraints {
    fonts
} -setup {
    spinbox .e -highlightthickness 2
    pack .e
} -body {
    .e configure -font {Helvetica -24} -bd 3 -relief raised -width 5
    .e configure -font {Helvetica -24} -borderwidth 3 -relief raised -width 5
    .e insert end "01234567"
    update
    list [winfo reqwidth .e] [winfo reqheight .e]
} -cleanup {
    destroy .e
} -result {94 39}
test spinbox-6.8 {SpinboxComputeGeometry procedure} -constraints {
    fonts
} -setup {
    spinbox .e -highlightthickness 2
    pack .e
} -body {
    .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0
    .e configure -font {Helvetica -24} -borderwidth 3 -relief raised -width 0
    .e insert end "01234567"
    update
    list [winfo reqwidth .e] [winfo reqheight .e]
} -cleanup {
    destroy .e
} -result {133 39}
test spinbox-6.9 {SpinboxComputeGeometry procedure} -constraints {
    fonts
} -setup {
    spinbox .e -highlightthickness 2
    pack .e
} -body {
    .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0
    .e configure -font {Helvetica -24} -borderwidth 3 -relief raised -width 0
    update
    list [winfo reqwidth .e] [winfo reqheight .e]
} -cleanup {
    destroy .e
} -result {42 39}


test spinbox-7.1 {InsertChars procedure} -setup {
    unset -nocomplain contents
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e configure -textvariable contents -xscrollcommand scroll
    .e insert 0 abcde
    update idletasks
    set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
    .e insert 2 XXX
    vwait scrollInfo
    list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
    destroy .e
    after cancel $timeout
} -result {abXXXcde abXXXcde {0.000000 1.000000}}

test spinbox-7.2 {InsertChars procedure} -setup {
    unset -nocomplain contents
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e configure -textvariable contents -xscrollcommand scroll
    .e insert 0 abcde
    update idletasks
    set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
    .e insert 500 XXX
    vwait scrollInfo
    list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
    destroy .e
    after cancel $timeout
} -result {abcdeXXX abcdeXXX {0.000000 1.000000}}
test spinbox-7.3 {InsertChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 0123456789
    .e select from 2
    .e select to 6
    .e insert 2 XXX
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 8
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {5 9 5 8}
test spinbox-7.4 {InsertChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 0123456789
    .e select from 2
    .e select to 6
    .e insert 3 XXX
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 8
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {2 9 2 8}
test spinbox-7.5 {InsertChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 0123456789
    .e select from 2
    .e select to 6
    .e insert 5 XXX
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 8
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {2 9 2 8}
test spinbox-7.6 {InsertChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 0123456789
    .e select from 2
    .e select to 6
    .e insert 6 XXX
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 5
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {2 6 2 5}
test spinbox-7.7 {InsertChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e configure -xscrollcommand scroll
    .e insert 0 0123456789
    .e icursor 4
    .e insert 4 XXX
    .e index insert
} -cleanup {
    destroy .e
} -result 7
test spinbox-7.8 {InsertChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 0123456789
    .e icursor 4
    .e insert 5 XXX
    .e index insert
} -cleanup {
    destroy .e
} -result 4
test spinbox-7.9 {InsertChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 "This is a very long string"
    update
    .e xview 4
    .e insert 3 XXX
    .e index @0
} -cleanup {
    destroy .e
} -result 7
test spinbox-7.10 {InsertChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 "This is a very long string"
    update
    .e xview 4
    .e insert 4 XXX
    .e index @0
} -cleanup {
    destroy .e
} -result 4

test spinbox-7.11 {InsertChars procedure} -constraints {
    fonts
} -setup {
    spinbox .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 0 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 "xyzzy"
    update
    .e insert 2 00
    winfo reqwidth .e
} -cleanup {
    destroy .e
} -result 70

test spinbox-8.1 {DeleteChars procedure} -setup {
    unset -nocomplain contents
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e configure -textvariable contents -xscrollcommand scroll
    .e insert 0 abcde
    update idletasks
    set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
    .e delete 2 4
    vwait scrollInfo
    list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
    destroy .e
    after cancel $timeout
} -result {abe abe {0.000000 1.000000}}
test spinbox-8.2 {DeleteChars procedure} -setup {
    unset -nocomplain contents
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e configure -textvariable contents -xscrollcommand scroll
    .e insert 0 abcde
    update idletasks
    set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
    .e delete -1 2
    vwait scrollInfo
    list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
    destroy .e
    after cancel $timeout
} -result {cde cde {0.000000 1.000000}}
test spinbox-8.3 {DeleteChars procedure} -setup {
    unset -nocomplain contents
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e configure -textvariable contents -xscrollcommand scroll
    .e insert 0 abcde
    update idletasks
    set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
    .e delete 3 1000
    vwait scrollInfo
    list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
    destroy .e
    after cancel $timeout
} -result {abc abc {0.000000 1.000000}}
test spinbox-8.4 {DeleteChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 3
    .e select to 8
    .e delete 1 3
    update
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 5
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {1 6 1 5}
test spinbox-8.5 {DeleteChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 3
    .e select to 8
    .e delete 1 4
    update
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 4
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {1 5 1 4}
test spinbox-8.6 {DeleteChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 3
    .e select to 8
    .e delete 1 7
    update
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 5
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {1 2 1 5}
test spinbox-8.7 {DeleteChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 3
    .e select to 8
    .e delete 1 8
    update
    .e index sel.first
} -cleanup {
    destroy .e
} -returnCodes error -result {selection isn't in widget .e}
test spinbox-8.8 {DeleteChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 3
    .e select to 8
    .e delete 3 7
    update
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 8
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {3 4 3 8}
test spinbox-8.9 {DeleteChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 3
    .e select to 8
    .e delete 3 8
    update
    .e index sel.first
} -cleanup {
    destroy .e
} -returnCodes error -result {selection isn't in widget .e}
test spinbox-8.10 {DeleteChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 8
    .e select to 3
    .e delete 5 8
    update
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 8
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {3 5 5 8}
test spinbox-8.11 {DeleteChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e select from 8
    .e select to 3
    .e delete 8 10
    update
    set x "[.e index sel.first] [.e index sel.last]"
    .e select to 4
    lappend x [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {3 8 4 8}
test spinbox-8.12 {DeleteChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e icursor 4
    .e delete 1 4
    update
    .e index insert
} -cleanup {
    destroy .e
} -result 1
test spinbox-8.13 {DeleteChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e icursor 4
    .e delete 1 5
    update
    .e index insert
} -cleanup {
    destroy .e
} -result 1
test spinbox-8.14 {DeleteChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 0123456789abcde
    .e icursor 4
    .e delete 4 6
    update
    .e index insert
} -cleanup {
    destroy .e
} -result 4
test spinbox-8.15 {DeleteChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 "This is a very long string"
    .e xview 4
    .e delete 1 4
    update
    .e index @0
} -cleanup {
    destroy .e
} -result 1
test spinbox-8.16 {DeleteChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 "This is a very long string"
    .e xview 4
    .e delete 1 5
    update
    .e index @0
} -cleanup {
    destroy .e
} -result 1
test spinbox-8.17 {DeleteChars procedure} -setup {
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 "This is a very long string"
    .e xview 4
    .e delete 4 6
    update
    .e index @0
} -cleanup {
    destroy .e
} -result 4
test spinbox-8.18 {DeleteChars procedure} -constraints failsOnUbuntuNoXft -setup {
    spinbox .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2
    spinbox .e -width 0 -font {Courier -12} -highlightthickness 2 -borderwidth 2
    pack .e
    focus .e
} -body {
    .e insert 0 "xyzzy"
    update
    .e delete 2 4
    # To check that deletion actually happened we measure the new width
2661
2662
2663
2664
2665
2666
2667
2668

2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679

2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692

2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705

2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718

2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733

2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749

2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764

2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778

2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790

2791
2792
2793

2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810

2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827

2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840

2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853

2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874

2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893

2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910

2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930

2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948

2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965

2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982

2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002

3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022

3023
3024
3025
3026
3027
3028
3029
2662
2663
2664
2665
2666
2667
2668

2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679

2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692

2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705

2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718

2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733

2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749

2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764

2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778

2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790

2791
2792
2793

2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810

2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827

2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840

2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853

2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874

2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893

2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910

2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930

2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948

2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965

2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982

2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002

3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022

3023
3024
3025
3026
3027
3028
3029
3030







-
+










-
+












-
+












-
+












-
+














-
+















-
+














-
+













-
+











-
+


-
+
















-
+
















-
+












-
+












-
+




















-
+


















-
+
















-
+



















-
+

















-
+
















-
+
















-
+



















-
+



















-
+







    trace vdelete x w override
} -result {12345 12345}


test spinbox-10.1 {SpinboxSetValue procedure} -constraints fonts -body {
    set x abcde
    set y ab
    spinbox .e  -font {Helvetica -12} -highlightthickness 2 -bd 2  -width 0
    spinbox .e  -font {Helvetica -12} -highlightthickness 2 -borderwidth 2  -width 0
    pack .e
    .e configure -textvariable x
    .e configure -textvariable y
    update
    list [.e get] [winfo reqwidth .e]
} -cleanup {
    destroy .e
} -result {ab 35}
test spinbox-10.2 {SpinboxSetValue procedure, updating selection} -setup {
    unset -nocomplain x
    spinbox .e -font {Helvetica -12} -highlightthickness 2 -bd 2
    spinbox .e -font {Helvetica -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e configure -textvariable x
    .e insert 0 "abcdefghjklmnopqrstu"
    .e selection range 4 10
    set x "a"
    .e index sel.first
} -cleanup {
    destroy .e
} -returnCodes error -result {selection isn't in widget .e}
test spinbox-10.3 {SpinboxSetValue procedure, updating selection} -setup {
    unset -nocomplain x
    spinbox .e -font {Helvetica -12} -highlightthickness 2 -bd 2
    spinbox .e -font {Helvetica -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e configure -textvariable x
    .e insert 0 "abcdefghjklmnopqrstu"
    .e selection range 4 10
    set x "abcdefg"
    list [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {4 7}
test spinbox-10.4 {SpinboxSetValue procedure, updating selection} -setup {
    unset -nocomplain x
    spinbox .e -font {Helvetica -12} -highlightthickness 2 -bd 2
    spinbox .e -font {Helvetica -12} -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e configure -textvariable x
    .e insert 0 "abcdefghjklmnopqrstu"
    .e selection range 4 10
    set x "abcdefghijklmn"
    list [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {4 10}
test spinbox-10.5 {SpinboxSetValue procedure, updating display position} -setup {
    unset -nocomplain x
    spinbox .e -highlightthickness 2 -bd 2
    spinbox .e -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e configure -width 10 -font {Courier -12} -textvariable x
    .e insert 0 "abcdefghjklmnopqrstuvwxyz"
    .e xview 10
    update
    set x "abcdefg"
    update
    .e index @0
} -cleanup {
    destroy .e
} -result 0
test spinbox-10.6 {SpinboxSetValue procedure, updating display position} -setup {
    unset -nocomplain x
    spinbox .e -highlightthickness 2 -bd 2
    spinbox .e -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e configure -width 10 -font {Courier -12} -textvariable x
    pack .e
    .e insert 0 "abcdefghjklmnopqrstuvwxyz"
    .e xview 10
    update
    set x "1234567890123456789012"
    update
    .e index @0
} -cleanup {
    destroy .e
} -result 10
test spinbox-10.7 {SpinboxSetValue procedure, updating insertion cursor} -setup {
    unset -nocomplain x
    spinbox .e -highlightthickness 2 -bd 2
    spinbox .e -highlightthickness 2 -borderwidth 2
    pack .e
    update
} -body {
    .e configure -width 10 -font {Courier -12} -textvariable x
    pack .e
    .e insert 0 "abcdefghjklmnopqrstuvwxyz"
    .e icursor 5
    set x "123"
    .e index insert
} -cleanup {
    destroy .e
} -result 3
test spinbox-10.8 {SpinboxSetValue procedure, updating insertion cursor} -setup {
    unset -nocomplain x
    spinbox .e -highlightthickness 2 -bd 2
    spinbox .e -highlightthickness 2 -borderwidth 2
    pack .e
} -body {
    .e configure -width 10 -font {Courier -12} -textvariable x
    pack .e
    .e insert 0 "abcdefghjklmnopqrstuvwxyz"
    .e icursor 5
    set x "123456"
    .e index insert
} -cleanup {
    destroy .e
} -result 5

test spinbox-11.1 {SpinboxEventProc procedure} -setup {
    spinbox .e -highlightthickness 2 -bd 2 -font {Helvetica -12}
    spinbox .e -highlightthickness 2 -borderwidth 2 -font {Helvetica -12}
    pack .e
} -body {
    .e insert 0 abcdefg
    destroy .e
    update
} -cleanup {
    destroy .e
} -result {}
test spinbox-11.2 {SpinboxEventProc procedure} -setup {
    set x {}
} -body {
    spinbox .e1 -fg #112233
    spinbox .e1 -color #112233
    rename .e1 .e2
    lappend x [winfo children .]
    lappend x [.e2 cget -fg]
    lappend x [.e2 cget -color]
    destroy .e1
    lappend x [info command .e*] [winfo children .]
} -cleanup {
    destroy .e1
} -result {.e1 #112233 {} {}}

test spinbox-12.1 {SpinboxCmdDeletedProc procedure} -body {
    button .b -text "xyz_123"
    rename .b {}
    list [info command .b*] [winfo children .]
} -cleanup {
    destroy .b
} -result {{} {}}


test spinbox-13.1 {GetSpinboxIndex procedure} -setup {
    spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
    spinbox .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
    pack .e
} -body {
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index end
} -cleanup {
    destroy .e
} -result 21
test spinbox-13.2 {GetSpinboxIndex procedure} -body {
    spinbox .e
    .e index abogus
} -cleanup {
    destroy .e
} -returnCodes error -result {bad spinbox index "abogus"}
test spinbox-13.3 {GetSpinboxIndex procedure} -setup {
    spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
    spinbox .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
    pack .e
} -body {
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e select from 1
    .e select to 6
    .e index anchor
} -cleanup {
    destroy .e
} -result 1
test spinbox-13.4 {GetSpinboxIndex procedure} -setup {
    spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
    spinbox .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
    pack .e
} -body {
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e select from 4
    .e select to 1
    .e index anchor
} -cleanup {
    destroy .e
} -result 4
test spinbox-13.5 {GetSpinboxIndex procedure} -setup {
    spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
    spinbox .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
    pack .e
} -body {
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e select from 3
    .e select to 15
    .e select adjust 4
    .e index anchor
} -cleanup {
    destroy .e
} -result 15
test spinbox-13.6 {GetSpinboxIndex procedure} -setup {
    spinbox .e
} -body {
    .e index ebogus
} -cleanup {
    destroy .e
} -returnCodes error -result {bad spinbox index "ebogus"}
test spinbox-13.7 {GetSpinboxIndex procedure} -setup {
    spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
    spinbox .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
    pack .e
} -body {
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e icursor 2
    .e index insert
} -cleanup {
    destroy .e
} -result 2
test spinbox-13.8 {GetSpinboxIndex procedure} -setup {
    spinbox .e
} -body {
    .e index ibogus
} -cleanup {
    destroy .e
} -returnCodes error -result {bad spinbox index "ibogus"}
test spinbox-13.9 {GetSpinboxIndex procedure} -setup {
    spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
    spinbox .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
    pack .e
} -body {
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e select from 1
    .e select to 6
    list [.e index sel.first] [.e index sel.last]
} -cleanup {
    destroy .e
} -result {1 6}

test spinbox-13.10 {GetSpinboxIndex procedure} -constraints x11 -body {
# On unix, when selection is cleared, spinbox widget's internal
# selection range is reset.
# Previous settings:
	spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
	spinbox .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
	pack .e
	.e insert 0 012345678901234567890
	.e xview 4
	update
    .e select from 1
    .e select to 6
    list [.e index sel.first] [.e index sel.last]
# Testing:
    selection clear .e
    .e index sel.first
} -cleanup {
    destroy .e
} -returnCodes error -result {selection isn't in widget .e}

test spinbox-13.11 {GetSpinboxIndex procedure} -constraints aquaOrWin32 -body {
# On mac and pc, when selection is cleared, spinbox widget remembers
# last selected range.  When selection ownership is restored to
# spinbox, the old range will be rehighlighted.
# Previous settings:
	spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
	spinbox .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
	pack .e
	.e insert 0 012345678901234567890
	.e xview 4
	update
    .e select from 1
    .e select to 6
    list [.e index sel.first] [.e index sel.last]
# Testing:
    selection clear .e
    catch {selection get}
    .e index sel.first
} -cleanup {
    destroy .e
} -result 1

test spinbox-13.12 {GetSpinboxIndex procedure} -constraints x11 -body {
# Previous settings:
	spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
	spinbox .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
	pack .e
	.e insert 0 012345678901234567890
	.e xview 4
	update
    .e select from 1
    .e select to 6
    list [.e index sel.first] [.e index sel.last]
# Testing:
    selection clear .e
    .e index sbogus
} -cleanup {
    destroy .e
} -returnCodes error -result {selection isn't in widget .e}

test spinbox-13.12.1 {GetSpinboxIndex procedure} -constraints unix -body {
# Previous settings:
	spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
	spinbox .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
	pack .e
	.e insert 0 012345678901234567890
	.e xview 4
	update
    .e select from 1
    .e select to 6
    list [.e index sel.first] [.e index sel.last]
# Testing:
    selection clear .e
    .e index bogus
} -cleanup {
    destroy .e
} -returnCodes error -result {bad spinbox index "bogus"}

test spinbox-13.13 {GetSpinboxIndex procedure} -constraints win -body {
# Previous settings:
	spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
	spinbox .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
	pack .e
	.e insert 0 012345678901234567890
	.e xview 4
	update
    .e select from 1
    .e select to 6
    list [.e index sel.first] [.e index sel.last]
# Testing:
    selection clear .e
    .e index sbogus
} -cleanup {
    destroy .e
} -returnCodes error -result {bad spinbox index "sbogus"}

test spinbox-13.14 {GetSpinboxIndex procedure} -constraints win -body {
# On mac and pc, when selection is cleared, spinbox widget remembers
# last selected range.  When selection ownership is restored to
# spinbox, the old range will be rehighlighted.
# Previous settings:
	spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
	spinbox .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
	pack .e
	.e insert 0 012345678901234567890
	.e xview 4
	update
    .e select from 1
    .e select to 6
    list [.e index sel.first] [.e index sel.last]
# Testing:
    selection clear .e
    selection get
} -cleanup {
    destroy .e
} -returnCodes error -match glob -result {*}

test spinbox-13.14.1 {GetSpinboxIndex procedure} -constraints win -body {
# On mac and pc, when selection is cleared, spinbox widget remembers
# last selected range.  When selection ownership is restored to
# spinbox, the old range will be rehighlighted.
# Previous settings:
	spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken
	spinbox .e -font {Courier -12} -width 5 -borderwidth 2 -relief sunken
	pack .e
	.e insert 0 012345678901234567890
	.e xview 4
	update
    .e select from 1
    .e select to 6
    list [.e index sel.first] [.e index sel.last]
3040
3041
3042
3043
3044
3045
3046
3047

3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058

3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069

3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080

3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091

3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102

3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122

3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133

3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144

3145
3146
3147
3148
3149
3150
3151
3041
3042
3043
3044
3045
3046
3047

3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058

3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069

3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080

3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091

3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102

3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122

3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133

3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144

3145
3146
3147
3148
3149
3150
3151
3152







-
+










-
+










-
+










-
+










-
+










-
+



















-
+










-
+










-
+







    selection clear .e
    .e index @xyz
} -cleanup {
    destroy .e
} -returnCodes error -result {bad spinbox index "@xyz"}

test spinbox-13.16 {GetSpinboxIndex procedure} -constraints fonts -body {
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2 \
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index @4
} -cleanup {
    destroy .e
} -result 4
test spinbox-13.17 {GetSpinboxIndex procedure} -constraints fonts -body {
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2 \
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index @11
} -cleanup {
    destroy .e
} -result 4
test spinbox-13.18 {GetSpinboxIndex procedure} -constraints fonts -body {
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2 \
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index @12
} -cleanup {
    destroy .e
} -result 5
test spinbox-13.19 {GetSpinboxIndex procedure} -constraints fonts -body {
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2 \
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index @[expr {[winfo width .e] - 6-11}]
} -cleanup {
    destroy .e
} -result 8
test spinbox-13.20 {GetSpinboxIndex procedure} -constraints fonts -body {
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2 \
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index @[expr {[winfo width .e] - 5}]
} -cleanup {
    destroy .e
} -result 9
test spinbox-13.21 {GetSpinboxIndex procedure} -body {
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2 \
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index @1000
} -cleanup {
    destroy .e
} -result 9
test spinbox-13.22 {GetSpinboxIndex procedure} -setup {
    spinbox .e
    pack .e
    update
} -body {
    .e index 1xyz
} -cleanup {
    destroy .e
} -returnCodes error -result {bad spinbox index "1xyz"}
test spinbox-13.23 {GetSpinboxIndex procedure} -body {
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2 \
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index -1
} -cleanup {
    destroy .e
} -result 0
test spinbox-13.24 {GetSpinboxIndex procedure} -body {
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2 \
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index 12
} -cleanup {
    destroy .e
} -result 12
test spinbox-13.25 {GetSpinboxIndex procedure} -body {
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \
    spinbox .e -width 5 -relief sunken -highlightthickness 2 -borderwidth 2 \
        -font {Courier -12}
    pack .e
    .e insert 0 012345678901234567890
    .e xview 4
    update
    .e index 49
} -cleanup {
3293
3294
3295
3296
3297
3298
3299
3300

3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315

3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331

3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347

3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363

3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379

3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396

3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413

3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432

3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453

3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471

3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492

3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510

3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529

3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548

3549
3550
3551
3552
3553
3554
3555
3294
3295
3296
3297
3298
3299
3300

3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315

3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331

3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347

3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363

3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379

3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396

3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413

3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432

3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453

3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471

3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492

3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510

3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529

3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548

3549
3550
3551
3552
3553
3554
3555
3556







-
+














-
+















-
+















-
+















-
+















-
+
















-
+
















-
+


















-
+




















-
+

















-
+




















-
+

















-
+


















-
+


















-
+







test spinbox-19.1 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert 0 a
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e 1 0 a {} a all key}

test spinbox-19.2 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert 0 a   ;# previous settings
    .e insert 1 b
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e 1 1 ab a b all key}

test spinbox-19.3 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert 0 ab   ;# previous settings
    .e insert end c
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e 1 2 abc ab c all key}

test spinbox-19.4 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert 0 abc   ;# previous settings
    .e insert 1 123
    list $::vVals $::e
} -cleanup {
    destroy .e
} -result {{.e 1 1 a123bc abc 123 all key} a123bc}

test spinbox-19.5 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert 0 a123bc   ;# previous settings
    .e delete 2
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e 0 2 a13bc a123bc 2 all key}

test spinbox-19.6 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert 0 a13bc   ;# previous settings
    .e configure -validate key
    .e delete 1 3
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e 0 1 abc a13bc 13 key key}

test spinbox-19.7 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate focus \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abc                 ;# previous settings
    set ::vVals {}
    .e insert end d
    set ::vVals
} -cleanup {
    destroy .e
} -result {}

test spinbox-19.8 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e configure -validate focus    ;# previous settings
    .e insert end abcd              ;# previous settings
    focus -force .e
# update necessary to process FocusIn event
    update
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e -1 -1 abcd abcd {} focus focusin}

test spinbox-19.9 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate focus \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd      ;# previous settings
    focus -force .e         ;# previous settings
    update                  ;# previous settings
# update necessary to process FocusIn event
    focus -force .
# update necessary to process FocusOut event
    update
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e -1 -1 abcd abcd {} focus focusout}

test spinbox-19.10 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd          ;# previous settings
    focus -force .e
# update necessary to process FocusIn event
    update
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e -1 -1 abcd abcd {} all focusin}

test spinbox-19.11 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd          ;# previous settings
    focus -force .e             ;# previous settings
# update necessary to process FocusIn event
    update                      ;# previous settings
    focus -force .
# update necessary to process FocusOut event
    update
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e -1 -1 abcd abcd {} all focusout}

test spinbox-19.12 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate focusin \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert 0 abcd              ;# previous settings
    focus -force .e
# update necessary to process FocusIn event
    update
    set ::vVals
} -cleanup {
    destroy .e
} -result {.e -1 -1 abcd abcd {} focusin focusin}

test spinbox-19.13 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate focusin \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd              ;# previous settings
    set ::vVals {}
    focus -force .
# update necessary to process FocusOut event
    update
    set ::vVals
} -cleanup {
    destroy .e
} -result {}

test spinbox-19.14 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate focuso \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd              ;# previous settings
    set ::vVals {}                  ;# previous settings
    focus -force .e
# update necessary to process FocusIn event
    update
    set ::vVals
} -cleanup {
    destroy .e
} -result {}

test spinbox-19.15 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate focuso \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd              ;# previous settings
    set ::vVals {}                  ;# previous settings
    focus -force .e                 ;# previous settings
# update necessary to process FocusIn event
    update                          ;# previous settings
    focus -force .
3564
3565
3566
3567
3568
3569
3570
3571

3572
3573
3574
3575
3576
3577
3578
3565
3566
3567
3568
3569
3570
3571

3572
3573
3574
3575
3576
3577
3578
3579







-
+







test spinbox-19.16 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate focuso \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd              ;# previous settings
    set ::vVals {}                  ;# previous settings
    focus -force .e                 ;# previous settings
# update necessary to process FocusIn event
    update                          ;# previous settings
    focus -force .
3587
3588
3589
3590
3591
3592
3593
3594

3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612

3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633

3634
3635
3636
3637
3638
3639
3640
3588
3589
3590
3591
3592
3593
3594

3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612

3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633

3634
3635
3636
3637
3638
3639
3640
3641







-
+

















-
+




















-
+







test spinbox-19.17 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate focuso \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    .e insert end abcd              ;# previous settings
    set ::e newdata
    list [.e cget -validate] $::vVals
} -cleanup {
    destroy .e
} -result {focusout {.e -1 -1 newdata abcd {} focusout forced}}


# proc doval changed - returns 0
test spinbox-19.18 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate all \
        -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    set ::e newdata                 ;# previous settings
    .e configure -validate all
    set ::e nextdata
    list [.e cget -validate] $::vVals
} -cleanup {
    destroy .e
} -result {none {.e -1 -1 nextdata newdata {} all forced}}


## This sets validate to none because it shows that we prevent a possible
## loop condition in the validation, when the spinbox textvar is also set
# proc doval2 used
test spinbox-19.19 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate all \
        -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    set ::e nextdata                 ;# previous settings

    .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V]
    .e validate
    list [.e cget -validate] [.e get] $::vVals
} -cleanup {
3649
3650
3651
3652
3653
3654
3655
3656

3657
3658
3659
3660
3661
3662
3663
3650
3651
3652
3653
3654
3655
3656

3657
3658
3659
3660
3661
3662
3663
3664







-
+







test spinbox-19.20 {spinbox widget validation} -setup {
    unset -nocomplain ::e ::vVals
} -body {
    spinbox .e -validate all \
        -validatecommand [list doval %W %d %i %P %s %S %v %V] \
        -invalidcommand bell \
        -textvariable ::e \
        -background red -foreground white
        -background red -color white
    pack .e
    set ::e nextdata                 ;# previous settings
    .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V] ;# prev
    .e validate                     ;# previous settings

    .e configure -validate all
    set ::e testdata
Changes to tests/text.test.
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
94


95
96
97
98
99
100
101
102
103

104
105
106
107
108
109
110
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
94
95
96
97
98
99
100
101
102

103
104
105
106
107
108
109
110







-
-
+
+








-
+








-
-
+
+








-
+







    destroy .t
} -match glob -returnCodes {error} -result {*}
test text-1.5 {configuration option: "bd"} -setup {
    text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
    pack .t
    update
} -body {
    .t configure -bd 4
    .t cget -bd
    .t configure -borderwidth 4
    .t cget -borderwidth
} -cleanup {
    destroy .t
} -result 4
test text-1.6 {configuration option: "bd"} -setup {
    text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
    pack .t
    update
} -body {
    .t configure -bd foo
    .t configure -borderwidth foo
} -cleanup {
    destroy .t
} -match glob -returnCodes {error} -result {*}
test text-1.7 {configuration option: "bg"} -setup {
    text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
    pack .t
    update
} -body {
    .t configure -bg blue
    .t cget -bg
    .t configure -background blue
    .t cget -background
} -cleanup {
    destroy .t
} -result {blue}
test text-1.8 {configuration option: "bg"} -setup {
    text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
    pack .t
    update
} -body {
    .t configure -bg #xx
    .t configure -background #xx
} -cleanup {
    destroy .t
} -match glob -returnCodes {error} -result {*}
test text-1.9 {configuration option: "blockcursor"} -setup {
    text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
    pack .t
    update
181
182
183
184
185
186
187
188
189


190
191
192
193
194
195
196
197
198

199
200
201
202
203
204
205
181
182
183
184
185
186
187


188
189
190
191
192
193
194
195
196
197

198
199
200
201
202
203
204
205







-
-
+
+








-
+







    destroy .t
} -match glob -returnCodes {error} -result {*}
test text-1.17 {configuration option: "fg"} -setup {
    text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
    pack .t
    update
} -body {
    .t configure -fg red
    .t cget -fg
    .t configure -color red
    .t cget -color
} -cleanup {
    destroy .t
} -result {red}
test text-1.18 {configuration option: "fg"} -setup {
    text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
    pack .t
    update
} -body {
    .t configure -fg stupid
    .t configure -color stupid
} -cleanup {
    destroy .t
} -match glob -returnCodes {error} -result {*}
test text-1.19 {configuration option: "font"} -setup {
    text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
    pack .t
    update
214
215
216
217
218
219
220
221

222
223
224
225
226
227


228
229
230
231

232
233
234
235
236

237
238
239
240
241
242
243
214
215
216
217
218
219
220

221
222
223
224
225


226
227
228
229
230

231
232
233
234
235

236
237
238
239
240
241
242
243







-
+




-
-
+
+



-
+




-
+







    pack .t
    update
} -body {
    .t configure -font {}
} -cleanup {
    destroy .t
} -match glob -returnCodes {error} -result {*}
test text-1.21 {configuration option: "foreground"} -setup {
test text-1.21 {configuration option: "color"} -setup {
    text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
    pack .t
    update
} -body {
    .t configure -foreground #012
    .t cget -foreground
    .t configure -color #012
    .t cget -color
} -cleanup {
    destroy .t
} -result {#012}
test text-1.22 {configuration option: "foreground"} -setup {
test text-1.22 {configuration option: "color"} -setup {
    text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
    pack .t
    update
} -body {
    .t configure -foreground bogus
    .t configure -color bogus
} -cleanup {
    destroy .t
} -match glob -returnCodes {error} -result {*}
test text-1.23 {configuration option: "height"} -setup {
    text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
    pack .t
    update
546
547
548
549
550
551
552
553

554
555
556
557
558
559


560
561
562
563

564
565
566
567
568

569
570
571
572
573
574
575
546
547
548
549
550
551
552

553
554
555
556
557


558
559
560
561
562

563
564
565
566
567

568
569
570
571
572
573
574
575







-
+




-
-
+
+



-
+




-
+







    pack .t
    update
} -body {
    .t configure -selectborderwidth 3x
} -cleanup {
    destroy .t
} -match glob -returnCodes {error} -result {*}
test text-1.55 {configuration option: "selectforeground"} -setup {
test text-1.55 {configuration option: "selectcolor"} -setup {
    text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
    pack .t
    update
} -body {
    .t configure -selectforeground yellow
    .t cget -selectforeground
    .t configure -selectcolor yellow
    .t cget -selectcolor
} -cleanup {
    destroy .t
} -result {yellow}
test text-1.56 {configuration option: "selectforeground"} -setup {
test text-1.56 {configuration option: "selectcolor"} -setup {
    text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
    pack .t
    update
} -body {
    .t configure -selectforeground #12345
    .t configure -selectcolor #12345
} -cleanup {
    destroy .t
} -match glob -returnCodes {error} -result {*}
test text-1.57 {configuration option: "spacing1"} -setup {
    text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
    pack .t
    update
891
892
893
894
895
896
897
898

899
900
901
902
903
904


905
906
907
908
909
910
911
891
892
893
894
895
896
897

898
899
900
901
902


903
904
905
906
907
908
909
910
911







-
+




-
-
+
+







test text-2.4 {Tk_TextCmd procedure} -body {
    catch {text .t -gorp nofun}
    winfo exists .t
} -cleanup {
    destroy .t
} -result 0
test text-2.5 {Tk_TextCmd procedure} -body {
    text .t -bd 2 -fg red
    text .t -borderwidth 2 -color red
} -cleanup {
    destroy .t
} -returnCodes ok -result {.t}
test text-2.6 {Tk_TextCmd procedure} -body {
    text .t -bd 2 -fg red
	list [lindex [.t config -bd] 4] [lindex [.t config -fg] 4]
    text .t -borderwidth 2 -color red
	list [lindex [.t config -borderwidth] 4] [lindex [.t config -color] 4]
} -cleanup {
    destroy .t
} -result {2 red}
test text-2.7 {Tk_TextCmd procedure} -constraints {
    win
} -body {
    catch {destroy .t}
996
997
998
999
1000
1001
1002
1003
1004


1005
1006
1007
1008
1009
1010
1011
996
997
998
999
1000
1001
1002


1003
1004
1005
1006
1007
1008
1009
1010
1011







-
-
+
+







    .t cget -gorp
} -cleanup {
    destroy .t
} -returnCodes {error} -result {unknown option "-gorp"}
test text-5.4 {TextWidgetCmd procedure, "cget" option} -setup {
    text .t
} -body {
    .t configure -bd 17
    .t cget -bd
    .t configure -borderwidth 17
    .t cget -borderwidth
} -cleanup {
    destroy .t
} -result 17


test text-6.1 {TextWidgetCmd procedure, "compare" option} -setup {
    text .t
2705
2706
2707
2708
2709
2710
2711
2712

2713
2714
2715
2716
2717
2718
2719
2705
2706
2707
2708
2709
2710
2711

2712
2713
2714
2715
2716
2717
2718
2719







-
+







    .t configure -wrap none
    set res [.t count -displaylines 2.0 3.0]
} -cleanup {
    destroy .t
} -result 0
test text-10.41 {TextWidgetCmd procedure, "count" option} -setup {
    toplevel .mytop
    pack [text .mytop.t -font TkFixedFont -bd 0 -padx 0 -wrap char]
    pack [text .mytop.t -font TkFixedFont -borderwidth 0 -padx 0 -wrap char]
    set spec [font measure TkFixedFont "Line 1+++Line 1---Li"]  ; # 20 chars
    append spec x300+0+0
    wm geometry .mytop $spec
    .mytop.t delete 1.0 end
    update
    set res {}
} -body {
3363
3364
3365
3366
3367
3368
3369
3370

3371
3372
3373

3374
3375
3376
3377
3378
3379
3380
3363
3364
3365
3366
3367
3368
3369

3370
3371
3372

3373
3374
3375
3376
3377
3378
3379
3380







-
+


-
+







    .t configure -wrap bogus
} -cleanup {
    destroy .t
} -returnCodes {error} -result {bad wrap "bogus": must be char, none, or word}
test text-14.9 {ConfigureText procedure} -setup {
    text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
} -body {
    .t configure -selectborderwidth 17 -selectforeground #332211 \
    .t configure -selectborderwidth 17 -selectcolor #332211 \
	    -selectbackground #abc
    list [lindex [.t tag config sel -borderwidth] 4] \
	   [lindex [.t tag config sel -foreground] 4] \
	   [lindex [.t tag config sel -color] 4] \
	   [lindex [.t tag config sel -background] 4]
} -cleanup {
    destroy .t
} -result {17 #332211 #abc}
test text-14.10 {ConfigureText procedure} -setup {
    text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2
} -body {
3544
3545
3546
3547
3548
3549
3550
3551

3552
3553
3554
3555

3556
3557
3558
3559
3560
3561
3562
3544
3545
3546
3547
3548
3549
3550

3551
3552
3553
3554

3555
3556
3557
3558
3559
3560
3561
3562







-
+



-
+







    lappend result [winfo reqheight .t]
} -cleanup {
    destroy .t
} -result {140 160 170 150}


test text-16.1 {TextEventProc procedure} -body {
    text .tx1 -bg #543210
    text .tx1 -background #543210
    rename .tx1 .tx2
    set x {}
    lappend x [winfo exists .tx1]
    lappend x [.tx2 cget -bg]
    lappend x [.tx2 cget -background]
    destroy .tx1
    lappend x [info command .tx*] [winfo exists .tx1] [winfo exists .tx2]
} -cleanup {
    destroy .txt1
} -result {1 #543210 {} 0 0}


3869
3870
3871
3872
3873
3874
3875
3876

3877
3878
3879
3880
3881
3882
3883
3869
3870
3871
3872
3873
3874
3875

3876
3877
3878
3879
3880
3881
3882
3883







-
+







    .top.t index @0,0
} -cleanup {
    destroy .top
} -result {1.1}
test text-19.16 {DeleteChars procedure, updates affecting topIndex} -setup {
    toplevel .top
    text .top.t -width 6 -height 10 -wrap word
    frame .top.f -width 200 -height 20 -relief raised -bd 2
    frame .top.f -width 200 -height 20 -relief raised -borderwidth 2
    pack .top.f .top.t -side left
    wm geometry .top +0+0
    update
} -body {
    .top.t insert end "abc def\n01 2a345 678 9101112\nLine 3\nLine 4\nLine 5\n6\n7\n8\n"
    .top.t yview 2.4
    .top.t delete 2.5
4318
4319
4320
4321
4322
4323
4324
4325

4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338

4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351

4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364

4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377

4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390

4391
4392
4393
4394
4395
4396
4397
4318
4319
4320
4321
4322
4323
4324

4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337

4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350

4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363

4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376

4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389

4390
4391
4392
4393
4394
4395
4396
4397







-
+












-
+












-
+












-
+












-
+












-
+







test text-22.41 {TextSearchCmd procedure, firstChar and lastChar} -setup {
    toplevel .top
    text .top.t -width 30 -height 10 -font {Courier -12} -borderwidth 2 -highlightthickness 2
    pack .top.t
} -body {
    .top.t insert 1.0 "This is a line\nand this is another"
    .top.t insert end "\nand this is yet another"
    frame .top.f -width 20 -height 20 -bd 2 -relief raised
    frame .top.f -width 20 -height 20 -borderwidth 2 -relief raised
    .top.t window create 2.5 -window .top.f
    .top.t search his 2.6
} -cleanup {
    destroy .top
} -result {2.6}
test text-22.42 {TextSearchCmd procedure, firstChar and lastChar} -setup {
    toplevel .top
    text .top.t -width 30 -height 10 -font {Courier -12} -borderwidth 2 -highlightthickness 2
    pack .top.t
} -body {
    .top.t insert 1.0 "This is a line\nand this is another"
    .top.t insert end "\nand this is yet another"
    frame .top.f -width 20 -height 20 -bd 2 -relief raised
    frame .top.f -width 20 -height 20 -borderwidth 2 -relief raised
    .top.t window create 2.5 -window .top.f
    .top.t search this 2.6
} -cleanup {
    destroy .top
} -result {3.4}
test text-22.43 {TextSearchCmd procedure, firstChar and lastChar} -setup {
    toplevel .top
    text .top.t -width 30 -height 10 -font {Courier -12} -borderwidth 2 -highlightthickness 2
    pack .top.t
} -body {
    .top.t insert 1.0 "This is a line\nand this is another"
    .top.t insert end "\nand this is yet another"
    frame .top.f -width 20 -height 20 -bd 2 -relief raised
    frame .top.f -width 20 -height 20 -borderwidth 2 -relief raised
    .top.t window create 2.5 -window .top.f
    .top.t search is 2.6
} -cleanup {
    destroy .top
} -result {2.7}
test text-22.44 {TextSearchCmd procedure, firstChar and lastChar} -setup {
    toplevel .top
    text .top.t -width 30 -height 10 -font {Courier -12} -borderwidth 2 -highlightthickness 2
    pack .top.t
} -body {
    .top.t insert 1.0 "This is a line\nand this is another"
    .top.t insert end "\nand this is yet another"
    frame .top.f -width 20 -height 20 -bd 2 -relief raised
    frame .top.f -width 20 -height 20 -borderwidth 2 -relief raised
    .top.t window create 2.5 -window .top.f
    .top.t search his 2.7
} -cleanup {
    destroy .top
} -result {3.5}
test text-22.45 {TextSearchCmd procedure, firstChar and lastChar} -setup {
    toplevel .top
    text .top.t -width 30 -height 10 -font {Courier -12} -borderwidth 2 -highlightthickness 2
    pack .top.t
} -body {
    .top.t insert 1.0 "This is a line\nand this is another"
    .top.t insert end "\nand this is yet another"
    frame .top.f -width 20 -height 20 -bd 2 -relief raised
    frame .top.f -width 20 -height 20 -borderwidth 2 -relief raised
    .top.t window create 2.5 -window .top.f
    .top.t search -backwards "his is another" 2.6
} -cleanup {
    destroy .top
} -result {2.6}
test text-22.46 {TextSearchCmd procedure, firstChar and lastChar} -setup {
    toplevel .top
    text .top.t -width 30 -height 10 -font {Courier -12} -borderwidth 2 -highlightthickness 2
    pack .top.t
} -body {
    .top.t insert 1.0 "This is a line\nand this is another"
    .top.t insert end "\nand this is yet another"
    frame .top.f -width 20 -height 20 -bd 2 -relief raised
    frame .top.f -width 20 -height 20 -borderwidth 2 -relief raised
    .top.t window create 2.5 -window .top.f
    .top.t search -backwards "his is" 2.6
} -cleanup {
    destroy .top
} -result {1.1}
test text-22.47 {TextSearchCmd procedure, firstChar and lastChar} -body {
    text .t
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468




4469
4470
4471
4472
4473
4474
4475
4458
4459
4460
4461
4462
4463
4464




4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475







-
-
-
-
+
+
+
+







      [.t search -backwards -strict bar 2.14 2.13] \
      [.t search -backwards -strict bar 2.13 2.13]
} -cleanup {
    destroy .t
} -result {2.13 {} {} {}}
test text-22.55 {TextSearchCmd procedure, embedded windows and index/count} -setup {
    text .t
    frame .t.f1 -width 20 -height 20 -relief raised -bd 2
    frame .t.f2 -width 20 -height 20 -relief raised -bd 2
    frame .t.f3 -width 20 -height 20 -relief raised -bd 2
    frame .t.f4 -width 20 -height 20 -relief raised -bd 2
    frame .t.f1 -width 20 -height 20 -relief raised -borderwidth 2
    frame .t.f2 -width 20 -height 20 -relief raised -borderwidth 2
    frame .t.f3 -width 20 -height 20 -relief raised -borderwidth 2
    frame .t.f4 -width 20 -height 20 -relief raised -borderwidth 2
    set result ""
} -body {
    .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx"
    .t window create 2.10 -window .t.f3
    .t window create 2.8 -window .t.f2
    .t window create 2.8 -window .t.f1
    .t window create 2.1 -window .t.f4
6106
6107
6108
6109
6110
6111
6112
6113

6114
6115
6116
6117
6118
6119
6120
6121
6122

6123
6124
6125
6126
6127
6128
6129
6130
6131

6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142

6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156

6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170

6171
6172
6173
6174
6175
6176
6177
6178
6179

6180
6181
6182
6183
6184
6185
6186
6106
6107
6108
6109
6110
6111
6112

6113
6114
6115
6116
6117
6118
6119
6120
6121

6122
6123
6124
6125
6126
6127
6128
6129
6130

6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141

6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155

6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169

6170
6171
6172
6173
6174
6175
6176
6177
6178

6179
6180
6181
6182
6183
6184
6185
6186







-
+








-
+








-
+










-
+













-
+













-
+








-
+







    lappend res [.t search -backwards a end]       ; # works
    lappend res [.t search -backwards -all a end]  ; # used to hang
} -cleanup {
    destroy .t
} -result {1.1 1.0 1.0}

test text-23.1 {TkTextGetTabs procedure} -setup {
    text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
    text .t -highlightthickness 0 -borderwidth 0 -relief flat -padx 0 -width 100
    pack .t
} -body {
    .t insert end "1\t2\t3\t4\t55.5"
    .t configure -tabs "\{{}"
} -cleanup {
    destroy .t
} -returnCodes {error} -result {unmatched open brace in list}
test text-23.2 {TkTextGetTabs procedure} -setup {
    text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
    text .t -highlightthickness 0 -borderwidth 0 -relief flat -padx 0 -width 100
    pack .t
} -body {
    .t insert end "1\t2\t3\t4\t55.5"
    .t configure -tabs xyz
} -cleanup {
    destroy .t
} -returnCodes {error} -result {bad screen distance "xyz"}
test text-23.3 {TkTextGetTabs procedure} -setup {
    text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
    text .t -highlightthickness 0 -borderwidth 0 -relief flat -padx 0 -width 100
    pack .t
} -body {
    .t insert end "1\t2\t3\t4\t55.5"
    .t configure -tabs {100 200}
    update idletasks
    list [lindex [.t bbox 1.2] 0] [lindex [.t bbox 1.4] 0]
} -cleanup {
    destroy .t
} -result {100 200}
test text-23.4 {TkTextGetTabs procedure} -setup {
    text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
    text .t -highlightthickness 0 -borderwidth 0 -relief flat -padx 0 -width 100
    pack .t
} -body {
    .t insert end "1\t2\t3\t4\t55.5"
    .t configure -tabs {100 right 200 left 300 center 400 numeric}
    update idletasks
    list [expr {[lindex [.t bbox 1.2] 0] + [lindex [.t bbox 1.2] 2]}] \
	    [lindex [.t bbox 1.4] 0] \
	    [expr {[lindex [.t bbox 1.6] 0] + [lindex [.t bbox 1.6] 2]/2}] \
	    [lindex [.t bbox 1.10] 0]
} -cleanup {
    destroy .t
} -result {100 200 300 400}
test text-23.5 {TkTextGetTabs procedure} -setup {
    text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
    text .t -highlightthickness 0 -borderwidth 0 -relief flat -padx 0 -width 100
    pack .t
} -body {
    .t insert end "1\t2\t3\t4\t55.5"
    .t configure -tabs {105 r 205 l 305 c 405 n}
    update idletasks
    list [expr {[lindex [.t bbox 1.2] 0] + [lindex [.t bbox 1.2] 2]}] \
	    [lindex [.t bbox 1.4] 0] \
	    [expr {[lindex [.t bbox 1.6] 0] + [lindex [.t bbox 1.6] 2]/2}] \
	    [lindex [.t bbox 1.10] 0]
} -cleanup {
    destroy .t
} -result {105 205 305 405}
test text-23.6 {TkTextGetTabs procedure} -setup {
    text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
    text .t -highlightthickness 0 -borderwidth 0 -relief flat -padx 0 -width 100
    pack .t
} -body {
    .t insert end "1\t2\t3\t4\t55.5"
    .t configure -tabs {100 left 200 lork}
} -cleanup {
    destroy .t
} -returnCodes {error} -result {bad tab alignment "lork": must be left, right, center, or numeric}
test text-23.7 {TkTextGetTabs procedure} -setup {
    text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
    text .t -highlightthickness 0 -borderwidth 0 -relief flat -padx 0 -width 100
    pack .t
} -body {
    .t insert end "1\t2\t3\t4\t55.5"
    .t configure -tabs {100 !44 200 lork}
} -cleanup {
    destroy .t
} -returnCodes {error} -result {bad screen distance "!44"}
Changes to tests/textBTree.test.
37
38
39
40
41
42
43
44

45
46
47
48
49
50
51
37
38
39
40
41
42
43

44
45
46
47
48
49
50
51







-
+







    .t tag add x 1.3 1.8
}

# setup procedure for tests 16.*, 17.*, 18.9
proc setupBig {} {
    .t delete 1.0 end
    .t tag delete x y
    .t tag configure x -foreground blue
    .t tag configure x -color blue
    .t tag configure y -underline true
    # Create a Btree with 2002 lines (2000 + already existing + phantom at end)
    # This generates a level 3 node with 9 children
    # Most level 2 nodes cover 216 lines and have 6 children, except the last
    # level 2 node covers 274 lines and has 7 children.
    # Most level 1 nodes cover 36 lines and have 6 children, except the
    # rightmost node has 58 lines and 9 children.
Changes to tests/textDisp.test.
223
224
225
226
227
228
229
230

231
232
233
234
235
236
237
223
224
225
226
227
228
229

230
231
232
233
234
235
236
237







-
+







} {}

test textDisp-1.1 {GetStyle procedure, priorities and tab stops} {
    .t delete 1.0 end
    .t insert 1.0 "x\ty"
    .t tag delete x y z
    .t tag configure x -tabs 50
    .t tag configure y -foreground black
    .t tag configure y -color black
    .t tag configure z -tabs 70
    .t tag add x 1.0 1.end
    .t tag add y 1.0 1.end
    .t tag add z 1.0 1.end
    update idletasks
    set x [lindex [.t bbox 1.2] 0]
    .t tag configure z -tabs {}
708
709
710
711
712
713
714
715

716
717
718
719
720
721
722
708
709
710
711
712
713
714

715
716
717
718
719
720
721
722







-
+







    .t delete 14.0 end
    updateText
    list [.t index @0,0] $tk_textRelayout $tk_textRedraw
} {6.40 {13.0 7.0 6.80 6.60 6.40} {6.40 6.60 6.80 7.0 13.0}}
test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} {
    .t delete 1.0 end
    .t insert end "1\n2\n3\n4\n5\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16"
    button .b -text "Test" -bd 2 -highlightthickness 2
    button .b -text "Test" -borderwidth 2 -highlightthickness 2
    .t window create 3.end -window .b
    .t yview moveto 1
    updateText
    .t yview moveto 0
    updateText
    .t yview moveto 1
    updateText
838
839
840
841
842
843
844
845
846
847
848




849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865

866
867
868
869
870
871
872
838
839
840
841
842
843
844




845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864

865
866
867
868
869
870
871
872







-
-
-
-
+
+
+
+
















-
+







} [list [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 115 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
test textDisp-5.1 {DisplayDLine, handling of spacing} {textfonts} {
    .t configure -wrap char
    .t delete 1.0 end
    .t insert 1.0 "abcdefghijkl\nmnopqrstuvwzyz"
    .t tag configure spacing -spacing1 8 -spacing3 2
    .t tag add spacing 1.0 end
    frame .t.f1 -width 10 -height 4 -bg black
    frame .t.f2 -width 10 -height 4 -bg black
    frame .t.f3 -width 10 -height 4 -bg black
    frame .t.f4 -width 10 -height 4 -bg black
    frame .t.f1 -width 10 -height 4 -background black
    frame .t.f2 -width 10 -height 4 -background black
    frame .t.f3 -width 10 -height 4 -background black
    frame .t.f4 -width 10 -height 4 -background black
    .t window create 1.3 -window .t.f1 -align top
    .t window create 1.7 -window .t.f2 -align center
    .t window create 2.1 -window .t.f3 -align bottom
    .t window create 2.10 -window .t.f4 -align baseline
    updateText
    list [winfo geometry .t.f1] [winfo geometry .t.f2] \
	    [winfo geometry .t.f3] [winfo geometry .t.f4]
} [list 10x4+24+11 10x4+55+[expr {$fixedDiff/2 + 15}] 10x4+10+[expr {2*$fixedDiff + 43}] 10x4+76+[expr {2*$fixedDiff + 40}]]
.t tag delete spacing

# Although the following test produces a useful result, its main
# effect is to produce a core dump if Tk doesn't handle display
# relayout that occurs during redisplay.

test textDisp-5.2 {DisplayDLine, line resizes during display} {
    .t delete 1.0 end
    frame .t.f -width 20 -height 20 -bd 2 -relief raised
    frame .t.f -width 20 -height 20 -borderwidth 2 -relief raised
    bind .t.f <Configure> {.t.f configure -width 30 -height 30}
    .t window create insert -window .t.f
    updateText
    list [winfo width .t.f] [winfo height .t.f]
} [list 30 30]

.t configure -wrap char
916
917
918
919
920
921
922
923

924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939

940
941

942
943
944
945
946
947
948
949
950
951
952
953

954
955
956
957
958
959
960
916
917
918
919
920
921
922

923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938

939
940

941
942
943
944
945
946
947
948
949
950
951
952

953
954
955
956
957
958
959
960







-
+















-
+

-
+











-
+







    .t insert 2.end "is so long that it wraps around, not once but three times"
    .t insert 4.end "is so long that it wraps"
    updateText
    list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20 2.40 2.60 4.0 4.20} {2.0 2.20 2.40 2.60 4.0 4.20 6.0}}
test textDisp-6.5 {scrolling in DisplayText, scroll source obscured} {nonPortable} {
    .t configure -wrap char
    frame .f2 -bg red
    frame .f2 -background red
    place .f2 -in .t -relx 0.5 -rely 0.5 -relwidth 0.5 -relheight 0.5
    .t delete 1.0 end
    .t insert 1.0 "Line 1 is so long that it wraps around, a couple of times"
    foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
	.t insert end "\nLine $i"
    }
    updateText
    .t delete 1.6 1.end
    updateText
    destroy .f2
    list $tk_textRelayout $tk_textRedraw
} {{1.0 9.0 10.0} {1.0 4.0 5.0 9.0 10.0}}
test textDisp-6.6 {scrolling in DisplayText, Expose events after scroll} {unix nonPortable} {
    # this test depends on all of the expose events being handled at once
    .t configure -wrap char
    frame .f2 -bg #ff0000
    frame .f2 -background #ff0000
    place .f2 -in .t -relx 0.2 -rely 0.5 -relwidth 0.5 -relheight 0.5
    .t configure -bd 2 -relief raised
    .t configure -borderwidth 2 -relief raised
    .t delete 1.0 end
    .t insert 1.0 "Line 1 is so long that it wraps around, a couple of times"
    foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
	.t insert end "\nLine $i"
    }
    updateText
    .t delete 1.6 1.end
    destroy .f2
    updateText
    list $tk_textRelayout $tk_textRedraw
} {{1.0 9.0 10.0} {borders 1.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0}}
.t configure -bd 0
.t configure -borderwidth 0
test textDisp-6.7 {DisplayText, vertical scrollbar updates} {
    .t configure -wrap char
    .t delete 1.0 end
    updateText
    .t count -update -ypixels 1.0 end
    updateText
    set scrollInfo
1007
1008
1009
1010
1011
1012
1013
1014

1015
1016
1017
1018
1019
1020
1021

1022
1023
1024
1025
1026
1027
1028
1029

1030
1031
1032
1033
1034
1035
1036
1037

1038
1039
1040
1041
1042
1043
1044
1045

1046
1047
1048
1049
1050
1051
1052
1053
1054

1055
1056
1057
1058
1059
1060
1061
1062
1063

1064
1065
1066
1067
1068
1069
1070
1071
1072

1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083

1084
1085
1086
1087
1088
1089
1090
1091

1092
1093
1094
1095
1096
1097
1098
1007
1008
1009
1010
1011
1012
1013

1014
1015
1016
1017
1018
1019
1020

1021
1022
1023
1024
1025
1026
1027
1028

1029
1030
1031
1032
1033
1034
1035
1036

1037
1038
1039
1040
1041
1042
1043
1044

1045
1046
1047
1048
1049
1050
1051
1052
1053

1054
1055
1056
1057
1058
1059
1060
1061
1062

1063
1064
1065
1066
1067
1068
1069
1070
1071

1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082

1083
1084
1085
1086
1087
1088
1089
1090

1091
1092
1093
1094
1095
1096
1097
1098







-
+






-
+







-
+







-
+







-
+








-
+








-
+








-
+










-
+







-
+







} {{4.0 6.0}}


# The following group of tests is marked non-portable because
# they result in a lot of extra redisplay under Ultrix.  I don't
# know why this is so.

.t configure -bd 2 -relief raised -wrap char
.t configure -borderwidth 2 -relief raised -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1 is so long that it wraps around, a couple of times"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
    .t insert end "\nLine $i"
}
test textDisp-7.1 {TkTextRedrawRegion} {nonPortable} {
    frame .f2 -bg #ff0000
    frame .f2 -background #ff0000
    place .f2 -in .t -relx 0.2 -relwidth 0.6 -rely 0.22 -relheight 0.55
    updateText
    destroy .f2
    updateText
    list $tk_textRelayout $tk_textRedraw
} {{} {1.40 2.0 3.0 4.0 5.0 6.0}}
test textDisp-7.2 {TkTextRedrawRegion} {nonPortable} {
    frame .f2 -bg #ff0000
    frame .f2 -background #ff0000
    place .f2 -in .t -relx 0 -relwidth 0.5 -rely 0 -relheight 0.5
    updateText
    destroy .f2
    updateText
    list $tk_textRelayout $tk_textRedraw
} {{} {borders 1.0 1.20 1.40 2.0 3.0}}
test textDisp-7.3 {TkTextRedrawRegion} {nonPortable} {
    frame .f2 -bg #ff0000
    frame .f2 -background #ff0000
    place .f2 -in .t -relx 0.5 -relwidth 0.5 -rely 0.5 -relheight 0.5
    updateText
    destroy .f2
    updateText
    list $tk_textRelayout $tk_textRedraw
} {{} {borders 4.0 5.0 6.0 7.0 8.0}}
test textDisp-7.4 {TkTextRedrawRegion} {nonPortable} {
    frame .f2 -bg #ff0000
    frame .f2 -background #ff0000
    place .f2 -in .t -relx 0.4 -relwidth 0.2 -rely 0 -relheight 0.2 \
	    -bordermode ignore
    updateText
    destroy .f2
    updateText
    list $tk_textRelayout $tk_textRedraw
} {{} {borders 1.0 1.20}}
test textDisp-7.5 {TkTextRedrawRegion} {nonPortable} {
    frame .f2 -bg #ff0000
    frame .f2 -background #ff0000
    place .f2 -in .t -relx 0.4 -relwidth 0.2 -rely 1.0 -relheight 0.2 \
	    -anchor s -bordermode ignore
    updateText
    destroy .f2
    updateText
    list $tk_textRelayout $tk_textRedraw
} {{} {borders 7.0 8.0}}
test textDisp-7.6 {TkTextRedrawRegion} {nonPortable} {
    frame .f2 -bg #ff0000
    frame .f2 -background #ff0000
    place .f2 -in .t -relx 0 -relwidth 0.2 -rely 0.55 -relheight 0.2 \
	    -anchor w -bordermode ignore
    updateText
    destroy .f2
    updateText
    list $tk_textRelayout $tk_textRedraw
} {{} {borders 3.0 4.0 5.0}}
test textDisp-7.7 {TkTextRedrawRegion} {nonPortable} {
    frame .f2 -bg #ff0000
    frame .f2 -background #ff0000
    place .f2 -in .t -relx 1.0 -relwidth 0.2 -rely 0.55 -relheight 0.2 \
	    -anchor e -bordermode ignore
    updateText
    destroy .f2
    updateText
    list $tk_textRelayout $tk_textRedraw
} {{} {borders 3.0 4.0 5.0}}
test textDisp-7.8 {TkTextRedrawRegion} {nonPortable} {
    .t delete 1.0 end
    .t insert 1.0 "Line 1\nLine 2\nLine 3\nLine 4\nLine 5\nLine 6\n"
    frame .f2 -bg #ff0000
    frame .f2 -background #ff0000
    place .f2 -in .t -relx 0.0 -relwidth 0.4 -rely 0.35 -relheight 0.4 \
	    -anchor nw -bordermode ignore
    updateText
    destroy .f2
    updateText
    list $tk_textRelayout $tk_textRedraw
} {{} {borders 4.0 5.0 6.0 7.0 eof}}
.t configure -bd 0
.t configure -borderwidth 0

test textDisp-8.1 {TkTextChanged: redisplay whole lines} {textfonts} {
    .t configure -wrap word
    .t delete 1.0 end
    .t insert 1.0 "Line 1\nLine 2 is so long that it wraps around, two times"
    foreach i {3 4 5 6 7 8 9 10 11 12 13 14 15} {
	.t insert end "\nLine $i"
1418
1419
1420
1421
1422
1423
1424
1425

1426
1427
1428
1429

1430
1431
1432
1433
1434

1435
1436
1437
1438
1439
1440
1441
1418
1419
1420
1421
1422
1423
1424

1425
1426
1427
1428

1429
1430
1431
1432
1433

1434
1435
1436
1437
1438
1439
1440
1441







-
+



-
+




-
+







} {}

test textDisp-10.1 {TkTextRelayoutWindow} {
    .t configure -wrap char
    .t delete 1.0 end
    .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4"
    updateText
    .t configure -bg black
    .t configure -background black
    updateText
    list $tk_textRelayout $tk_textRedraw
} {{1.0 2.0 2.20 3.0 3.20 4.0} {borders 1.0 2.0 2.20 3.0 3.20 4.0 eof}}
.t configure -bg [lindex [.t configure -bg] 3]
.t configure -background [lindex [.t configure -background] 3]
catch {destroy .top}
test textDisp-10.2 {TkTextRelayoutWindow} {
    toplevel .top -width 300 -height 200
    wm geometry .top +0+0
    text .top.t -font $fixedFont -width 20 -height 10 -relief raised -bd 2
    text .top.t -font $fixedFont -width 20 -height 10 -relief raised -borderwidth 2
    place .top.t -x 0 -y 0 -width 20 -height 20
    .top.t insert end "First line"
    .top.t see insert
    tkwait visibility .top.t
    place .top.t -width 150 -height 100
    updateText
    .top.t index @0,0
1616
1617
1618
1619
1620
1621
1622
1623

1624
1625
1626
1627
1628
1629
1630
1616
1617
1618
1619
1620
1621
1622

1623
1624
1625
1626
1627
1628
1629
1630







-
+







} {4.0}
test textDisp-11.19 {TkTextSetYView, see in elided lines} {
    .top.t delete 1.0 end
    for {set i 1} {$i < 50} {incr i} {
        .top.t insert end "Line $i\n"
    }
    # button just for having a line with a larger height
    button .top.t.b -text "Test" -bd 2 -highlightthickness 2
    button .top.t.b -text "Test" -borderwidth 2 -highlightthickness 2
    .top.t window create 21.0 -window .top.t.b
    .top.t tag add hidden 15.36 21.0
    .top.t tag configure hidden -elide true
    .top.t configure -height 15
    wm geometry .top 300x200+0+0
    # Indices 21.0, 17.0 and 15.0 are all on the same display line
    # therefore index @0,0 shall be the same for all of them
1798
1799
1800
1801
1802
1803
1804
1805

1806
1807
1808
1809
1810
1811
1812
1798
1799
1800
1801
1802
1803
1804

1805
1806
1807
1808
1809
1810
1811
1812







-
+







    .t see 30.90
    lappend x [.t bbox 30.90]
} [list [list 74 [expr {9*$fixedDiff/2 + 66}] 7 $fixedHeight] [list 138 [expr {9*$fixedDiff/2 + 66}] 7 $fixedHeight] [list 138 [expr {9*$fixedDiff/2 + 66}] 7 $fixedHeight] [list 74 [expr {9*$fixedDiff/2 + 66}] 7 $fixedHeight]]
test textDisp-13.10 {TkTextSeeCmd procedure} {} {
    # SF Bug 641778
    set w .tsee
    destroy $w
    text $w -font {Helvetica 8 normal} -bd 16
    text $w -font {Helvetica 8 normal} -borderwidth 16
    $w insert end Hello
    $w see end
    set res [$w bbox end]
    destroy $w
    set res
} {}
test textDisp-13.11 {TkTextSeeCmd procedure} {} {
2994
2995
2996
2997
2998
2999
3000
3001

3002
3003
3004
3005
3006
3007
3008
2994
2995
2996
2997
2998
2999
3000

3001
3002
3003
3004
3005
3006
3007
3008







-
+







should give answer -1; it gives me 5.

Using 8.5a4 (ActiveState beta 4) under Linux.  No problem with ActiveState beta 3.
}

toplevel .tt
pack [text .tt.u] -side right
.tt.u configure -width 30 -height 27 -wrap word -bg #FFFFFF
.tt.u configure -width 30 -height 27 -wrap word -background #FFFFFF
.tt.u insert end $message
.tt.u mark set insert 3.10
tkwait visibility .tt.u
set res [.tt.u count -displaylines 3.10 2.173]
destroy .tt
unset message
set res
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089




3090
3091
3092
3093
3094
3095
3096
3079
3080
3081
3082
3083
3084
3085




3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096







-
-
-
-
+
+
+
+







} [list {} [list 3 3 7 $fixedHeight] {} [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 136 [expr {$fixedDiff + 16}] 7 $fixedHeight] {}]
test textDisp-22.9 {TkTextCharBbox, handling of spacing} {textfonts} {
    .t configure -wrap char
    .t delete 1.0 end
    .t insert 1.0 "abcdefghijkl\nmnopqrstuvwzyz"
    .t tag configure spacing -spacing1 8 -spacing3 2
    .t tag add spacing 1.0 end
    frame .t.f1 -width 10 -height 4 -bg black
    frame .t.f2 -width 10 -height 4 -bg black
    frame .t.f3 -width 10 -height 4 -bg black
    frame .t.f4 -width 10 -height 4 -bg black
    frame .t.f1 -width 10 -height 4 -background black
    frame .t.f2 -width 10 -height 4 -background black
    frame .t.f3 -width 10 -height 4 -background black
    frame .t.f4 -width 10 -height 4 -background black
    .t window create 1.3 -window .t.f1 -align top
    .t window create 1.7 -window .t.f2 -align center
    .t window create 2.1 -window .t.f3 -align bottom
    .t window create 2.10 -window .t.f4 -align baseline
    updateText
    list [.t bbox .t.f1] [.t bbox .t.f2] [.t bbox .t.f3] [.t bbox .t.f4] \
	    [.t bbox 1.1] [.t bbox 2.9]
3145
3146
3147
3148
3149
3150
3151
3152

3153
3154
3155
3156
3157

3158
3159
3160
3161
3162
3163
3164
3145
3146
3147
3148
3149
3150
3151

3152
3153
3154
3155
3156

3157
3158
3159
3160
3161
3162
3163
3164







-
+




-
+







test textDisp-23.1 {TkTextDLineInfo} {textfonts} {
    .t config -wrap word
    .t yview 48.0
    list [.t dlineinfo 47.3] [.t dlineinfo 48.0] [.t dlineinfo 50.40] \
	    [.t dlineinfo 56.0]
} [list {} [list 3 3 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {4*$fixedDiff + 55}] 91 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}]
test textDisp-23.2 {TkTextDLineInfo} {textfonts} {
    .t config -bd 4 -wrap word
    .t config -borderwidth 4 -wrap word
    updateText
    .t yview 48.0
    .t dlineinfo 50.40
} [list 7 [expr {4*$fixedDiff + 59}] 91 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]]
.t config -bd 0
.t config -borderwidth 0
test textDisp-23.3 {TkTextDLineInfo} {textfonts} {
    .t config -wrap none
    updateText
    .t yview 48.0
    list [.t dlineinfo 50.40] [.t dlineinfo 57.3]
} [list [list 3 [expr {2*$fixedDiff + 29}] 371 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {9*$fixedDiff + 120}] 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]]]
test textDisp-23.4 {TkTextDLineInfo, cut-off lines} {textfonts} {
3377
3378
3379
3380
3381
3382
3383
3384

3385
3386
3387
3388
3389
3390
3391

3392
3393
3394
3395
3396
3397
3398
3399
3400

3401
3402
3403
3404
3405
3406
3407
3377
3378
3379
3380
3381
3382
3383

3384
3385
3386
3387
3388
3389
3390

3391
3392
3393
3394
3395
3396
3397
3398
3399

3400
3401
3402
3403
3404
3405
3406
3407







-
+






-
+








-
+







} [list [list 10 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 42 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 10 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 42 [expr {$fixedDiff + 19}] [expr {$fixedDiff + 16}]] [list 10 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 42 [expr {$fixedDiff + 15}] [expr {$fixedDiff + 10}]]]
.t configure -width 30
updateText
test textDisp-24.21 {TkTextCharLayoutProc, word breaks} {textfonts} {
    .t configure -wrap word
    .t delete 1.0 end
    .t insert 1.0 "Sample text xxxxxxx yyyyy zzzzzzz qqqqq rrrr ssss tt u vvvvv"
    frame .t.f -width 30 -height 20 -bg black
    frame .t.f -width 30 -height 20 -background black
    .t window create 1.36 -window .t.f
    .t bbox 1.26
} [list 3 [expr {$fixedDiff/2 + 19}] 7 $fixedHeight]
test textDisp-24.22 {TkTextCharLayoutProc, word breaks} {textfonts} {
    .t configure -wrap word
    .t delete 1.0 end
    frame .t.f -width 30 -height 20 -bg black
    frame .t.f -width 30 -height 20 -background black
    .t insert 1.0 "Sample text xxxxxxx yyyyyyy"
    .t window create end -window .t.f
    .t insert end "zzzzzzz qqqqq rrrr ssss tt u vvvvv"
    .t bbox 1.28
} [list 33 [expr {$fixedDiff/2 + 19}] 7 $fixedHeight]
test textDisp-24.23 {TkTextCharLayoutProc, word breaks} {textfonts} {
    .t configure -wrap word
    .t delete 1.0 end
    frame .t.f -width 30 -height 20 -bg black
    frame .t.f -width 30 -height 20 -background black
    .t insert 1.0 "Sample text xxxxxxx yyyyyyy "
    .t insert end "zzzzzzz qqqqq rrrr ssss tt"
    .t window create end -window .t.f
    .t insert end "u vvvvv"
    .t bbox .t.f
} [list 3 [expr {2*$fixedDiff + 29}] 30 20]
catch {destroy .t.f}
3421
3422
3423
3424
3425
3426
3427
3428

3429
3430
3431
3432
3433
3434
3435
3436
3437

3438
3439
3440
3441
3442
3443
3444
3421
3422
3423
3424
3425
3426
3427

3428
3429
3430
3431
3432
3433
3434
3435
3436

3437
3438
3439
3440
3441
3442
3443
3444







-
+








-
+







    .tt insert end \t9\n\t99\n\t999
    updateText
    list [.tt bbox 1.1] [.tt bbox 2.2] [.tt bbox 3.3]
} -cleanup {
    destroy .tt
} -result [list [list 38 5 7 $fixedHeight] [list 38 20 7 $fixedHeight] [list 38 35 7 $fixedHeight]]

.t configure -width 40 -bd 0 -relief flat -highlightthickness 0 -padx 0 \
.t configure -width 40 -borderwidth 0 -relief flat -highlightthickness 0 -padx 0 \
    -tabs 100
updateText
test textDisp-25.1 {CharBboxProc procedure, check tab width} {textfonts} {
    .t delete 1.0 end
    .t insert 1.0 abc\td\tfgh
    list [.t bbox 1.3] [.t bbox 1.5] [.t bbox 1.6]
} [list [list 21 1 79 $fixedHeight] [list 107 1 93 $fixedHeight] [list 200 1 7 $fixedHeight]]

.t configure -width 40 -bd 0 -relief flat -highlightthickness 0 -padx 0 \
.t configure -width 40 -borderwidth 0 -relief flat -highlightthickness 0 -padx 0 \
	-tabs {}
updateText
test textDisp-26.1 {AdjustForTab procedure, no tabs} {textfonts} {
    .t delete 1.0 end
    .t insert 1.0 a\tbcdefghij\tc\td
    list [lindex [.t bbox 1.2] 0] [lindex [.t bbox 1.12] 0] \
	    [lindex [.t bbox 1.14] 0]
3600
3601
3602
3603
3604
3605
3606
3607

3608
3609
3610
3611
3612
3613
3614
3600
3601
3602
3603
3604
3605
3606

3607
3608
3609
3610
3611
3612
3613
3614







-
+







    .t insert end "Watch the \tX and the \t\t\tY\n" moop
    set res [list [lindex [.t bbox 2.11] 0] [lindex [.t bbox 2.24] 0] \
      [lindex [.t bbox 3.11] 0] [lindex [.t bbox 3.24] 0]]
    .t configure -tabstyle tabular
    set res
} [list 112 56 112 56]

.t configure -width 20 -bd 2 -highlightthickness 2 -relief sunken -tabs {} \
.t configure -width 20 -borderwidth 2 -highlightthickness 2 -relief sunken -tabs {} \
	-wrap char
updateText
test textDisp-27.1 {SizeOfTab procedure, old-style tabs} {textfonts} {
    .t delete 1.0 end
    .t insert 1.0 a\tbcdefghij\tc\td
    list [.t bbox 1.2] [.t bbox 1.10] [.t bbox 1.12]
} [list [list 60 5 7 $fixedHeight] [list 116 5 7 $fixedHeight] [list 130 5 7 $fixedHeight]]
3779
3780
3781
3782
3783
3784
3785
3786

3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801

3802
3803
3804
3805
3806
3807
3808
3779
3780
3781
3782
3783
3784
3785

3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800

3801
3802
3803
3804
3805
3806
3807
3808







-
+














-
+







    wm geometry .t2 +0+0
    text .t2.t -width 20 -height 10 -font $fixedFont \
	    -wrap char -xscrollcommand ".t2.s set"
    pack .t2.t -side top
    scrollbar .t2.s -orient horizontal -command ".t2.t xview"
    pack .t2.s -side bottom -fill x
    .t2.t insert end 123
    frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
    frame .t2.t.f -width 300 -height 50 -borderwidth 2 -relief raised
    .t2.t window create 1.1 -window .t2.t.f
    updateText
    list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]
} [list [list 0.0 [expr {20.0*$fixedWidth/300}]] 300x50+[expr {$twbw + $twht + 1}]+[expr {$twbw + $twht + $fixedHeight + 1}] [list [expr {$twbw + $twht + $fixedWidth + 1}] [expr {$twbw + $twht + $fixedHeight + 50 + 1}] $fixedWidth $fixedHeight]]
test textDisp-29.2 {miscellaneous: lines wrap but are still too long} {textfonts} {
    catch {destroy .t2}
    toplevel .t2
    wm geometry .t2 +0+0
    text .t2.t -width 20 -height 10 -font $fixedFont \
	    -wrap char -xscrollcommand ".t2.s set"
    pack .t2.t -side top
    scrollbar .t2.s -orient horizontal -command ".t2.t xview"
    pack .t2.s -side bottom -fill x
    .t2.t insert end 123
    frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
    frame .t2.t.f -width 300 -height 50 -borderwidth 2 -relief raised
    .t2.t window create 1.1 -window .t2.t.f
    updateText
    .t2.t xview scroll 1 unit
    updateText
    list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]
} [list [list [expr {1.0*$fixedWidth/300}] [expr {21.0*$fixedWidth/300}]] 300x50+[expr {$twbw + $twht + 1 - $fixedWidth}]+[expr {$twbw + $twht + $fixedHeight + 1}] [list [expr {$twbw + $twht + $fixedWidth + 1 - $fixedWidth}] [expr {$twbw + $twht + $fixedHeight + 50 + 1}] $fixedWidth $fixedHeight]]
test textDisp-29.2.1 {miscellaneous: lines wrap but are still too long} {textfonts} {
3827
3828
3829
3830
3831
3832
3833
3834

3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851

3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868

3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881

3882
3883
3884
3885
3886
3887
3888
3827
3828
3829
3830
3831
3832
3833

3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850

3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867

3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880

3881
3882
3883
3884
3885
3886
3887
3888







-
+
















-
+
















-
+












-
+







    wm geometry .t2 +0+0
    text .t2.t -width 20 -height 10 -font $fixedFont \
	    -wrap char -xscrollcommand ".t2.s set"
    pack .t2.t -side top
    scrollbar .t2.s -orient horizontal -command ".t2.t xview"
    pack .t2.s -side bottom -fill x
    .t2.t insert end 123
    frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
    frame .t2.t.f -width 300 -height 50 -borderwidth 2 -relief raised
    .t2.t window create 1.1 -window .t2.t.f
    updateText
    .t2.t xview scroll 2 unit
    updateText
    list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]
} [list [list [expr {2.0*$fixedWidth/300}] [expr {22.0*$fixedWidth/300}]] 300x50+[expr {$twbw + $twht + 1 - 2*$fixedWidth}]+[expr {$twbw + $twht + $fixedHeight + 1}] {}]
test textDisp-29.2.3 {miscellaneous: lines wrap but are still too long} {textfonts} {
    catch {destroy .t2}
    toplevel .t2
    wm geometry .t2 +0+0
    text .t2.t -width 20 -height 10 -font $fixedFont \
	    -wrap char -xscrollcommand ".t2.s set"
    pack .t2.t -side top
    scrollbar .t2.s -orient horizontal -command ".t2.t xview"
    pack .t2.s -side bottom -fill x
    .t2.t insert end 123
    frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
    frame .t2.t.f -width 300 -height 50 -borderwidth 2 -relief raised
    .t2.t window create 1.1 -window .t2.t.f
    updateText
    .t2.t xview scroll 7 pixels
    updateText
    list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]
} [list [list [expr {7.0/300}] [expr {(20.0*$fixedWidth + 7)/300}]] 300x50+[expr {$twbw + $twht + 1 - 7}]+[expr {$twbw + $twht + $fixedHeight + 1}] [list [expr {$twbw + $twht + $fixedWidth + 1 - 7}] [expr {$twbw + $twht + $fixedHeight + 50 + 1}] $fixedWidth $fixedHeight]]
test textDisp-29.2.4 {miscellaneous: lines wrap but are still too long} {textfonts} {
    catch {destroy .t2}
    toplevel .t2
    wm geometry .t2 +0+0
    text .t2.t -width 20 -height 10 -font $fixedFont \
	    -wrap char -xscrollcommand ".t2.s set"
    pack .t2.t -side top
    scrollbar .t2.s -orient horizontal -command ".t2.t xview"
    pack .t2.s -side bottom -fill x
    .t2.t insert end 123
    frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
    frame .t2.t.f -width 300 -height 50 -borderwidth 2 -relief raised
    .t2.t window create 1.1 -window .t2.t.f
    updateText
    .t2.t xview scroll 17 pixels
    updateText
    list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]
} [list [list [expr {17.0/300}] [expr {(20.0*$fixedWidth + 17)/300}]] 300x50+[expr {$twbw + $twht + 1 - 17}]+[expr {$twbw + $twht + $fixedHeight + 1}] {}]
test textDisp-29.2.5 {miscellaneous: can show last character} {
    catch {destroy .t2}
    toplevel .t2
    wm geometry .t2 121x141+200+200
    text .t2.t -width 5 -height 5 -font {Arial 10} \
      -wrap none -xscrollcommand ".t2.s set" \
      -bd 2 -highlightthickness 0 -padx 1
      -borderwidth 2 -highlightthickness 0 -padx 1
    .t2.t insert end "WWWWWWWWWWWWi"
    scrollbar .t2.s -orient horizontal -command ".t2.t xview"
    grid .t2.t -row 0 -column 0 -sticky nsew
    grid .t2.s -row 1 -column 0 -sticky ew
    grid columnconfigure .t2 0 -weight 1
    grid rowconfigure .t2 0 -weight 1
    grid rowconfigure .t2 1 -weight 0
3906
3907
3908
3909
3910
3911
3912
3913

3914
3915
3916
3917
3918
3919
3920
3906
3907
3908
3909
3910
3911
3912

3913
3914
3915
3916
3917
3918
3919
3920







-
+







    wm geometry .t2 +0+0
    text .t2.t -width 20 -height 10 -font $fixedFont \
	    -wrap char -xscrollcommand ".t2.s set"
    pack .t2.t -side top
    scrollbar .t2.s -orient horizontal -command ".t2.t xview"
    pack .t2.s -side bottom -fill x
    .t2.t insert end 123
    frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
    frame .t2.t.f -width 300 -height 50 -borderwidth 2 -relief raised
    .t2.t window create 1.1 -window .t2.t.f
    updateText
    .t2.t xview scroll 200 units
    updateText
    list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]
} [list [list [expr {16.0/30}] 1.0] 300x50+-155+[expr {$fixedDiff + 18}] {}]
test textDisp-30.1 {elidden text joining multiple logical lines} {
4082
4083
4084
4085
4086
4087
4088
4089

4090
4091
4092
4093
4094
4095
4096
4082
4083
4084
4085
4086
4087
4088

4089
4090
4091
4092
4093
4094
4095
4096







-
+







    .tt tag configure HIDE -elide 1
    updateText
    .tt tag add HIDE 0.0 end
    updateText
    destroy .tt
} {}
test textDisp-32.2 {elide and tags} {
    pack [text .tt -height 30 -width 100 -bd 0 \
    pack [text .tt -height 30 -width 100 -borderwidth 0 \
      -highlightthickness 0 -padx 0]
    .tt insert end \
      {test text using tags 1 and 3 } \
      {testtag1 testtag3} \
      {[this bit here uses tags 2 and 3]} \
      {testtag2 testtag3}
    updateText
Changes to tests/textImage.test.
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
94
95

96
97
98
99
100
101
102
103
104
105

106
107
108
109
110
111
112
113
114
115

116
117
118
119
120
121
122
123
124
125
126
127
128
129

130
131
132
133
134
135
136
137
138
139
140

141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156

157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173

174
175
176
177
178
179
180
181
182
183
184
185
186
187

188
189
190
191
192
193
194
195
196
197
198
199
200
201
202

203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219

220
221
222
223
224
225
226
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
94

95
96
97
98
99
100
101
102
103
104

105
106
107
108
109
110
111
112
113
114

115
116
117
118
119
120
121
122
123
124
125
126
127
128

129
130
131
132
133
134
135
136
137
138
139

140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155

156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172

173
174
175
176
177
178
179
180
181
182
183
184
185
186

187
188
189
190
191
192
193
194
195
196
197
198
199
200
201

202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218

219
220
221
222
223
224
225
226







-
+









-
+









-
+









-
+









-
+









-
+









-
+









-
+









-
+









-
+













-
+










-
+















-
+
















-
+













-
+














-
+
















-
+







font create test_font -family courier -size 14
text .t -font test_font
destroy .t

test textImage-1.1 {basic argument checking} -setup {
    destroy .t
} -body {
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image
} -cleanup {
    destroy .t
} -returnCodes error -result {wrong # args: should be ".t image option ?arg ...?"}

test textImage-1.2 {basic argument checking} -setup {
    destroy .t
} -body {
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image c
} -cleanup {
    destroy .t
} -returnCodes error -result {ambiguous option "c": must be cget, configure, create, or names}

test textImage-1.3 {cget argument checking} -setup {
    destroy .t
} -body {
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image cget
} -cleanup {
    destroy .t
} -returnCodes error -result {wrong # args: should be ".t image cget index option"}

test textImage-1.4 {cget argument checking} -setup {
    destroy .t
} -body {
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image cget blurf -flurp
} -cleanup {
    destroy .t
} -returnCodes error -result {bad text index "blurf"}

test textImage-1.5 {cget argument checking} -setup {
    destroy .t
} -body {
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image cget 1.1 -flurp
} -cleanup {
    destroy .t
} -returnCodes error -result {no embedded image at index "1.1"}

test textImage-1.6 {configure argument checking} -setup {
    destroy .t
} -body {
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image configure
} -cleanup {
    destroy .t
} -returnCodes error -result {wrong # args: should be ".t image configure index ?-option value ...?"}

test textImage-1.7 {configure argument checking} -setup {
    destroy .t
} -body {
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image configure blurf
} -cleanup {
    destroy .t
} -returnCodes error -result {bad text index "blurf"}

test textImage-1.8 {configure argument checking} -setup {
    destroy .t
} -body {
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image configure 1.1
} -cleanup {
    destroy .t
} -returnCodes error -result {no embedded image at index "1.1"}

test textImage-1.9 {create argument checking} -setup {
    destroy .t
} -body {
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image create
} -cleanup {
    destroy .t
} -returnCodes error -result {wrong # args: should be ".t image create index ?-option value ...?"}

test textImage-1.10 {create argument checking} -setup {
    destroy .t
} -body {
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image create blurf
} -cleanup {
    destroy .t
} -returnCodes error -result {bad text index "blurf"}

test textImage-1.11 {basic argument checking} -setup {
    destroy .t
} -body {
    catch {
        image create photo small -width 5 -height 5
        small put red -to 0 0 4 4
    }
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image create 1000.1000 -image small
} -cleanup {
    destroy .t
    image delete small
} -returnCodes ok -result {small}

test textImage-1.12 {names argument checking} -setup {
    destroy .t
} -body {
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image names dates places
} -cleanup {
    destroy .t
} -returnCodes error -result {wrong # args: should be ".t image names"}


test textImage-1.13 {names argument checking} -setup {
    destroy .t
    set result ""
} -body {
    catch {
        image create photo small -width 5 -height 5
        small put red -to 0 0 4 4
    }
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    lappend result [.t image names]
    .t image create insert -image small
    lappend result [.t image names]
    .t image create insert -image small
    lappend result [lsort [.t image names]]
    .t image create insert -image small -name little
    lappend result [lsort [.t image names]]
} -cleanup {
    destroy .t
    image delete small
} -result {{} small {small small#1} {little small small#1}}

test textImage-1.14 {basic argument checking} -setup {
    destroy .t
} -body {
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image huh
} -cleanup {
    destroy .t
} -returnCodes error -result {bad option "huh": must be cget, configure, create, or names}

test textImage-1.15 {align argument checking} -setup {
    destroy .t
} -body {
    catch {
        image create photo small -width 5 -height 5
        small put red -to 0 0 4 4
    }
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image create end -image small -align wrong
} -cleanup {
    destroy .t
    image delete small
} -returnCodes error -result {bad align "wrong": must be baseline, bottom, center, or top}

test textImage-1.16 {configure} -setup {
    destroy .t
} -body {
    catch {
        image create photo small -width 5 -height 5
        small put red -to 0 0 4 4
    }
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image create end -image small
    .t image configure small
} -cleanup {
    destroy .t
    image delete small
} -result {{-align {} {} center center} {-padx {} {} 0 0} {-pady {} {} 0 0} {-image {} {} {} small} {-name {} {} {} {}}}

test textImage-1.17 {basic cget options} -setup {
    destroy .t
    set result ""
} -body {
    catch {
        image create photo small -width 5 -height 5
        small put red -to 0 0 4 4
    }
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image create end -image small
    foreach i {align padx pady image name} {
        lappend result $i:[.t image cget small -$i]
    }
    return $result
} -cleanup {
234
235
236
237
238
239
240
241

242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261

262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280

281
282
283
284
285
286
287
234
235
236
237
238
239
240

241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260

261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279

280
281
282
283
284
285
286
287







-
+



















-
+


















-
+







} -body {
    catch {
        image create photo small -width 5 -height 5
        small put red -to 0 0 4 4
        image create photo large -width 50 -height 50
        large put green -to 0 0 50 50
    }
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image create end -image small
    foreach {option value}  {align top padx 5 pady 7 image large name none} {
        .t image configure small -$option $value
    }
    update
    .t image configure small
} -cleanup {
    destroy .t
    image delete small large
} -result {{-align {} {} center top} {-padx {} {} 0 5} {-pady {} {} 0 7} {-image {} {} {} large} {-name {} {} {} none}}

test textImage-1.19 {basic image naming} -setup {
    destroy .t
} -body {
    catch {
        image create photo small -width 5 -height 5
        small put red -to 0 0 4 4
    }
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image create end -image small
    .t image create end -image small -name small
    .t image create end -image small -name small#6342
    .t image create end -image small -name small
    lsort [.t image names]
} -cleanup {
    destroy .t
    image delete small
} -result {small small#1 small#6342 small#6343}

test textImage-2.1 {debug} -setup {
    destroy .t
} -body {
    catch {
        image create photo small -width 5 -height 5
        small put red -to 0 0 4 4
    }
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t debug 1
    .t insert end front
    .t image create end -image small
    .t insert end back
    .t delete small
    .t image names
296
297
298
299
300
301
302
303

304
305
306
307
308
309
310
296
297
298
299
300
301
302

303
304
305
306
307
308
309
310







-
+







    destroy .t
    set result ""
} -body {
    catch {
        image create photo vary -width 5 -height 5
        vary put red -to 0 0 4 4
    }
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image create end -image vary -align top
    update
    lappend result base:[.t bbox vary]
    foreach i {10 20 40} {
        vary configure -width $i -height $i
        update
320
321
322
323
324
325
326
327

328
329
330
331
332
333
334
320
321
322
323
324
325
326

327
328
329
330
331
332
333
334







-
+







    destroy .t
    set result ""
} -body {
    catch {
        image create photo small -width 5 -height 5
        small put red -to 0 0 4 4
    }
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image create end -name test
    update
    foreach {x1 y1 w1 h1} [.t bbox test] {}
    lappend result [list $x1 $w1 $h1]
    .t image configure test -image small -align top
    update
348
349
350
351
352
353
354
355

356
357
358
359
360
361
362
348
349
350
351
352
353
354

355
356
357
358
359
360
361
362







-
+







} -body {
    catch {
        image create photo small -width 5 -height 5
        small put red -to 0 0 4 4
        image create photo large -width 50 -height 50
        large put green -to 0 0 50 50
    }
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image create end -image large
    .t image create end -image small
    .t insert end test
    update
    lappend result default:[.t bbox small]
    foreach i {top bottom center} {
377
378
379
380
381
382
383
384

385
386
387
388
389
390
391
377
378
379
380
381
382
383

384
385
386
387
388
389
390
391







-
+







    catch {
        image create photo small -width 5 -height 5
        small put red -to 0 0 4 4
        image create photo large -width 50 -height 50
        large put green -to 0 0 50 50
    }
    font create test_font2 -size 5
    text .t -font test_font2 -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font2 -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image create end -image large
    .t image create end -image small -align baseline
    .t insert end test
    # Sizes larger than 25 can be too big and lead to a negative 'norm',
    # at least on Windows XP with certain settings.
    foreach size {10 15 20 25} {
415
416
417
418
419
420
421
422

423
424
425
426
427
428
429
415
416
417
418
419
420
421

422
423
424
425
426
427
428
429







-
+







} -body {
    catch {
        image create photo small -width 5 -height 5
        small put red -to 0 0 4 4
        image create photo large -width 50 -height 50
        large put green -to 0 0 50 50
    }
    text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0
    text .t -font test_font -borderwidth 0 -highlightthickness 0 -padx 0 -pady 0
    pack .t
    .t image create end -image large
    .t image create end -image small -padx 5 -pady 10
    .t insert end test
    update
    lappend result default:[.t bbox small]
    foreach i {top bottom center baseline} {
Changes to tests/textTag.test.
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
94

95
96
97

98
99

100
101
102
103
104
105
106
107
108
109


110
111

112
113
114

115
116

117
118
119
120
121
122
123
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

94
95
96

97
98

99
100
101
102
103
104
105
106
107


108
109
110

111
112
113

114
115

116
117
118
119
120
121
122
123







-
-
+
+

-
+


-
+

-
+













-
-
+
+

-
+


-
+

-
+








-
-
+
+

-
+


-
+

-
+







} -result {#012345}
test textTag-1.2 {configuration options} -body {
    .t tag configure x -background non-existent
} -cleanup {
    .t tag configure x -background [lindex [.t tag configure x -background] 3]
} -returnCodes error -result {unknown color name "non-existent"}
test textTag-1.3 {tag configuration options} -body {
    .t tag configure x -bgstipple gray50
    .t tag cget x -bgstipple
    .t tag configure x -backgroundstipple gray50
    .t tag cget x -backgroundstipple
} -cleanup {
    .t tag configure x -bgstipple [lindex [.t tag configure x -bgstipple] 3]
    .t tag configure x -backgroundstipple [lindex [.t tag configure x -backgroundstipple] 3]
} -result {gray50}
test textTag-1.4 {configuration options} -body {
    .t tag configure x -bgstipple badStipple
    .t tag configure x -backgroundstipple badStipple
} -cleanup {
    .t tag configure x -bgstipple [lindex [.t tag configure x -bgstipple] 3]
    .t tag configure x -backgroundstipple [lindex [.t tag configure x -backgroundstipple] 3]
} -returnCodes error -result {bitmap "badStipple" not defined}
test textTag-1.5 {tag configuration options} -body {
    .t tag configure x -borderwidth 2
    .t tag cget x -borderwidth
} -cleanup {
    .t tag configure x -borderwidth [lindex [.t tag configure x -borderwidth] 3]
} -result 2
test textTag-1.6 {configuration options} -body {
    .t tag configure x -borderwidth 46q
} -cleanup {
    .t tag configure x -borderwidth [lindex [.t tag configure x -borderwidth] 3]
} -returnCodes error -result {bad screen distance "46q"}
test textTag-1.7 {tag configuration options} -body {
    .t tag configure x -fgstipple gray25
    .t tag cget x -fgstipple
    .t tag configure x -stipple gray25
    .t tag cget x -stipple
} -cleanup {
    .t tag configure x -fgstipple [lindex [.t tag configure x -fgstipple] 3]
    .t tag configure x -stipple [lindex [.t tag configure x -stipple] 3]
} -result {gray25}
test textTag-1.8 {configuration options} -body {
    .t tag configure x -fgstipple bogus
    .t tag configure x -stipple bogus
} -cleanup {
    .t tag configure x -fgstipple [lindex [.t tag configure x -fgstipple] 3]
    .t tag configure x -stipple [lindex [.t tag configure x -stipple] 3]
} -returnCodes error -result {bitmap "bogus" not defined}
test textTag-1.9 {tag configuration options} -body {
    .t tag configure x -font fixed
    .t tag cget x -font
} -cleanup {
    .t tag configure x -font [lindex [.t tag configure x -font] 3]
} -result {fixed}
test textTag-1.10 {tag configuration options} -body {
    .t tag configure x -foreground #001122
    .t tag cget x -foreground
    .t tag configure x -color #001122
    .t tag cget x -color
} -cleanup {
    .t tag configure x -foreground [lindex [.t tag configure x -foreground] 3]
    .t tag configure x -color [lindex [.t tag configure x -color] 3]
} -result {#001122}
test textTag-1.11 {configuration options} -body {
    .t tag configure x -foreground {silly color}
    .t tag configure x -color {silly color}
} -cleanup {
    .t tag configure x -foreground [lindex [.t tag configure x -foreground] 3]
    .t tag configure x -color [lindex [.t tag configure x -color] 3]
} -returnCodes error -result {unknown color name "silly color"}
test textTag-1.12 {tag configuration options} -body {
    .t tag configure x -justify left
    .t tag cget x -justify
} -cleanup {
    .t tag configure x -justify [lindex [.t tag configure x -justify] 3]
} -result {left}
178
179
180
181
182
183
184
185
186


187
188

189
190
191

192
193

194
195
196
197
198
199
200
178
179
180
181
182
183
184


185
186
187

188
189
190

191
192

193
194
195
196
197
198
199
200







-
-
+
+

-
+


-
+

-
+







} -result {on}
test textTag-1.21 {configuration options} -body {
    .t tag configure x -overstrike stupid
} -cleanup {
    .t tag configure x -overstrike [lindex [.t tag configure x -overstrike] 3]
} -returnCodes error -result {expected boolean value but got "stupid"}
test textTag-1.21a {tag configuration options} -body {
    .t tag configure x -overstrikefg red
    .t tag cget x -overstrikefg
    .t tag configure x -overstrikecolor red
    .t tag cget x -overstrikecolor
} -cleanup {
    .t tag configure x -overstrikefg [lindex [.t tag configure x -overstrikefg] 3]
    .t tag configure x -overstrikecolor [lindex [.t tag configure x -overstrikecolor] 3]
} -result {red}
test textTag-1.21b {configuration options} -body {
    .t tag configure x -overstrikefg stupid
    .t tag configure x -overstrikecolor stupid
} -cleanup {
    .t tag configure x -overstrikefg [lindex [.t tag configure x -overstrikefg] 3]
    .t tag configure x -overstrikecolor [lindex [.t tag configure x -overstrikecolor] 3]
} -returnCodes error -result {unknown color name "stupid"}
test textTag-1.22 {tag configuration options} -body {
    .t tag configure x -relief raised
    .t tag cget x -relief
} -cleanup {
    .t tag configure x -relief [lindex [.t tag configure x -relief] 3]
} -result {raised}
233
234
235
236
237
238
239
240
241


242
243

244
245
246

247
248

249
250
251
252
253
254
255
233
234
235
236
237
238
239


240
241
242

243
244
245

246
247

248
249
250
251
252
253
254
255







-
-
+
+

-
+


-
+

-
+







} -result {#012345}
test textTag-1.25d {configuration options} -body {
    .t tag configure x -selectbackground non-existent
} -cleanup {
    .t tag configure x -selectbackground [lindex [.t tag configure x -selectbackground] 3]
} -returnCodes error -result {unknown color name "non-existent"}
test textTag-1.25e {tag configuration options} -body {
    .t tag configure x -selectforeground #012345
    .t tag cget x -selectforeground
    .t tag configure x -selectcolor #012345
    .t tag cget x -selectcolor
} -cleanup {
    .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3]
    .t tag configure x -selectcolor [lindex [.t tag configure x -selectcolor] 3]
} -result {#012345}
test textTag-1.25f {configuration options} -body {
    .t tag configure x -selectforeground non-existent
    .t tag configure x -selectcolor non-existent
} -cleanup {
    .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3]
    .t tag configure x -selectcolor [lindex [.t tag configure x -selectcolor] 3]
} -returnCodes error -result {unknown color name "non-existent"}
test textTag-1.26 {tag configuration options} -body {
    .t tag configure x -spacing1 10
    .t tag cget x -spacing1
} -cleanup {
    .t tag configure x -spacing1 [lindex [.t tag configure x -spacing1] 3]
} -result 10
299
300
301
302
303
304
305
306
307


308
309

310
311
312

313
314

315
316
317
318
319
320
321
299
300
301
302
303
304
305


306
307
308

309
310
311

312
313

314
315
316
317
318
319
320
321







-
-
+
+

-
+


-
+

-
+







} -result {no}
test textTag-1.35 {configuration options} -body {
    .t tag configure x -underline stupid
} -cleanup {
    .t tag configure x -underline [lindex [.t tag configure x -underline] 3]
} -returnCodes error -result {expected boolean value but got "stupid"}
test textTag-1.36 {tag configuration options} -body {
    .t tag configure x -underlinefg red
    .t tag cget x -underlinefg
    .t tag configure x -underlinecolor red
    .t tag cget x -underlinecolor
} -cleanup {
    .t tag configure x -underlinefg [lindex [.t tag configure x -underlinefg] 3]
    .t tag configure x -underlinecolor [lindex [.t tag configure x -underlinecolor] 3]
} -result {red}
test textTag-1.37 {configuration options} -body {
    .t tag configure x -underlinefg stupid
    .t tag configure x -underlinecolor stupid
} -cleanup {
    .t tag configure x -underlinefg [lindex [.t tag configure x -underlinefg] 3]
    .t tag configure x -underlinecolor [lindex [.t tag configure x -underlinecolor] 3]
} -returnCodes error -result {unknown color name "stupid"}


test textTag-2.1 {TkTextTagCmd - "add" option} -body {
    .t tag
} -returnCodes error -result {wrong # args: should be ".t tag option ?arg ...?"}
test textTag-2.2 {TkTextTagCmd - "add" option} -body {
505
506
507
508
509
510
511
512
513


514
515
516

517
518
519
520
521
522
523
524
525
526
527


528
529
530

531
532
533
534
535
536
537
505
506
507
508
509
510
511


512
513
514
515

516
517
518
519
520
521
522
523
524
525


526
527
528
529

530
531
532
533
534
535
536
537







-
-
+
+


-
+









-
-
+
+


-
+







    .t tag configure x -underline yes
    .t tag configure x -underline
} -cleanup {
    .t tag delete x
} -result {-underline {} {} {} yes}
test textTag-5.4a {TkTextTagCmd - "configure" option} -body {
    .t tag delete x
    .t tag configure x -underlinefg lightgreen
    .t tag configure x -underlinefg
    .t tag configure x -underlinecolor lightgreen
    .t tag configure x -underlinecolor
} -cleanup {
    .t tag delete x
} -result {-underlinefg {} {} {} lightgreen}
} -result {-underlinecolor {} {} {} lightgreen}
test textTag-5.5 {TkTextTagCmd - "configure" option} -body {
    .t tag delete x
    .t tag configure x -overstrike on
    .t tag cget x -overstrike
} -cleanup {
    .t tag delete x
} -result {on}
test textTag-5.5a {TkTextTagCmd - "configure" option} -body {
    .t tag delete x
    .t tag configure x -overstrikefg lightgreen
    .t tag configure x -overstrikefg
    .t tag configure x -overstrikecolor lightgreen
    .t tag configure x -overstrikecolor
} -cleanup {
    .t tag delete x
} -result {-overstrikefg {} {} {} lightgreen}
} -result {-overstrikecolor {} {} {} lightgreen}
test textTag-5.6 {TkTextTagCmd - "configure" option} -body {
    .t tag configure x -overstrike foo
} -cleanup {
    .t tag delete x
} -returnCodes error -result {expected boolean value but got "foo"}
test textTag-5.7 {TkTextTagCmd - "configure" option} -body {
    .t tag delete x
638
639
640
641
642
643
644
645

646
647

648
649

650
651
652
653
654
655
656
638
639
640
641
642
643
644

645
646

647
648

649
650
651
652
653
654
655
656







-
+

-
+

-
+







test textTag-5.20 {TkTextTagCmd - "configure" option} -body {
    .t tag delete x
    .t tag configure x -spacing1 4.2.3
} -cleanup {
    .t tag delete x
} -returnCodes error -result {bad screen distance "4.2.3"}
test textTag-5.21 {TkTextTagCmd - "configure" option} -body {
    .t configure -selectborderwidth 2 -selectforeground blue \
    .t configure -selectborderwidth 2 -selectcolor blue \
        -selectbackground black
    .t tag configure sel -borderwidth 4 -foreground green -background yellow
    .t tag configure sel -borderwidth 4 -color green -background yellow
    set x {}
    foreach i {-selectborderwidth -selectforeground -selectbackground} {
    foreach i {-selectborderwidth -selectcolor -selectbackground} {
        lappend x [lindex [.t configure $i] 4]
    }
    return $x
} -result {4 green yellow}
test textTag-5.22 {TkTextTagCmd - "configure" option} -body {
    .t configure -selectborderwidth 20
    .t tag configure sel -borderwidth {}
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702



















703
704
705
706
707
708
709
710
711
712
713
714
715
716

717
718
719
720
721
722
723
724
725
726
727

728
729
730
731
732
733
734
677
678
679
680
681
682
683



















684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715

716
717
718
719
720
721
722
723
724
725
726

727
728
729
730
731
732
733
734







-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+













-
+










-
+







    .t configure -selectbackground black
    .t tag configure sel -selectbackground white
    lappend x [.t cget -selectbackground]
    return $x
} -result {yellow blue red white}
test textTag-5.24 {TkTextTagCmd - "configure" option} -body {
    set x {}
    # when [.t tag cget sel -selectforeground] == "", mirroring happens between
    #     the text widget option -selectforeground
    # and the tag         option -foreground
    .t tag configure sel -selectforeground {}
    .t configure -selectforeground black
    .t tag configure sel -foreground yellow
    lappend x [.t cget -selectforeground]
    .t tag configure sel -foreground orange
    .t configure -selectforeground blue
    lappend x [.t tag cget sel -foreground]
    # when [.t tag cget sel -selectforeground] != "", mirroring happens between
    #     the text widget option -selectforeground
    # and the tag         option -selectforeground
    .t tag configure sel -selectforeground green
    .t configure -selectforeground red
    lappend x [.t tag cget sel -selectforeground]
    .t configure -selectforeground black
    .t tag configure sel -selectforeground white
    lappend x [.t cget -selectforeground]
    # when [.t tag cget sel -selectcolor] == "", mirroring happens between
    #     the text widget option -selectcolor
    # and the tag         option -color
    .t tag configure sel -selectcolor {}
    .t configure -selectcolor black
    .t tag configure sel -color yellow
    lappend x [.t cget -selectcolor]
    .t tag configure sel -color orange
    .t configure -selectcolor blue
    lappend x [.t tag cget sel -color]
    # when [.t tag cget sel -selectcolor] != "", mirroring happens between
    #     the text widget option -selectcolor
    # and the tag         option -selectcolor
    .t tag configure sel -selectcolor green
    .t configure -selectcolor red
    lappend x [.t tag cget sel -selectcolor]
    .t configure -selectcolor black
    .t tag configure sel -selectcolor white
    lappend x [.t cget -selectcolor]
    return $x
} -result {yellow blue red white}

test textTag-6.1 {TkTextTagCmd - "delete" option} -body {
    .t tag delete
} -returnCodes error -result {wrong # args: should be ".t tag delete tagName ?tagName ...?"}
test textTag-6.2 {TkTextTagCmd - "delete" option} -body {
    .t tag delete zork
} -returnCodes ok -result {}
test textTag-6.3 {TkTextTagCmd - "delete" option} -setup {
    .t tag delete {*}[.t tag names]
} -body {
    .t tag config x -background black
    .t tag config y -foreground white
    .t tag config y -color white
    .t tag config z -background black
    .t tag delete y z
    lsort [.t tag names]
} -cleanup {
    .t tag delete x
} -result {sel x}
test textTag-6.4 {TkTextTagCmd - "delete" option} -setup {
    .t tag delete {*}[.t tag names]
} -body {
    .t tag config x -background black
    .t tag config y -foreground white
    .t tag config y -color white
    .t tag config z -background black
    eval .t tag delete [.t tag names]
    .t tag names
} -result {sel}
test textTag-6.5 {TkTextTagCmd - "delete" option} -body {
    .t tag bind x <Enter> foo
    .t tag delete x
Changes to tests/textWind.test.
19
20
21
22
23
24
25
26

27
28
29
30
31
32
33
19
20
21
22
23
24
25

26
27
28
29
30
31
32
33







-
+







set fixedHeight [font metrics $fixedFont -linespace]
set fixedWidth [font measure $fixedFont m]
set fixedAscent [font metrics $fixedFont -ascent]

# Widget used in almost all tests
set tWidth 30
set tHeight 6
text .t -width $tWidth -height $tHeight -bd 2 -highlightthickness 2 \
text .t -width $tWidth -height $tHeight -borderwidth 2 -highlightthickness 2 \
        -font $fixedFont
pack .t -expand 1 -fill both
update
.t debug on

set color [expr {[winfo depth .t] > 1 ? "green" : "black"}]

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
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







-
+















-
+







# ----------------------------------------------------------------------

test textWind-1.1 {basic tests of options} -setup {
    .t delete 1.0 end
} -body {
    .t insert end "This is the first line"
    .t insert end "\nAnd this is a second line, which wraps around"
    frame .f -width 3 -height 3 -bg $color
    frame .f -width 3 -height 3 -background $color
    .t window create 2.2 -window .f
    update
    list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] \
        [.t window configure .f -window]
} -result [list \
    1 \
    3x3+[expr {$padx+2*$fixedWidth}]+[expr {$pady+$fixedHeight+(($fixedHeight-3)/2)}] \
    [list [expr {$padx+2*$fixedWidth}] [expr {$pady+$fixedHeight+(($fixedHeight-3)/2)}] 3 3] \
    {-window {} {} {} .f}]

test textWind-1.2 {basic tests of options} -setup {
    .t delete 1.0 end
} -body {
    .t insert end "This is the first line"
    .t insert end "\nAnd this is a second line, which wraps around"
    frame .f -width 3 -height 3 -bg $color
    frame .f -width 3 -height 3 -background $color
    .t window create 2.2 -window .f -align top
    update
    list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] \
        [.t window configure .f -align]
} -result [list \
    1 \
    3x3+[expr {$padx+2*$fixedWidth}]+[expr {$pady+$fixedHeight}] \
98
99
100
101
102
103
104
105

106
107
108
109
110
111
112
113
114
115
116
117
118
119

120
121
122
123
124
125
126
127
128
129
130
131
132
133

134
135
136
137
138
139
140
98
99
100
101
102
103
104

105
106
107
108
109
110
111
112
113
114
115
116
117
118

119
120
121
122
123
124
125
126
127
128
129
130
131
132

133
134
135
136
137
138
139
140







-
+













-
+













-
+








test textWind-1.4 {basic tests of options} -setup {
    .t delete 1.0 end
} -body {
    .t insert end "This is the first line"
    .t insert end "\nAnd this is a second line, which wraps around"
    # the window .f should be wider than the fixed width
    frame .f -width 10 -height 20 -bg $color
    frame .f -width 10 -height 20 -background $color
    .t window create 2.2 -window .f -padx 5
    update
    list [winfo geom .f] [.t window configure .f -padx] [.t bbox 2.3]
} -result [list \
    10x20+[expr {$padx+2*$fixedWidth+5}]+[expr {$pady+$fixedHeight}] \
    {-padx {} {} 0 5} \
    [list [expr {$padx+2*$fixedWidth+10+2*5}] [expr {$pady+$fixedHeight+((20-$fixedHeight)/2)}] $fixedWidth $fixedHeight]]

test textWind-1.5 {basic tests of options} -setup {
    .t delete 1.0 end
} -body {
    .t insert end "This is the first line"
    .t insert end "\nAnd this is a second line, which wraps around"
    frame .f -width 10 -height 20 -bg $color
    frame .f -width 10 -height 20 -background $color
    .t window create 2.2 -window .f -pady 4
    update
    list [winfo geom .f] [.t window configure .f -pady] [.t bbox 2.31]
} -result [list \
    10x20+[expr {$padx+2*$fixedWidth}]+[expr {$pady+$fixedHeight+4}] \
    {-pady {} {} 0 4} \
    [list [expr {$padx+2*$fixedWidth}] [expr {$pady+$fixedHeight+20+2*4}] $fixedWidth $fixedHeight]]

test textWind-1.6 {basic tests of options} -setup {
    .t delete 1.0 end
} -body {
    .t insert end "This is the first line"
    .t insert end "\nAnd this is a second line, which wraps around"
    frame .f -width 5 -height 5 -bg $color
    frame .f -width 5 -height 5 -background $color
    .t window create 2.2 -window .f -stretch 1
    update
    list [winfo geom .f] [.t window configure .f -stretch]
} -result [list \
    5x$fixedHeight+[expr {$padx+2*$fixedWidth}]+[expr {$pady+$fixedHeight}] \
    {-stretch {} {} 0 1}]

155
156
157
158
159
160
161
162

163
164
165
166
167
168
169
170
171

172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190

191
192
193
194
195
196

197
198
199
200
201
202
203
204
205
206

207
208
209
210
211
212

213
214
215
216
217
218
219
220
221
222

223
224
225
226
227
228

229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249

250
251
252
253
254

255
256
257
258
259
260
261
262
263
264
265
266

267
268
269
270

271
272
273
274
275
276

277
278
279
280

281
282
283
284
285
286
287
288

289
290
291
292
293
294
295

296
297
298
299
300
301
302
155
156
157
158
159
160
161

162
163
164
165
166
167
168
169
170

171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189

190
191
192
193
194
195

196
197
198
199
200
201
202
203
204
205

206
207
208
209
210
211

212
213
214
215
216
217
218
219
220
221

222
223
224
225
226
227

228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248

249
250
251
252
253

254
255
256
257
258
259
260
261
262
263
264
265

266
267
268
269

270
271
272
273
274
275

276
277
278
279

280
281
282
283
284
285
286
287

288
289
290
291
292
293
294

295
296
297
298
299
300
301
302







-
+








-
+


















-
+





-
+









-
+





-
+









-
+





-
+




















-
+




-
+











-
+



-
+





-
+



-
+







-
+






-
+







} -returnCodes error -result {bad text index "gorp"}
test textWind-2.5 {TkTextWindowCmd procedure, "cget" option} -body {
    .t window cget 1.2 -padx
} -returnCodes error -result {no embedded window at index "1.2"}
test textWind-2.6 {TkTextWindowCmd procedure, "cget" option} -setup {
    destroy .f
} -body {
    frame .f -width 10 -height 6 -bg $color
    frame .f -width 10 -height 6 -background $color
    .t window create 1.3 -window .f -padx 1 -pady 2
    .t window cget .f -bogus
} -cleanup {
    destroy .f
} -returnCodes error -result {unknown option "-bogus"}
test textWind-2.7 {TkTextWindowCmd procedure, "cget" option} -setup {
    destroy .f
} -body {
    frame .f -width 10 -height 6 -bg $color
    frame .f -width 10 -height 6 -background $color
    .t window create 1.3 -window .f -padx 1 -pady 2
    .t window cget .f -pady
} -cleanup {
    destroy .f
} -returnCodes ok -result 2
test textWind-2.8 {TkTextWindowCmd procedure} -body {
    .t window co
} -returnCodes error -result {wrong # args: should be ".t window configure index ?-option value ...?"}
test textWind-2.9 {TkTextWindowCmd procedure} -body {
    .t window configure gorp
} -returnCodes error -result {bad text index "gorp"}
test textWind-2.10 {TkTextWindowCmd procedure} -body {
    .t delete 1.0 end
    .t window configure 1.0
} -returnCodes error -result {no embedded window at index "1.0"}
test textWind-2.11 {TkTextWindowCmd procedure} -setup {
# I kept this as it "influenced" the test case in previous releases
    destroy .f
    frame .f -width 10 -height 6 -bg $color
    frame .f -width 10 -height 6 -background $color
    .t window create 1.3 -window .f -padx 1 -pady 2
    .t delete 1.0 end
} -body {
    .t insert end "This is the first line"
    .t insert end "\nAnd this is a second line, which wraps around"
    frame .f -width 10 -height 6 -bg $color
    frame .f -width 10 -height 6 -background $color
    .t window create 2.2 -window .f -align baseline -padx 1 -pady 2 -create foo
    update
    .t window configure .f
} -cleanup {
    destroy .f
} -result  {{-align {} {} center baseline} {-create {} {} {} foo} {-padx {} {} 0 1} {-pady {} {} 0 2} {-stretch {} {} 0 0} {-window {} {} {} .f}}
test textWind-2.12 {TkTextWindowCmd procedure} -setup {
# I kept this as it "influenced" the test case in previous releases
    destroy .f
    frame .f -width 10 -height 6 -bg $color
    frame .f -width 10 -height 6 -background $color
    .t window create 2.2 -window .f -align baseline -padx 1 -pady 2 -create foo
    .t delete 1.0 end
} -body {
    .t insert end "This is the first line"
    .t insert end "\nAnd this is a second line, which wraps around"
    frame .f -width 10 -height 6 -bg $color
    frame .f -width 10 -height 6 -background $color
    .t window create 2.2 -window .f -align baseline -padx 1 -pady 2 -create foo
    update
    list [.t window configure .f -padx 33] [.t window configure .f -padx]
} -cleanup {
    destroy .f
} -result {{} {-padx {} {} 0 33}}
test textWind-2.13 {TkTextWindowCmd procedure} -setup {
# I kept this as it "influenced" the test case in previous releases
    destroy .f
    frame .f -width 10 -height 6 -bg $color
    frame .f -width 10 -height 6 -background $color
    .t window create 2.2 -window .f -align baseline -padx 1 -pady 2 -create foo
    .t delete 1.0 end
} -body {
    .t insert end "This is the first line"
    .t insert end "\nAnd this is a second line, which wraps around"
    frame .f -width 10 -height 6 -bg $color
    frame .f -width 10 -height 6 -background $color
    .t window create 2.2 -window .f -align baseline -padx 1 -pady 2
    update
    list [.t window configure .f -padx 14 -pady 15] \
        [.t window configure .f -padx] [.t window configure .f -pady]
} -cleanup {
    destroy .f
} -result {{} {-padx {} {} 0 14} {-pady {} {} 0 15}}
test textWind-2.14 {TkTextWindowCmd procedure} -setup {
    .t delete 1.0 end
} -body {
    .t window create
} -returnCodes error -result {wrong # args: should be ".t window create index ?-option value ...?"}
test textWind-2.15 {TkTextWindowCmd procedure} -setup {
    .t delete 1.0 end
} -body {
    .t window create gorp
} -returnCodes error -result {bad text index "gorp"}
test textWind-2.16 {TkTextWindowCmd procedure, don't insert after end} -setup {
# I kept this as it "influenced" the test case in previous releases
    destroy .f
    frame .f -width 10 -height 6 -bg $color
    frame .f -width 10 -height 6 -background $color
    .t window create 2.2 -window .f -align baseline -padx 1 -pady 2
    .t delete 1.0 end
} -body {
    .t insert end "Line 1\nLine 2"
    frame .f -width 20 -height 10 -bg $color
    frame .f -width 20 -height 10 -background $color
    .t window create end -window .f
    .t index .f
} -result {2.6}
test textWind-2.17 {TkTextWindowCmd procedure} -setup {
    .t delete 1.0 end
} -body {
    list [catch {.t window create 1.0} msg] $msg [.t window configure 1.0]
} -result {0 {} {{-align {} {} center center} {-create {} {} {} {}} {-padx {} {} 0 0} {-pady {} {} 0 0} {-stretch {} {} 0 0} {-window {} {} {} {}}}}
test textWind-2.18 {TkTextWindowCmd procedure} -setup {
# I kept this as it "influenced" the test case in previous releases
    destroy .f
    frame .f -width 20 -height 10 -bg $color
    frame .f -width 20 -height 10 -background $color
    .t window create end -window .f
    .t delete 1.0 end
} -body {
    frame .f -width 10 -height 6 -bg $color
    frame .f -width 10 -height 6 -background $color
    .t window create 1.0 -window .f -gorp stupid
} -returnCodes error -result {unknown option "-gorp"}
test textWind-2.19 {TkTextWindowCmd procedure} -setup {
# I kept this as it "influenced" the test case in previous releases
    destroy .f
    frame .f -width 20 -height 10 -bg $color
    frame .f -width 20 -height 10 -background $color
    .t window create end -window .f
    .t delete 1.0 end
} -body {
    frame .f -width 10 -height 6 -bg $color
    frame .f -width 10 -height 6 -background $color
    catch {.t window create 1.0 -window .f -gorp stupid}
    list [winfo exists .f] [.t index 1.end] [catch {.t index .f}]
} -result {0 1.0 1}
test textWind-2.20 {TkTextWindowCmd procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    frame .f -width 10 -height 6 -bg $color
    frame .f -width 10 -height 6 -background $color
    .t window create 1.0 -gorp -window .f stupid
} -returnCodes error -result {unknown option "-gorp"}
test textWind-2.21 {TkTextWindowCmd procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    frame .f -width 10 -height 6 -bg $color
    frame .f -width 10 -height 6 -background $color
    catch {.t window create 1.0 -gorp -window .f stupid}
    list [winfo exists .f] [.t index 1.end] [catch {.t index .f}]
} -result {1 1.0 1}
test textWind-2.22 {TkTextWindowCmd procedure} -setup {
    .t delete 1.0 end
} -body {
    .t window c
325
326
327
328
329
330
331
332

333
334
335
336
337
338
339
340
341
342
343

344
345
346
347
348
349
350
351
352
353
354
355
356
357

358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373

374
375
376
377
378
379
380
381
382
383
384
385
386
387

388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403

404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419

420
421
422
423
424
425
426
427
428
429

430
431
432
433
434
435
436
437
438
439

440
441
442
443
444
445
446
325
326
327
328
329
330
331

332
333
334
335
336
337
338
339
340
341
342

343
344
345
346
347
348
349
350
351
352
353
354
355
356

357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372

373
374
375
376
377
378
379
380
381
382
383
384
385
386

387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402

403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418

419
420
421
422
423
424
425
426
427
428

429
430
431
432
433
434
435
436
437
438

439
440
441
442
443
444
445
446







-
+










-
+













-
+















-
+













-
+















-
+















-
+









-
+









-
+







    destroy .f .f2 .t.f .t.f2
} -result {.f .f2 .t.f .t.f2}


test textWind-3.1 {EmbWinConfigure procedure} -setup {
    destroy .f
} -body {
    frame .f -width 10 -height 6 -bg $color
    frame .f -width 10 -height 6 -background $color
    .t window create 1.0 -window .f
    .t window configure 1.0 -foo bar
} -cleanup {
    destroy .f
} -returnCodes error -result {unknown option "-foo"}

test textWind-3.2 {EmbWinConfigure procedure} -setup {
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 10 -height 20 -bg $color
    frame .f -width 10 -height 20 -background $color
    .t window create 1.3 -window .f
    update
    .t window configure 1.3 -window {}
    update
    .t index .f
} -cleanup {
    destroy .f
} -returnCodes error -result {bad text index ".f"}

test textWind-3.3 {EmbWinConfigure procedure} -setup {
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 10 -height 20 -bg $color
    frame .f -width 10 -height 20 -background $color
    .t window create 1.3 -window .f
    update
    .t window configure 1.3 -window {}
    update
    catch {.t index .f}
    list [winfo ismapped .f] [.t bbox 1.4]
} -cleanup {
    destroy .f
} -result [list 0 \
    [list [expr {$padx+3*$fixedWidth}] $pady $fixedWidth $fixedHeight]]

test textWind-3.4 {EmbWinConfigure procedure} -setup {
    destroy .t.f
} -body {
    .t insert 1.0 "Some sample text"
    frame .t.f -width 10 -height 20 -bg $color
    frame .t.f -width 10 -height 20 -background $color
    .t window create 1.3 -window .t.f
    update
    .t window configure 1.3 -window {}
    update
    .t index .t.f
} -cleanup {
    destroy .t.f
} -returnCodes error -result {bad text index ".t.f"}

test textWind-3.5 {EmbWinConfigure procedure} -setup {
    destroy .t.f
} -body {
    .t insert 1.0 "Some sample text"
    frame .t.f -width 10 -height 20 -bg $color
    frame .t.f -width 10 -height 20 -background $color
    .t window create 1.3 -window .t.f
    update
    .t window configure 1.3 -window {}
    update
    catch {.t index .t.f}
    list [winfo ismapped .t.f] [.t bbox 1.4]
} -cleanup {
    destroy .t.f
} -result [list 0 \
    [list [expr {$padx+3*$fixedWidth}] $pady $fixedWidth $fixedHeight]]

test textWind-3.6 {EmbWinConfigure procedure} -setup {
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 10 -height 20 -bg $color
    frame .f -width 10 -height 20 -background $color
    .t window create 1.3
    update
    .t window configure 1.3 -window .f
    update
    list [catch {.t index .f} msg] $msg [winfo ismapped .f] [.t bbox 1.4]
} -cleanup {
    destroy .f
} -result [list 0 1.3 1 \
    [list [expr {$padx+3*$fixedWidth+10}] [expr {$pady+((20-$fixedHeight)/2)}] $fixedWidth $fixedHeight]]

test textWind-3.7 {EmbWinConfigure procedure} -setup {
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f
    frame .f.f -width 15 -height 20 -bg $color
    frame .f.f -width 15 -height 20 -background $color
    pack .f.f
    .t window create 1.3 -window .f.f
} -cleanup {
    destroy .f
} -returnCodes error -result {can't embed .f.f in .t}
test textWind-3.8 {EmbWinConfigure procedure} -setup {
    destroy .t2
} -body {
    .t insert 1.0 "Some sample text"
    toplevel .t2 -width 20 -height 10 -bg $color
    toplevel .t2 -width 20 -height 10 -background $color
    .t window create 1.3
    .t window configure 1.3 -window .t2
} -cleanup {
    destroy .t2
} -returnCodes error -result {can't embed .t2 in .t}
test textWind-3.9 {EmbWinConfigure procedure} -setup {
    destroy .t2
} -body {
    .t insert 1.0 "Some sample text"
    toplevel .t2 -width 20 -height 10 -bg $color
    toplevel .t2 -width 20 -height 10 -background $color
    .t window create 1.3
    catch {.t window configure 1.3 -window .t2}
    .t window configure 1.3 -window
} -cleanup {
    destroy .t2
} -result {-window {} {} {} {}}
test textWind-3.10 {EmbWinConfigure procedure} -setup {
461
462
463
464
465
466
467
468

469
470
471
472
473
474
475
461
462
463
464
465
466
467

468
469
470
471
472
473
474
475







-
+







    .t window create 1.6 -window .t.b
    update
    .t index .t.b
} -result {1.6}


.t delete 1.0 end
frame .f -width 10 -height 20 -bg $color
frame .f -width 10 -height 20 -background $color
.t window create 1.0 -window .f
test textWind-4.1 {AlignParseProc and AlignPrintProc procedures} -body {
    .t window configure 1.0 -align baseline
    .t window configure 1.0 -align
} -result {-align {} {} center baseline}
test textWind-4.2 {AlignParseProc and AlignPrintProc procedures} -body {
    .t window configure 1.0 -align bottom
494
495
496
497
498
499
500
501

502
503
504
505
506
507
508
509
510
511
512
513

514
515
516
517
518
519
520
521
522
523
524
525
526
527
528

529
530
531
532
533
534
535
536
537
538
539
540

541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556

557
558

559
560
561
562
563
564
565
566
567
568
569
570
571
572
573

574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592

593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609

610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626

627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642

643
644
645
646
647
648
649
650
651
652
653
654
655
656

657
658
659
660
661
662
663
664
665
666
667
668
669
670
671

672
673
674
675
676
677
678
494
495
496
497
498
499
500

501
502
503
504
505
506
507
508
509
510
511
512

513
514
515
516
517
518
519
520
521
522
523
524
525
526
527

528
529
530
531
532
533
534
535
536
537
538
539

540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555

556
557

558
559
560
561
562
563
564
565
566
567
568
569
570
571
572

573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591

592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608

609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625

626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641

642
643
644
645
646
647
648
649
650
651
652
653
654
655

656
657
658
659
660
661
662
663
664
665
666
667
668
669
670

671
672
673
674
675
676
677
678







-
+











-
+














-
+











-
+















-
+

-
+














-
+


















-
+
















-
+
















-
+















-
+













-
+














-
+







} -result {-align {} {} center top}

test textWind-5.1 {EmbWinStructureProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 10 -height 20 -bg $color
    frame .f -width 10 -height 20 -background $color
    .t window create 1.2 -window .f
    update
    destroy .f
    .t index .f
} -returnCodes error -result {bad text index ".f"}

test textWind-5.2 {EmbWinStructureProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 10 -height 20 -bg $color
    frame .f -width 10 -height 20 -background $color
    .t window create 1.2 -window .f
    update
    destroy .f
    catch {.t index .f}
    list [.t bbox 1.2] [.t bbox 1.3]
} -result [list \
    [list [expr {$padx+2*$fixedWidth}] [expr {$pady+($fixedHeight/2)}] 0 0] \
    [list [expr {$padx+2*$fixedWidth}] $pady $fixedWidth $fixedHeight]]

test textWind-5.3 {EmbWinStructureProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 10 -height 20 -bg $color
    frame .f -width 10 -height 20 -background $color
    .t window create 1.2 -align bottom
    .t window configure 1.2 -window .f
    update
    destroy .f
    .t index .f
} -returnCodes error -result {bad text index ".f"}

test textWind-5.4 {EmbWinStructureProc procedure} -setup {
    .t delete 1.0 end
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 10 -height 20 -bg $color
    frame .f -width 10 -height 20 -background $color
    .t window create 1.2 -align bottom
    .t window configure 1.2 -window .f
    update
    destroy .f
    catch {.t index .f}
    list [.t bbox 1.2] [.t bbox 1.3]
} -result [list \
    [list [expr {$padx+2*$fixedWidth}] [expr {$pady+$fixedHeight}] 0 0] \
    [list [expr {$padx+2*$fixedWidth}] $pady $fixedWidth $fixedHeight]]

test textWind-5.5 {EmbWinStructureProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    .t window create 1.2 -create {frame .f -width 10 -height 20 -bg $color}
    .t window create 1.2 -create {frame .f -width 10 -height 20 -background $color}
    update
    .t window configure 1.2 -create {frame .f -width 20 -height 10 -bg $color}
    .t window configure 1.2 -create {frame .f -width 20 -height 10 -background $color}
    destroy .f
    update
    list [catch {.t index .f} msg] $msg [.t bbox 1.2] [.t bbox 1.3]
} -result [list 0 1.2 \
    [list [expr {$padx+2*$fixedWidth}] [expr {$pady+(($fixedHeight-10)/2)}] 20 10] \
    [list [expr {$padx+2*$fixedWidth+20}] $pady $fixedWidth $fixedHeight]]


test textWind-6.1 {EmbWinRequestProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
    set result {}
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 10 -height 20 -bg $color
    frame .f -width 10 -height 20 -background $color
    .t window create 1.2 -window .f
    lappend result [.t bbox 1.2] [.t bbox 1.3]
    .f configure -width 25 -height 30
    lappend result [.t bbox 1.2] [.t bbox 1.3]
} -cleanup {
    destroy .f
} -result [list \
    [list [expr {$padx+2*$fixedWidth}] $pady 10 20] \
    [list [expr {$padx+2*$fixedWidth+10}] [expr {$pady+((20-$fixedHeight)/2)}] $fixedWidth $fixedHeight] \
    [list [expr {$padx+2*$fixedWidth}] $pady 25 30] \
    [list [expr {$padx+2*$fixedWidth+25}] [expr {$pady+((30-$fixedHeight)/2)}] $fixedWidth $fixedHeight]]


test textWind-7.1 {EmbWinLostContentProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 10 -height 20 -bg $color
    frame .f -width 10 -height 20 -background $color
    .t window create 1.2 -window .f
    update
    place .f -in .t -x 100 -y 50
    update
    list [winfo geom .f] [.t bbox 1.2]
} -cleanup {
    destroy .f
} -result [list \
    10x20+[expr {$padx+100}]+[expr {$pady+50}] \
    [list [expr {$padx+2*$fixedWidth}] [expr {$pady+($fixedHeight/2)}] 0 0]]

test textWind-7.2 {EmbWinLostContentProc procedure} -setup {
    .t delete 1.0 end
    destroy .t.f
} -body {
    .t insert 1.0 "Some sample text"
    frame .t.f -width 10 -height 20 -bg $color
    frame .t.f -width 10 -height 20 -background $color
    .t window create 1.2 -window .t.f
    update
    place .t.f -x 100 -y 50
    update
    list [winfo geom .t.f] [.t bbox 1.2]
} -cleanup {
    destroy .t.f
} -result [list \
    10x20+[expr {$padx+100}]+[expr {$pady+50}] \
    [list [expr {$padx+2*$fixedWidth}] [expr {$pady+($fixedHeight/2)}] 0 0]]

test textWind-8.1 {EmbWinDeleteProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 10 -height 20 -bg $color
    frame .f -width 10 -height 20 -background $color
    .t window create 1.2 -window .f
    bind .f <Destroy> {set x destroyed}
    set x XXX
    .t delete 1.2
    list $x [.t bbox 1.2] [.t bbox 1.3] [winfo exists .f]
} -result [list destroyed \
    [list [expr {$padx+2*$fixedWidth}] $pady $fixedWidth $fixedHeight] \
    [list [expr {$padx+3*$fixedWidth}] $pady $fixedWidth $fixedHeight] \
    0]

test textWind-8.2 {EmbWinDeleteProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 10 -height 20 -bg $color
    frame .f -width 10 -height 20 -background $color
    .t window create 1.2 -window .f
    bind .f <Destroy> {set x destroyed}
    set x XXX
    .t delete 1.2
    .t index .f
} -returnCodes error -result {bad text index ".f"}


test textWind-9.1 {EmbWinCleanupProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text\nA second line."
    frame .f -width 10 -height 20 -bg $color
    frame .f -width 10 -height 20 -background $color
    .t window create 2.3 -window .f
    .t delete 1.5 2.1
    .t index .f
} -cleanup {
    destroy .f
} -result {1.7}


test textWind-10.1 {EmbWinLayoutProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    .t window create 1.5 -create {
        frame .f -width 10 -height 20 -bg $color
        frame .f -width 10 -height 20 -background $color
    }
    update
    list [winfo exists .f] [winfo width .f] [winfo height .f] [.t index .f]
} -cleanup {
    destroy .f
} -result {1 10 20 1.5}

725
726
727
728
729
730
731
732

733
734
735
736
737
738
739
725
726
727
728
729
730
731

732
733
734
735
736
737
738
739







-
+







    }
} -body {
    .t insert 1.0 "Some sample text"
    set msg {}
    after idle {
        .t window create 1.5 -create {
            frame .t.f
            frame .t.f.f -width 10 -height 20 -bg $color
            frame .t.f.f -width 10 -height 20 -background $color
        }
    }
    set count 0
    while {([llength $msg] < 2) && ($count < 100)} {
        update
        incr count
        .t bbox 1.5
758
759
760
761
762
763
764
765

766
767
768
769
770
771
772
758
759
760
761
762
763
764

765
766
767
768
769
770
771
772







-
+







	}
    }
} -body {
    .t insert 1.0 "Some sample text"
    set msg {}
    .t window create 1.5 -create {
        frame .t.f
        frame .t.f.f -width 10 -height 20 -bg $color
        frame .t.f.f -width 10 -height 20 -background $color
    }
    update idletasks
    lappend msg [winfo exists .t.f.f]
} -cleanup {
    destroy .t.f
    rename bgerror {}
} -result {{{can't embed .t.f.f relative to .t}} 1}
858
859
860
861
862
863
864
865

866
867
868
869
870
871
872
873
874
875
876
877
878
879
880

881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896

897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912

913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928

929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944

945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965

966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985

986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004

1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025

1026
1027
1028

1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048

1049
1050
1051

1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071

1072
1073
1074
1075
1076
1077
1078
858
859
860
861
862
863
864

865
866
867
868
869
870
871
872
873
874
875
876
877
878
879

880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895

896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911

912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927

928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943

944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964

965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984

985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003

1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024

1025
1026
1027

1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047

1048
1049
1050

1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070

1071
1072
1073
1074
1075
1076
1077
1078







-
+














-
+















-
+















-
+















-
+















-
+




















-
+



















-
+


















-
+




















-
+


-
+



















-
+


-
+



















-
+








test textWind-10.10 {EmbWinLayoutProc procedure, doesn't fit on line} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t configure -wrap char
    .t insert 1.0 "Some sample text"
    frame .f -width [expr {($tWidth-12)*$fixedWidth-1}] -height 20 -bg $color -bd 2 -relief raised
    frame .f -width [expr {($tWidth-12)*$fixedWidth-1}] -height 20 -background $color -borderwidth 2 -relief raised
    .t window create 1.12 -window .f
    list [.t bbox .f] [.t bbox 1.13]
} -cleanup {
    destroy .f
} -result [list \
    [list [expr {$padx+12*$fixedWidth}] $pady [expr {$tWidth*$fixedWidth-12*$fixedWidth}] 20] \
    [list $padx [expr {$pady+20}] $fixedWidth $fixedHeight]]

test textWind-10.11 {EmbWinLayoutProc procedure, doesn't fit on line} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t configure -wrap char
    .t insert 1.0 "Some sample text"
    frame .f -width [expr {($tWidth-12)*$fixedWidth}] -height 20 -bg $color -bd 2 -relief raised
    frame .f -width [expr {($tWidth-12)*$fixedWidth}] -height 20 -background $color -borderwidth 2 -relief raised
    .t window create 1.12 -window .f
    update
    list [.t bbox .f] [.t bbox 1.13]
} -cleanup {
    destroy .f
} -result [list \
    [list [expr {$padx+12*$fixedWidth}] $pady [expr {$tWidth*$fixedWidth-12*$fixedWidth}] 20] \
    [list $padx [expr {$pady+20}] $fixedWidth $fixedHeight]]

test textWind-10.12 {EmbWinLayoutProc procedure, doesn't fit on line} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t configure -wrap char
    .t insert 1.0 "Some sample text"
    frame .f -width [expr {($tWidth-12)*$fixedWidth+1}] -height 20 -bg $color -bd 2 -relief raised
    frame .f -width [expr {($tWidth-12)*$fixedWidth+1}] -height 20 -background $color -borderwidth 2 -relief raised
    .t window create 1.12 -window .f
    update
    list [.t bbox .f] [.t bbox 1.13]
} -cleanup {
    destroy .f
} -result [list \
    [list $padx [expr {$pady+$fixedHeight}] [expr {($tWidth-12)*$fixedWidth+1}] 20] \
    [list [expr {$padx+($tWidth-12)*$fixedWidth+1}] [expr {$pady+$fixedHeight+((20-$fixedHeight)/2)}] $fixedWidth $fixedHeight]]

test textWind-10.13 {EmbWinLayoutProc procedure, doesn't fit on line} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t configure -wrap none
    .t insert 1.0 "Some sample text"
    frame .f -width [expr {($tWidth-12)*$fixedWidth+5}] -height 20 -bg $color -bd 2 -relief raised
    frame .f -width [expr {($tWidth-12)*$fixedWidth+5}] -height 20 -background $color -borderwidth 2 -relief raised
    .t window create 1.12 -window .f
    update
    list [.t bbox .f] [.t bbox 1.13]
} -cleanup {
    destroy .f
} -result [list \
    [list [expr {$padx+12*$fixedWidth}] $pady [expr {$tWidth*$fixedWidth-12*$fixedWidth}] 20] \
    {}]

test textWind-10.14 {EmbWinLayoutProc procedure, doesn't fit on line} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t configure -wrap none
    .t insert 1.0 "Some sample text"
    frame .f -width [expr {($tWidth-12)*$fixedWidth+5}] -height 220 -bg $color -bd 2 -relief raised
    frame .f -width [expr {($tWidth-12)*$fixedWidth+5}] -height 220 -background $color -borderwidth 2 -relief raised
    .t window create 1.12 -window .f
    update
    list [.t bbox .f] [.t bbox 1.13]
} -cleanup {
    destroy .f
} -result [list \
    [list [expr {$padx+12*$fixedWidth}] $pady [expr {$tWidth*$fixedWidth-12*$fixedWidth}] [expr {$tHeight*$fixedHeight}]] \
    {}]

test textWind-10.15 {EmbWinLayoutProc procedure, doesn't fit on line} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t configure -wrap char
    .t insert 1.0 "Some sample text"
    frame .f -width 250 -height 220 -bg $color -bd 2 -relief raised
    frame .f -width 250 -height 220 -background $color -borderwidth 2 -relief raised
    .t window create 1.12 -window .f
    update
    list [.t bbox .f] [.t bbox 1.13]
} -cleanup {
    destroy .f
} -result [list \
    [list $padx [expr {$pady+$fixedHeight}] [expr {$tWidth*$fixedWidth}] [expr {($tHeight-1)*$fixedHeight}]] \
    {}]

test textWind-11.1 {EmbWinDisplayProc procedure, geometry transforms} -setup {
    .t delete 1.0 end
    destroy .f
    place forget .t
    pack .t
# Make sure the Text is mapped before we start
    update
} -body {
    .t insert 1.0 "Some sample text"
    pack forget .t
    place .t -x 30 -y 50
    frame .f -width 30 -height 20 -bg $color
    frame .f -width 30 -height 20 -background $color
    .t window create 1.12 -window .f
    update ; after 100 ; update
    winfo geom .f
} -cleanup {
    destroy .f
    place forget .t
} -result [list 30x20+[expr {$padx+30+12*$fixedWidth}]+[expr {$pady+50}]]

test textWind-11.2 {EmbWinDisplayProc procedure, geometry transforms} -setup {
    .t delete 1.0 end
    destroy .t.f
    place forget .t
    pack .t
# Make sure the Text is mapped before we start
    update
} -body {
    .t insert 1.0 "Some sample text"
    pack forget .t
    place .t -x 30 -y 50
    frame .t.f -width 30 -height 20 -bg $color
    frame .t.f -width 30 -height 20 -background $color
    .t window create 1.12 -window .t.f
    update ; after 100 ; update
    winfo geom .t.f
} -cleanup {
    destroy .t.f
    place forget .t
    pack .t
} -result [list 30x20+[expr {$padx+12*$fixedWidth}]+$pady]

test textWind-11.3 {EmbWinDisplayProc procedure, configuration optimization} -setup {
    .t delete 1.0 end
    destroy .f
    place forget .t
    pack .t
# Make sure the Text is mapped before we start
    update
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 30 -height 20 -bg $color
    frame .f -width 30 -height 20 -background $color
    .t window create 1.12 -window .f
    update
    bind .f <Configure> {set x ".f configured"}
    set x {no configures}
    .t delete 1.0
    .t insert 1.0 "X"
    update
    return $x
} -cleanup {
    destroy .f
    place forget .t
    pack .t
} -result {no configures}

test textWind-11.4 {EmbWinDisplayProc procedure, horizontal scrolling} -setup {
    .t delete 1.0 end
    destroy .f .f2
} -body {
    .t insert 1.0 "xyzzy\nFirst window here: "
    .t configure -wrap none
    frame .f -width 30 -height 20 -bg $color
    frame .f -width 30 -height 20 -background $color
    .t window create end -window .f
    .t insert end " and second here: "
    frame .f2 -width 40 -height 10 -bg $color
    frame .f2 -width 40 -height 10 -background $color
    .t window create end -window .f2
    .t insert end " with junk after it."
    .t xview moveto 0
    .t xview scroll 5 units
    update
    list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] [winfo ismapped .f2]
} -cleanup {
    destroy .f .f2
} -result [list 1 \
    30x20+[expr {$padx+14*$fixedWidth}]+[expr {$pady+$fixedHeight}] \
    [list [expr {$padx+14*$fixedWidth}] [expr {$pady+$fixedHeight}] 30 20] \
    0]

test textWind-11.5 {EmbWinDisplayProc procedure, horizontal scrolling} -setup {
    .t delete 1.0 end
    destroy .f .f2
} -body {
    .t insert 1.0 "xyzzy\nFirst window here: "
    .t configure -wrap none
    frame .f -width 30 -height 20 -bg $color
    frame .f -width 30 -height 20 -background $color
    .t window create end -window .f
    .t insert end " and second here: "
    frame .f2 -width 40 -height 10 -bg $color
    frame .f2 -width 40 -height 10 -background $color
    .t window create end -window .f2
    .t insert end " with junk after it."
    update
    .t xview moveto 0
    .t xview scroll 25 units
    update
    list [winfo ismapped .f] [winfo ismapped .f2] [winfo geom .f2] [.t bbox .f2]
} -cleanup {
  destroy .f .f2
  .t configure -wrap char
} -result [list 0 1 \
    40x10+[expr {$padx+37*$fixedWidth+30-25*$fixedWidth}]+[expr {$pady+$fixedHeight+((20-10)/2)}] \
    [list [expr {$padx+37*$fixedWidth+30-25*$fixedWidth}] [expr {$pady+$fixedHeight+((20-10)/2)}] 40 10]]

test textWind-12.1 {EmbWinUndisplayProc procedure, mapping/unmapping} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 30 -height 20 -bg $color
    frame .f -width 30 -height 20 -background $color
    .t window create 1.2 -window .f
    bind .f <Map> {lappend x mapped}
    bind .f <Unmap> {lappend x unmapped}
    set x created
    update
    lappend x modified
    .t delete 1.0
1093
1094
1095
1096
1097
1098
1099
1100

1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115

1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130

1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145

1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160

1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175

1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190

1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205

1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222

1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239

1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259

1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279

1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295

1296
1297
1298
1299
1300
1301
1302
1093
1094
1095
1096
1097
1098
1099

1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114

1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129

1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144

1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159

1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174

1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189

1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204

1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221

1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238

1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258

1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278

1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294

1295
1296
1297
1298
1299
1300
1301
1302







-
+














-
+














-
+














-
+














-
+














-
+














-
+














-
+
















-
+
















-
+



















-
+



















-
+















-
+









test textWind-13.1 {EmbWinBboxProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 5 -height 5 -bg $color
    frame .f -width 5 -height 5 -background $color
    .t window create 1.2 -window .f -align top -padx 2 -pady 1
    update
    list [winfo geom .f] [.t bbox .f]
} -cleanup {
    destroy .f
} -result [list \
    5x5+[expr {$padx+2*$fixedWidth+2}]+[expr {$pady+1}] \
    [list [expr {$padx+2*$fixedWidth+2}] [expr {$pady+1}] 5 5]]

test textWind-13.2 {EmbWinBboxProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 5 -height 5 -bg $color
    frame .f -width 5 -height 5 -background $color
    .t window create 1.2 -window .f -align center -padx 2 -pady 1
    update
    list [winfo geom .f] [.t bbox .f]
} -cleanup {
    destroy .f
} -result [list \
    5x5+[expr {$padx+2*$fixedWidth+2}]+[expr {$pady+1+(($fixedHeight-7)/2)}] \
    [list [expr {$padx+2*$fixedWidth+2}] [expr {$pady+1+(($fixedHeight-7)/2)}] 5 5]]

test textWind-13.3 {EmbWinBboxProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 5 -height 5 -bg $color
    frame .f -width 5 -height 5 -background $color
    .t window create 1.2 -window .f -align baseline -padx 2 -pady 1
    update
    list [winfo geom .f] [.t bbox .f]
} -cleanup {
    destroy .f
} -result [list \
    5x5+[expr {$padx+2*$fixedWidth+2}]+[expr {$pady+1+($fixedAscent-6)}] \
    [list [expr {$padx+2*$fixedWidth+2}] [expr {$pady+1+($fixedAscent-6)}] 5 5]]

test textWind-13.4 {EmbWinBboxProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 5 -height 5 -bg $color
    frame .f -width 5 -height 5 -background $color
    .t window create 1.2 -window .f -align bottom -padx 2 -pady 1
    update
    list [winfo geom .f] [.t bbox .f]
} -cleanup {
    destroy .f
} -result [list \
    5x5+[expr {$padx+2*$fixedWidth+2}]+[expr {$pady+1+($fixedHeight-7)}] \
    [list [expr {$padx+2*$fixedWidth+2}] [expr {$pady+1+($fixedHeight-7)}] 5 5]]

test textWind-13.5 {EmbWinBboxProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 5 -height 5 -bg $color
    frame .f -width 5 -height 5 -background $color
    .t window create 1.2 -window .f -align top -padx 2 -pady 1 -stretch 1
    update
    list [winfo geom .f] [.t bbox .f]
} -cleanup {
    destroy .f
} -result [list \
    5x[expr {$fixedHeight-2}]+[expr {$padx+2*$fixedWidth+2}]+[expr {$pady+1}] \
    [list [expr {$padx+2*$fixedWidth+2}] [expr {$pady+1}] 5 [expr {$fixedHeight-2}]]]

test textWind-13.6 {EmbWinBboxProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 5 -height 5 -bg $color
    frame .f -width 5 -height 5 -background $color
    .t window create 1.2 -window .f -align center -padx 2 -pady 1 -stretch 1
    update
    list [winfo geom .f] [.t bbox .f]
} -cleanup {
    destroy .f
} -result [list \
    5x[expr {$fixedHeight-2}]+[expr {$padx+2*$fixedWidth+2}]+[expr {$pady+1}] \
    [list [expr {$padx+2*$fixedWidth+2}] [expr {$pady+1}] 5 [expr {$fixedHeight-2}]]]

test textWind-13.7 {EmbWinBboxProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 5 -height 5 -bg $color
    frame .f -width 5 -height 5 -background $color
    .t window create 1.2 -window .f -align baseline -padx 2 -pady 1 -stretch 1
    update
    list [winfo geom .f] [.t bbox .f]
} -cleanup {
    destroy .f
} -result [list \
    5x[expr {$fixedAscent-1}]+[expr {$padx+2*$fixedWidth+2}]+[expr {$pady+1}] \
    [list [expr {$padx+2*$fixedWidth+2}] [expr {$pady+1}] 5 [expr {$fixedAscent-1}]]]

test textWind-13.8 {EmbWinBboxProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 5 -height 5 -bg $color
    frame .f -width 5 -height 5 -background $color
    .t window create 1.2 -window .f -align bottom -padx 2 -pady 1 -stretch 1
    update
    list [winfo geom .f] [.t bbox .f]
} -cleanup {
    destroy .f
} -result [list \
    5x[expr {$fixedHeight-2}]+[expr {$padx+2*$fixedWidth+2}]+[expr {$pady+1}] \
    [list [expr {$padx+2*$fixedWidth+2}] [expr {$pady+1}] 5 [expr {$fixedHeight-2}]]]

test textWind-13.9 {EmbWinBboxProc procedure, spacing options} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t configure -spacing1 5 -spacing3 2
    .t delete 1.0 end
    .t insert 1.0 "Some sample text"
    frame .f -width 5 -height 5 -bg $color
    frame .f -width 5 -height 5 -background $color
    .t window create 1.2 -window .f -align center -padx 2 -pady 1
    update
    list [winfo geom .f] [.t bbox .f]
} -cleanup {
    .t configure -spacing1 0 -spacing3 0
    destroy .f
} -result [list \
    5x5+[expr {$padx+2*$fixedWidth+2}]+[expr {$pady+5+(($fixedHeight-5)/2)}] \
    [list [expr {$padx+2*$fixedWidth+2}] [expr {$pady+5+(($fixedHeight-5)/2)}] 5 5]]


test textWind-14.1 {EmbWinDelayedUnmap procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 30 -height 20 -bg $color
    frame .f -width 30 -height 20 -background $color
    .t window create 1.2 -window .f
    update
    bind .f <Unmap> {lappend x unmapped}
    set x modified
    .t insert 1.0 x
    lappend x removed
    .t window configure .f -window {}
    lappend x updated
    update
    return $x
} -cleanup {
    destroy .f
} -result {modified removed unmapped updated}

test textWind-14.2 {EmbWinDelayedUnmap procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text"
    frame .f -width 30 -height 20 -bg $color
    frame .f -width 30 -height 20 -background $color
    .t window create 1.2 -window .f
    update
    bind .f <Unmap> {lappend x unmapped}
    set x modified
    .t insert 1.0 x
    lappend x deleted
    .t delete .f
    lappend x updated
    update
    return $x
} -cleanup {
    destroy .f
} -result {modified deleted updated}

test textWind-14.3 {EmbWinDelayedUnmap procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t insert 1.0 "Some sample text\nAnother line\n3\n4\n5\n6\n7\n8\n9"
    frame .f -width 30 -height 20 -bg $color
    frame .f -width 30 -height 20 -background $color
    .t window create 1.2 -window .f
    update
    .t yview 2.0
    set result [winfo ismapped .f]
    update ; after 10
    list $result [winfo ismapped .f]
} -cleanup {
    destroy .f
} -result {1 0}

test textWind-14.4 {EmbWinDelayedUnmap procedure} -setup {
    .t delete 1.0 end
    destroy .t.f
} -body {
    .t insert 1.0 "Some sample text\nAnother line\n3\n4\n5\n6\n7\n8\n9"
    frame .t.f -width 30 -height 20 -bg $color
    frame .t.f -width 30 -height 20 -background $color
    .t window create 1.2 -window .t.f
    update
    .t yview 2.0
    set result [winfo ismapped .t.f]
    update
    list $result [winfo ismapped .t.f]
} -cleanup {
1312
1313
1314
1315
1316
1317
1318
1319

1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336

1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353

1354
1355
1356
1357
1358

1359
1360
1361
1362
1363
1364
1365
1312
1313
1314
1315
1316
1317
1318

1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335

1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352

1353
1354
1355
1356
1357

1358
1359
1360
1361
1362
1363
1364
1365







-
+
















-
+
















-
+




-
+







test textWind-15.2 {TkTextWindowIndex procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t configure -spacing1 0 -spacing2 0 -spacing3 0 \
        -wrap none
    .t insert 1.0 "Some sample text"
    frame .f -width 30 -height 20 -bg $color
    frame .f -width 30 -height 20 -background $color
    .t window create 1.6 -window .f
    .t tag add a 1.1
    .t tag add a 1.3
    list [.t index .f] [.t bbox 1.7]
} -cleanup {
    destroy .f
} -result [list 1.6 \
    [list [expr {$padx+6*$fixedWidth+30}] [expr {$pady+((20-$fixedHeight)/2)}] $fixedWidth $fixedHeight]]


test textWind-16.1 {EmbWinTextStructureProc procedure} -setup {
    .t delete 1.0 end
    destroy .f
} -body {
    .t configure -wrap none
    .t insert 1.0 "Some sample text"
    frame .f -width 30 -height 20 -bg $color
    frame .f -width 30 -height 20 -background $color
    .t window create 1.6 -window .f
    update
    pack forget .t
    update
    winfo ismapped .f
} -cleanup {
    pack .t
} -result 0

test textWind-16.2 {EmbWinTextStructureProc procedure} -setup {
    .t delete 1.0 end
    destroy .f .f2
} -body {
    .t configure -spacing1 0 -spacing2 0 -spacing3 0 \
        -wrap none
    .t insert 1.0 "Some sample text"
    frame .f -width 30 -height 20 -bg $color
    frame .f -width 30 -height 20 -background $color
    .t window create 1.6 -window .f
    update
    set result {}
    lappend result [winfo geom .f] [.t bbox .f]
    frame .f2 -width 150 -height 30 -bd 2 -relief raised
    frame .f2 -width 150 -height 30 -borderwidth 2 -relief raised
    pack .f2 -before .t
    update
    lappend result [winfo geom .f] [.t bbox .f]
} -cleanup {
    destroy .f .f2
} -result [list \
    30x20+[expr {$padx+6*$fixedWidth}]+$pady \
1382
1383
1384
1385
1386
1387
1388
1389

1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405

1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419

1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439

1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453

1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471

1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486

1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502

1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517

1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533

1534
1535

1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550


1551
1552
1553

1554
1555
1556
1557
1558
1559
1560
1382
1383
1384
1385
1386
1387
1388

1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404

1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418

1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438

1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452

1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470

1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485

1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501

1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516

1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532

1533
1534

1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548


1549
1550
1551
1552

1553
1554
1555
1556
1557
1558
1559
1560







-
+















-
+













-
+



















-
+













-
+

















-
+














-
+















-
+














-
+















-
+

-
+













-
-
+
+


-
+








test textWind-16.4 {EmbWinTextStructureProc procedure} -setup {
    .t delete 1.0 end
} -body {
    .t configure -spacing1 0 -spacing2 0 -spacing3 0 \
        -wrap none
    .t insert 1.0 "Some sample text"
    frame .t.f -width 30 -height 20 -bg $color
    frame .t.f -width 30 -height 20 -background $color
    .t window create 1.6 -window .t.f
    update
    pack forget .t
    update
    list [winfo ismapped .t.f] [.t bbox .t.f]
} -cleanup {
    pack .t
} -result [list 1 [list [expr {$padx+6*$fixedWidth}] $pady 30 20]]


test textWind-17.1 {peer widgets and embedded windows} -setup {
    destroy .t .tt .f
} -body {
    pack [text .t]
    .t insert end "Line 1"
    frame .f -width 20 -height 10 -bg blue
    frame .f -width 20 -height 10 -background blue
    .t window create 1.3 -window .f
    toplevel .tt
    pack [.t peer create .tt.t]
    update ; update
    destroy .t .tt
    winfo exists .f
} -result 0

test textWind-17.2 {peer widgets and embedded windows} -setup {
    destroy .t .f .tt
} -body {
    pack [text .t]
    .t insert end "Line 1\nLine 2"
    frame .f -width 20 -height 10 -bg blue
    frame .f -width 20 -height 10 -background blue
    .t window create 1.4 -window .f
    toplevel .tt
    pack [.t peer create .tt.t]
    update ; update
    destroy .t
    .tt.t insert 1.0 "foo"
    update
    destroy .tt
} -result {}

test textWind-17.3 {peer widget and -create} -setup {
    destroy .t .tt
} -body {
    pack [text .t]
    .t delete 1.0 end
    .t insert 1.0 "Some sample text"
    toplevel .tt
    pack [.t peer create .tt.t]
    update ; update
    .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue}
    .t window create 1.2 -create {frame %W.f -width 10 -height 20 -background blue}
    update
    destroy .t .tt
} -result {}

test textWind-17.4 {peer widget deleted one window shouldn't delete others} -setup {
    destroy .t .tt
    set res {}
} -body {
    pack [text .t]
    .t delete 1.0 end
    .t insert 1.0 "Some sample text"
    toplevel .tt
    pack [.t peer create .tt.t]
    .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue}
    .t window create 1.2 -create {frame %W.f -width 10 -height 20 -background blue}
    update ; update
    destroy .tt
    lappend res [.t get 1.2]
    update
    lappend res [.t get 1.2]
} -cleanup {
    destroy .t
} -result {{} {}}

test textWind-17.5 {peer widget window configuration} -setup {
    destroy .t .tt
} -body {
    pack [text .t]
    .t delete 1.0 end
    .t insert 1.0 "Some sample text"
    toplevel .tt
    pack [.t peer create .tt.t]
    .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue}
    .t window create 1.2 -create {frame %W.f -width 10 -height 20 -background blue}
    update ; update
    list [.t window cget 1.2 -window] [.tt.t window cget 1.2 -window]
} -cleanup {
    destroy .tt .t
} -result {.t.f .tt.t.f}

test textWind-17.6 {peer widget window configuration} -setup {
    destroy .t .tt
} -body {
    pack [text .t]
    .t delete 1.0 end
    .t insert 1.0 "Some sample text"
    toplevel .tt
    pack [.t peer create .tt.t]
    .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue}
    .t window create 1.2 -create {frame %W.f -width 10 -height 20 -background blue}
    update ; update
    list [.t window configure 1.2 -window] \
        [.tt.t window configure 1.2 -window]
} -cleanup {
    destroy .tt .t
}  -result {{-window {} {} {} .t.f} {-window {} {} {} .tt.t.f}}

test textWind-17.7 {peer widget window configuration} -setup {
    destroy .t .tt
} -body {
    pack [text .t]
    .t delete 1.0 end
    .t insert 1.0 "Some sample text"
    toplevel .tt
    pack [.t peer create .tt.t]
    .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue]
    .t window create 1.2 -window [frame .t.f -width 10 -height 20 -background blue]
    update ; update
    list [.t window cget 1.2 -window] [.tt.t window cget 1.2 -window]
} -cleanup {
    destroy .tt .t
}  -result {.t.f {}}

test textWind-17.8 {peer widget window configuration} -setup {
    destroy .t .tt
} -body {
    pack [text .t]
    .t delete 1.0 end
    .t insert 1.0 "Some sample text"
    toplevel .tt
    pack [.t peer create .tt.t]
    .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue]
    .t window create 1.2 -window [frame .t.f -width 10 -height 20 -background blue]
    update ; update
    list [.t window configure 1.2 -window] \
        [.tt.t window configure 1.2 -window]
} -cleanup {
    destroy .tt .t
}  -result {{-window {} {} {} .t.f} {-window {} {} {} {}}}

test textWind-17.9 {peer widget window configuration} -setup {
    destroy .t .tt
} -body {
    pack [text .t]
    .t delete 1.0 end
    .t insert 1.0 "Some sample text"
    toplevel .tt
    pack [.t peer create .tt.t]
    .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue]
    .t window create 1.2 -window [frame .t.f -width 10 -height 20 -background blue]
    update ; update
    .tt.t window configure 1.2 -window [frame .tt.t.f -width 10 -height 20 -bg red]
    .tt.t window configure 1.2 -window [frame .tt.t.f -width 10 -height 20 -background red]
    list [.t window configure 1.2 -window] [.tt.t window configure 1.2 -window]
} -cleanup {
    destroy .tt .t
}  -result {{-window {} {} {} .t.f} {-window {} {} {} .tt.t.f}}

test textWind-17.10 {peer widget window configuration} -setup {
    destroy .t .tt
} -body {
    pack [text .t]
    .t delete 1.0 end
    .t insert 1.0 "Some sample text"
    toplevel .tt
    pack [.t peer create .tt.t]
    .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue]
    .tt.t window create 1.2 -window [frame .tt.t.f -width 25 -height 20 -bg blue]
    .t window create 1.2 -window [frame .t.f -width 10 -height 20 -background blue]
    .tt.t window create 1.2 -window [frame .tt.t.f -width 25 -height 20 -background blue]
    update ; update
    .t window configure 1.2 -create \
      {destroy %W.f ; frame %W.f -width 50 -height 7 -bg red}
      {destroy %W.f ; frame %W.f -width 50 -height 7 -background red}
    .tt.t window configure 1.2 -window {}
    .t window configure 1.2 -window {}
    set res [list [.t window configure 1.2 -window] \
        [.tt.t window configure 1.2 -window]]
    update
    lappend res [.t window configure 1.2 -window] \
        [.tt.t window configure 1.2 -window]
Changes to tests/ttk/entry.test.
262
263
264
265
266
267
268
269
270


271
272
273
274

275
276
277
278
279
280
281
262
263
264
265
266
267
268


269
270
271
272
273

274
275
276
277
278
279
280
281







-
-
+
+



-
+







} -result [list "text" "" "newtext" "newtext"] -cleanup {
    destroy .e
    unset -nocomplain x
}

test entry-7.1 {Bad style options} -body {
    ttk::style theme create entry-7.1 -settings {
	ttk::style configure TEntry -foreground BadColor
	ttk::style map TEntry -foreground {readonly AnotherBadColor}
	ttk::style configure TEntry -color BadColor
	ttk::style map TEntry -color {readonly AnotherBadColor}
	ttk::style map TEntry -font {readonly ABadFont}
	ttk::style map TEntry \
	    -selectbackground {{} BadColor} \
	    -selectforeground {{} BadColor} \
	    -selectcolor {{} BadColor} \
	    -insertcolor {{} BadColor}
    }
    pack [ttk::entry .e -text "Don't crash"]
    ttk::style theme use entry-7.1
    update
    .e selection range 0 end
    update
332
333
334
335
336
337
338
339

340
341
342
343


344
345
346
347
348

349
350
351
352
353
354




355
356
357
358
359
360
361
332
333
334
335
336
337
338

339
340
341


342
343
344
345
346
347

348
349
350




351
352
353
354
355
356
357
358
359
360
361







-
+


-
-
+
+




-
+


-
-
-
-
+
+
+
+







} -body {
    .e configure -placeholder {Some text}
    .e cget -placeholder
} -cleanup {
    destroy .e
} -result {Some text}

test entry-10.2 {configuration option: "-placeholderforeground"} -setup {
test entry-10.2 {configuration option: "-placeholdercolor"} -setup {
    pack [ttk::entry .e]
} -body {
    .e configure -placeholder {Some text} -placeholderforeground red
    .e cget -placeholderforeground
    .e configure -placeholder {Some text} -placeholdercolor red
    .e cget -placeholdercolor
} -cleanup {
    destroy .e
} -result {red}

test entry-10.3 {styling option: "-placeholderforeground"} -setup {
test entry-10.3 {styling option: "-placeholdercolor"} -setup {
    pack [ttk::entry .e]
} -body {
    set current [ttk::style configure TEntry -placeholderforeground]
    ttk::style configure TEntry -placeholderforeground blue
    set res [ttk::style configure TEntry -placeholderforeground]
    ttk::style configure TEntry -placeholderforeground $current
    set current [ttk::style configure TEntry -placeholdercolor]
    ttk::style configure TEntry -placeholdercolor blue
    set res [ttk::style configure TEntry -placeholdercolor]
    ttk::style configure TEntry -placeholdercolor $current
    set res
} -cleanup {
    destroy .e
} -result {blue}

test entry-11.1 {Bug [2830360fff] - Don't loose invalid at focus events} -setup {
    pack [ttk::entry .e]
Changes to tests/ttk/progressbar.test.
84
85
86
87
88
89
90
91

92
93
94
95
96
97
98
99
100
101
102
103
104
105
106

107
108
109
110

111
112
113
114
115
116

117
118
119
120
121
122
123

124
125
84
85
86
87
88
89
90

91
92
93
94
95
96
97
98
99
100
101
102
103
104
105

106
107
108
109

110
111
112
113
114
115

116
117
118
119
120
121
122

123
124
125







-
+














-
+



-
+





-
+






-
+


}

# check existence and default value of each non-core option of the widget
test progressbar-3.1 "progressbar non-core options" -setup {
    set res {}
    ttk::progressbar .defaultpb
} -body {
    foreach option {-anchor -foreground -justify -style -text -wraplength \
    foreach option {-anchor -color -justify -style -text -wraplength \
                    -length -maximum -mode -orient -phase -value -variable} {
        lappend res [.defaultpb cget $option]
    }
    set res
} -cleanup {
    unset res
    destroy .defaultpb
} -result {w black left {} {} 0 100 100 determinate horizontal 0 0.0 {}}

test progressbar-3.2 "TIP #442 options are taken into account" -setup {
    set res {}
    pack [ttk::progressbar .p -value 0 -maximum 50 -orient horizontal -mode determinate -length 500]
    set thefont [font actual {Arial 10}]
} -body {
    .p configure -anchor c -foreground blue -justify right \
    .p configure -anchor c -color blue -justify right \
            -text "TIP #442\noptions are now tested" -wraplength 100
    update
    .p step 10
    .p configure -anchor e -font $thefont -foreground green -justify center \
    .p configure -anchor e -font $thefont -color green -justify center \
            -text "Changing the value of each option\nfrom TIP #442" -wraplength 250
    update
    .p step 20
    .p configure -orient vertical -text "Cannot be seen"
    update
    foreach option {-anchor -foreground -justify -text -wraplength} {
    foreach option {-anchor -color -justify -text -wraplength} {
        lappend res [list $option [.p cget $option]]
    }
    set res
} -cleanup {
    unset res thefont
    destroy .p
} -result {{-anchor e} {-foreground green} {-justify center} {-text {Cannot be seen}} {-wraplength 250}}
} -result {{-anchor e} {-color green} {-justify center} {-text {Cannot be seen}} {-wraplength 250}}

tcltest::cleanupTests
Changes to tests/ttk/treetags.test.
1
2
3
4
5
6


7
8
9
10
11
12
13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15






+
+








package require Tk
package require tcltest 2.2
namespace import -force tcltest::*
loadTestedCommands

testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}]

### treeview tag invariants:
#

proc assert {expr {message ""}} {
    if {![uplevel 1 [list expr $expr]]} {
        error "PANIC: $message ($expr failed)"
    }
170
171
172
173
174
175
176
177

178
179
180
181
182
183

184
185
186
187
188
189

190
191
192
193
194

195
196
197
198
199
200
201
172
173
174
175
176
177
178

179
180
181
182
183
184

185
186
187
188
189
190

191
192
193
194
195

196
197
198
199
200
201
202
203







-
+





-
+





-
+




-
+







} -result 1

test treetags-2.4 "Bad events" -body {
    $tv tag bind bad <Enter> { puts "Entered!" }
} -returnCodes error -result "unsupported event <Enter>*" -match glob

test treetags-3.0 "tag configure - set" -body {
    $tv tag configure tag1 -foreground blue -background red
    $tv tag configure tag1 -color blue -background red
} -cleanup {
    treeConstraints $tv
} -result {}

test treetags-3.1 "tag configure - get" -body {
    $tv tag configure tag1 -foreground
    $tv tag configure tag1 -color
} -cleanup {
    treeConstraints $tv
} -result blue

# @@@ fragile test
test treetags-3.2 "tag configure - enumerate" -body {
test treetags-3.2 "tag configure - enumerate" -constraints nodeprecated -body {
    $tv tag configure tag1
} -cleanup {
    treeConstraints $tv
} -result [list \
    -text {} -image {} -anchor {} -background red -foreground blue -font {} \
    -text {} -image {} -anchor {} -background red -color blue -foreground blue -font {} \
]

# The next test exercises tag resource management.
# If options are not properly freed, the message:
# Test file error: "Font times 20 still in cache."
# will show up on stderr at program exit.
#
Changes to tests/ttk/ttk.test.
58
59
60
61
62
63
64
65

66
67
68

69
70
71
72
73
74
75
58
59
60
61
62
63
64

65
66
67

68
69
70
71
72
73
74
75







-
+


-
+







	destroy .b1
	set V ""
    }
}

test ttk-6.6 "Bad color spec in styles" -body {
    pack [ttk::button .b1 -text Hi!]
    ttk::style configure TButton -foreground badColor
    ttk::style configure TButton -color badColor
    event generate .b1 <Expose>
    update
    ttk::style configure TButton -foreground black
    ttk::style configure TButton -color black
    destroy .b1
    set ::bgerror
} -result {unknown color name "badColor"}

test ttk-6.7 "Basic destruction test" -body {
    foreach widget $widgetClasses {
	ttk::$widget .w
Changes to tests/ttk/validate.test.
211
212
213
214
215
216
217
218

219
220
221
222
223
224
225
211
212
213
214
215
216
217

218
219
220
221
222
223
224
225







-
+







destroy .e
catch {unset ::e ::vVals}

# See bug #1236979

test validate-2.2 "configure in -validatecommand" -body {
    proc validate-2.2 {win str} {
	$win configure -foreground black
	$win configure -color black
	return 1
    }
    ttk::entry .e -textvariable var -validatecommand {validate-2.2 %W %P}
    .e validate
} -result 1 -cleanup { destroy .e }


Changes to tests/unixButton.test.
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
94
95
96
97
98
99
100



101
102

103
104
105
106
107
108
109
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
94
95
96
97



98
99
100
101

102
103
104
105
106
107
108
109







-
-
-
-
+
+
+
+


















-
-
-
-
+
+
+
+

















-
-
-
+
+
+

-
+







    unix testImageType
} -setup {
    deleteWindows
    imageCleanup
} -body {
    image create test image1
    image1 changed 0 0 0 0 60 40
    label .b1 -image image1 -bd 4 -padx 0 -pady 2
    button .b2 -image image1 -bd 4 -padx 0 -pady 2
    checkbutton .b3 -image image1 -bd 4 -padx 1 -pady 1
    radiobutton .b4 -image image1 -bd 4 -padx 2 -pady 0
    label .b1 -image image1 -borderwidth 4 -padx 0 -pady 2
    button .b2 -image image1 -borderwidth 4 -padx 0 -pady 2
    checkbutton .b3 -image image1 -borderwidth 4 -padx 1 -pady 1
    radiobutton .b4 -image image1 -borderwidth 4 -padx 2 -pady 0
    pack .b1 .b2 .b3 .b4
    update
    list [winfo reqwidth .b1] [winfo reqheight .b1] \
        [winfo reqwidth .b2] [winfo reqheight .b2] \
        [winfo reqwidth .b3] [winfo reqheight .b3] \
        [winfo reqwidth .b4] [winfo reqheight .b4]
} -cleanup {
    deleteWindows
    image delete image1
} -result [list 68 48 \
                74 54 \
	        [expr {72 + $bigIndicator}] 52 \
	        [expr {72 + $bigIndicator}] 52]
test unixbutton-1.2 {TkpComputeButtonGeometry procedure} -constraints {
    unix
} -setup {
    deleteWindows
} -body {
    label .b1 -bitmap question -bd 3 -padx 0 -pady 2
    button .b2 -bitmap question -bd 3 -padx 0 -pady 2
    checkbutton .b3 -bitmap question -bd 3 -padx 1 -pady 1
    radiobutton .b4 -bitmap question -bd 3 -padx 2 -pady 0
    label .b1 -bitmap question -borderwidth 3 -padx 0 -pady 2
    button .b2 -bitmap question -borderwidth 3 -padx 0 -pady 2
    checkbutton .b3 -bitmap question -borderwidth 3 -padx 1 -pady 1
    radiobutton .b4 -bitmap question -borderwidth 3 -padx 2 -pady 0
    pack .b1 .b2 .b3 .b4
    update
    list [winfo reqwidth .b1] [winfo reqheight .b1] \
        [winfo reqwidth .b2] [winfo reqheight .b2] \
        [winfo reqwidth .b3] [winfo reqheight .b3] \
        [winfo reqwidth .b4] [winfo reqheight .b4]
} -cleanup {
    deleteWindows
} -result [list 23 33 \
	        29 39 \
	        [expr {27 + $smallIndicator}] 37 \
	        [expr {27 + $smallIndicator}] 37]
test unixbutton-1.3 {TkpComputeButtonGeometry procedure} -constraints {
    unix
} -setup {
    deleteWindows
} -body {
    label .b1 -bitmap question -bd 3 -highlightthickness 4
    button .b2 -bitmap question -bd 3 -highlightthickness 0
    checkbutton .b3 -bitmap question -bd 3 -highlightthickness 1 \
    label .b1 -bitmap question -borderwidth 3 -highlightthickness 4
    button .b2 -bitmap question -borderwidth 3 -highlightthickness 0
    checkbutton .b3 -bitmap question -borderwidth 3 -highlightthickness 1 \
        -indicatoron 0
    radiobutton .b4 -bitmap question -bd 3 -highlightthickness 1 \
    radiobutton .b4 -bitmap question -borderwidth 3 -highlightthickness 1 \
    -indicatoron false
    pack .b1 .b2 .b3 .b4
    update
    list [winfo reqwidth .b1] [winfo reqheight .b1] \
        [winfo reqwidth .b2] [winfo reqheight .b2] \
        [winfo reqwidth .b3] [winfo reqheight .b3] \
        [winfo reqwidth .b4] [winfo reqheight .b4]
153
154
155
156
157
158
159
160
161
162
163




164
165
166
167
168
169
170
171
172
173
174
175
176
177
178

179
180

181
182

183
184

185
186
187
188
189
190
191
153
154
155
156
157
158
159




160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177

178
179

180
181

182
183

184
185
186
187
188
189
190
191







-
-
-
-
+
+
+
+














-
+

-
+

-
+

-
+







    deleteWindows
} -result {231 46}
test unixbutton-1.7 {TkpComputeButtonGeometry procedure} -constraints {
    unix nonPortable fonts
} -setup {
    deleteWindows
} -body {
    label .b1 -text Xagqpim -bd 2 -padx 0 -pady 2 -width 10
    button .b2 -text Xagqpim -bd 2 -padx 0 -pady 2 -height 5
    checkbutton .b3 -text Xagqpim -bd 2 -padx 1 -pady 1 -width 20 -height 2
    radiobutton .b4 -text Xagqpim -bd 2 -padx 2 -pady 0 -width 4
    label .b1 -text Xagqpim -borderwidth 2 -padx 0 -pady 2 -width 10
    button .b2 -text Xagqpim -borderwidth 2 -padx 0 -pady 2 -height 5
    checkbutton .b3 -text Xagqpim -borderwidth 2 -padx 1 -pady 1 -width 20 -height 2
    radiobutton .b4 -text Xagqpim -borderwidth 2 -padx 2 -pady 0 -width 4
    pack .b1 .b2 .b3 .b4
    update
    list [winfo reqwidth .b1] [winfo reqheight .b1] \
        [winfo reqwidth .b2] [winfo reqheight .b2] \
        [winfo reqwidth .b3] [winfo reqheight .b3] \
        [winfo reqwidth .b4] [winfo reqheight .b4]
} -cleanup {
    deleteWindows
} -result {74 22 60 84 168 38 61 22}
test unixbutton-1.8 {TkpComputeButtonGeometry procedure} -constraints {
    unix nonPortable fonts
} -setup {
    deleteWindows
} -body {
    label .b1 -text Xagqpim -bd 2 -padx 0 -pady 2 \
    label .b1 -text Xagqpim -borderwidth 2 -padx 0 -pady 2 \
    -highlightthickness 4
    button .b2 -text Xagqpim -bd 2 -padx 0 -pady 2 \
    button .b2 -text Xagqpim -borderwidth 2 -padx 0 -pady 2 \
    -highlightthickness 0
    checkbutton .b3 -text Xagqpim -bd 2 -padx 1 -pady 1  \
    checkbutton .b3 -text Xagqpim -borderwidth 2 -padx 1 -pady 1  \
    -highlightthickness 1 -indicatoron no
    radiobutton .b4 -text Xagqpim -bd 2 -padx 2 -pady 0 -indicatoron 0
    radiobutton .b4 -text Xagqpim -borderwidth 2 -padx 2 -pady 0 -indicatoron 0
    pack .b1 .b2 .b3 .b4
    update
    list [winfo reqwidth .b1] [winfo reqheight .b1] \
        [winfo reqwidth .b2] [winfo reqheight .b2] \
        [winfo reqwidth .b3] [winfo reqheight .b3] \
        [winfo reqwidth .b4] [winfo reqheight .b4]
} -cleanup {
236
237
238
239
240
241
242
243

244
245

246
247
248
249
250
251

252
253

254
255
256
257
258
259
260
236
237
238
239
240
241
242

243
244

245
246
247
248
249
250

251
252

253
254
255
256
257
258
259
260







-
+

-
+





-
+

-
+







        \nshow significant visible diffs\
        \nfor selected vs unselected."
    checkbutton .cb0 -anchor w -state disabled \
        -text Unselected -variable off
    checkbutton .cb1 -anchor w -state disabled \
        -text Selected -variable on
    checkbutton .cb2 -anchor w -state disabled \
        -text Unselected -variable off -disabledforeground ""
        -text Unselected -variable off -disabledcolor ""
    checkbutton .cb3 -anchor w -state disabled \
        -text Selected -variable on -disabledforeground ""
        -text Selected -variable on -disabledcolor ""
    radiobutton .rb0 -anchor w -state disabled \
        -text Unselected -variable off
    radiobutton .rb1 -anchor w -state disabled \
        -text Selected -variable on -value 1
    radiobutton .rb2 -anchor w -state disabled \
        -text Unselected -variable off -disabledforeground ""
        -text Unselected -variable off -disabledcolor ""
    radiobutton .rb3 -anchor w -state disabled \
        -text Selected -variable on -value 1 -disabledforeground ""
        -text Selected -variable on -value 1 -disabledcolor ""
    pack .l .cb0 .cb1 .cb2 .cb3 .rb0 .rb1 .rb2 .rb3 -side top -fill x
    after 400
    set on
} -cleanup {
    deleteWindows
} -result 1

Changes to tests/unixEmbed.test.
55
56
57
58
59
60
61
62

63
64
65
66
67
68
69
55
56
57
58
59
60
61

62
63
64
65
66
67
68
69







-
+







# Arguments:
# w -		Name of toplevel window to create.

proc eatColors {w} {
    catch {destroy $w}
    toplevel $w
    wm geom $w +0+0
    canvas $w.c -width 400 -height 200 -bd 0
    canvas $w.c -width 400 -height 200 -borderwidth 0
    pack $w.c
    for {set y 0} {$y < 8} {incr y} {
	for {set x 0} {$x < 40} {incr x} {
	    set color [format #%02x%02x%02x [expr $x*6] [expr $y*30] 0]
	    $w.c create rectangle [expr 10*$x] [expr 20*$y] \
		    [expr 10*$x + 10] [expr 20*$y + 20] -outline {} \
		    -fill $color
386
387
388
389
390
391
392
393

394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409

410
411
412
413
414
415
416
386
387
388
389
390
391
392

393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408

409
410
411
412
413
414
415
416







-
+















-
+







	unix
} -setup {
	deleteWindows
    update
} -body {
    toplevel .t1 -container 1
    wm geometry .t1 +0+0
    toplevel .t2 -use [winfo id .t1] -bg red
    toplevel .t2 -use [winfo id .t1] -background red
    update
    wm geometry .t2
} -cleanup {
	deleteWindows
} -result {200x200+0+0}
test unixEmbed-3.3 {ContainerEventProc procedure, disallow position changes} -constraints {
	unix notAqua
} -setup {
	deleteWindows
} -body {
    frame .f1 -container 1 -width 200 -height 50
    pack .f1
    dobg "set w1 [winfo id .f1]"
    dobg {
	    eval destroy [winfo child .]
	    toplevel .t1 -use $w1 -bd 2 -relief raised
	    toplevel .t1 -use $w1 -borderwidth 2 -relief raised
	    update
	    wm geometry .t1 +30+40
    }
    update
    dobg {
	    wm geometry .t1
    }
426
427
428
429
430
431
432
433

434
435
436
437
438
439
440
426
427
428
429
430
431
432

433
434
435
436
437
438
439
440







-
+







    load {} Tktest child
} -body {
    frame .f1 -container 1 -width 200 -height 50
    pack .f1
    child alias w1 winfo id .f1
    child eval {
        destroy [winfo child .]
        toplevel .t1 -use [w1] -bd 2 -relief raised
        toplevel .t1 -use [w1] -borderwidth 2 -relief raised
        update
        wm geometry .t1 +30+40
        update
        wm geometry .t1
    }
} -cleanup {
    interp delete child
1095
1096
1097
1098
1099
1100
1101
1102

1103
1104
1105
1106
1107
1108
1109
1095
1096
1097
1098
1099
1100
1101

1102
1103
1104
1105
1106
1107
1108
1109







-
+







} -body {
    frame .f1 -container 1 -width 200 -height 50
    frame .f2 -width 200 -height 50
    pack .f1 .f2
    dobg "set w1 [winfo id .f1]"
    dobg {
	    eval destroy [winfo child .]
	    toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken
	    toplevel .t1 -use $w1 -highlightthickness 2 -borderwidth 2 -relief sunken
    }
    focus -force .f2
    update
    list [dobg {
	    focus .t1
	    set x [list [focus]]
	    update
1123
1124
1125
1126
1127
1128
1129
1130

1131
1132
1133
1134
1135
1136
1137
1123
1124
1125
1126
1127
1128
1129

1130
1131
1132
1133
1134
1135
1136
1137







-
+







    frame .f1 -container 1 -width 200 -height 50
    frame .f2 -width 200 -height 50
    pack .f1 .f2
    update
    child alias w1 winfo id .f1
    child eval {
        destroy [winfo child .]
        toplevel .t1 -use [w1] -highlightthickness 2 -bd 2 -relief sunken
        toplevel .t1 -use [w1] -highlightthickness 2 -borderwidth 2 -relief sunken
    }
    # This should clear focus from the application embedded in .f1
    focus -force .f2
    update
    list [child eval {
        set x [list [focus]]
        focus .t1
1151
1152
1153
1154
1155
1156
1157
1158

1159
1160
1161
1162
1163
1164
1165
1151
1152
1153
1154
1155
1156
1157

1158
1159
1160
1161
1162
1163
1164
1165







-
+







    frame .f2 -width 200 -height 50
    pack .f1 .f2
    update
    set w1 [winfo id .f1]
    child eval "set argv {-use [winfo id .f1]}"
    load {} Tk child
    child eval {
	    . configure -bd 2 -highlightthickness 2 -relief sunken
	    . configure -borderwidth 2 -highlightthickness 2 -relief sunken
    }
    focus -force .f2
    update
    list [child eval {
	    focus .
	    set x [list [focus]]
	    update
1197
1198
1199
1200
1201
1202
1203
1204

1205
1206
1207
1208
1209
1210
1211
1197
1198
1199
1200
1201
1202
1203

1204
1205
1206
1207
1208
1209
1210
1211







-
+







} -body {
    frame .f1 -container 1 -width 200 -height 50
    pack .f1
    update
    dobg "set w1 [winfo id .f1]"
    dobg {
	    eval destroy [winfo child .]
	    toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken
	    toplevel .t1 -use $w1 -highlightthickness 2 -borderwidth 2 -relief sunken
	    set x {}
	    lappend x [testembed]
	    destroy .t1
	    lappend x [testembed]
    }
} -cleanup {
	deleteWindows
1219
1220
1221
1222
1223
1224
1225
1226

1227
1228
1229
1230
1231
1232
1233
1219
1220
1221
1222
1223
1224
1225

1226
1227
1228
1229
1230
1231
1232
1233







-
+







    load {} Tktest child
} -body {
    frame .f1 -container 1 -width 200 -height 50
    pack .f1
    child alias w1 winfo id .f1
    child eval {
        destroy [winfo child .]
        toplevel .t1 -use [w1] -highlightthickness 2 -bd 2 -relief sunken
        toplevel .t1 -use [w1] -highlightthickness 2 -borderwidth 2 -relief sunken
        set x {}
        lappend x [testembed]
        destroy .t1
        lappend x [testembed]
    }
} -cleanup {
    interp delete child
1272
1273
1274
1275
1276
1277
1278
1279

1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298

1299
1300
1301
1302
1303
1304
1305
1272
1273
1274
1275
1276
1277
1278

1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297

1298
1299
1300
1301
1302
1303
1304
1305







-
+


















-
+







    unix
} -setup {
    deleteWindows
} -body {
    toplevel .t
    pack [frame .t.f -container 1 -width 200 -height 200] -fill both
    update idletasks
    toplevel .embed -use [winfo id .t.f] -bg green
    toplevel .embed -use [winfo id .t.f] -background green
    update idletasks
    focus -force .t
    focus -force .embed
    focus
} -cleanup {
    deleteWindows
} -result .embed
test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints {
    unix pressbutton
} -setup {
    deleteWindows
} -body {
    toplevel .main
    set result {}
    pack [button .main.b -text "Main Button" \
	      -command {lappend result ".main.b"}] -padx 30 -pady 30
    pack [frame .main.f -container 1 -width 200 -height 200] -fill both
    update idletasks
    toplevel .embed -use [winfo id .main.f] -bg green
    toplevel .embed -use [winfo id .main.f] -background green
    pack [button .embed.b -text "Emb Button" \
	      -command {lappend result ".embed.b"}] -padx 30 -pady 30
    wm geometry .main 200x400+100+100
    update idletasks
    focus -force .main
    set x [expr {[winfo x .main ] + [winfo x .main.b] + 40}]
    set y [expr {[winfo y .main ] + [winfo y .main.b] + 38}]
Changes to tests/unixFont.test.
51
52
53
54
55
56
57
58

59
60
61
62
63
64
65
51
52
53
54
55
56
57

58
59
60
61
62
63
64
65







-
+








# Font should be fixed width and have chars missing below char 32, so can
# test control char expansion and missing character code.

set courier {Courier -10}
set cx [font measure $courier 0]

label .b.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left -text "0" -font fixed
label .b.l -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0 -justify left -text "0" -font fixed
pack .b.l
canvas .b.c -closeenough 0

set t [.b.c create text 0 0 -anchor nw -just left -font $courier]
pack .b.c
update

Changes to tests/unixMenu.test.
813
814
815
816
817
818
819
820

821
822
823
824
825
826
827
813
814
815
816
817
818
819

820
821
822
823
824
825
826
827







-
+







} -result {{} {}}
test unixMenu-23.2 {TkpDrawMenuEntry - gc for active menu item with its own gc} -constraints {
    unix
} -setup {
    destroy .m1
} -body {
    menu .m1
    .m1 add command -label foo -activeforeground red
    .m1 add command -label foo -activecolor red
    set tearoff [tk::TearOffMenu .m1 40 40]
    .m1 entryconfigure 1 -state active
    list [update] [destroy .m1]
} -result {{} {}}
test unixMenu-23.3 {TkpDrawMenuEntry - gc for active and strict motif} -constraints {
    unix
} -setup {
835
836
837
838
839
840
841
842

843
844
845
846
847
848
849
850
851
852

853
854
855
856
857
858
859
860
861
862

863
864
865
866
867
868
869
870
871
872
873

874
875
876
877
878
879
880
835
836
837
838
839
840
841

842
843
844
845
846
847
848
849
850
851

852
853
854
855
856
857
858
859
860
861

862
863
864
865
866
867
868
869
870
871
872

873
874
875
876
877
878
879
880







-
+









-
+









-
+










-
+







    list [update] [destroy .m1] [set tk_strictMotif 0]
} -result {{} {} 0}
test unixMenu-23.4 {TkpDrawMenuEntry - gc for disabled with disabledfg and custom entry} -constraints {
    unix
} -setup {
    destroy .m1
} -body {
    menu .m1 -disabledforeground blue
    menu .m1 -disabledcolor blue
    .m1 add command -label foo -state disabled -background red
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [update] [destroy .m1]
} -result {{} {}}
test unixMenu-23.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} -constraints {
    unix
} -setup {
    destroy .m1
} -body {
    menu .m1 -disabledforeground blue
    menu .m1 -disabledcolor blue
    .m1 add command -label foo -state disabled
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [update] [destroy .m1]
} -result {{} {}}
test unixMenu-23.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} -constraints {
    unix
} -setup {
    destroy .m1
} -body {
    menu .m1 -disabledforeground ""
    menu .m1 -disabledcolor ""
    .m1 add command -label foo -state disabled
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [update] [destroy .m1]
} -result {{} {}}
test unixMenu-23.7 {TkpDrawMenuEntry - gc for normal - custom entry} -constraints {
    unix
} -setup {
    destroy .m1
} -body {
    menu .m1
    .m1 add command -label foo -foreground red
    .m1 add command -label foo -color red
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [update] [destroy .m1]
} -result {{} {}}
test unixMenu-23.8 {TkpDrawMenuEntry - gc for normal} -constraints unix -setup {
    destroy .m1
} -body {
    menu .m1
938
939
940
941
942
943
944
945

946
947
948
949
950
951
952
938
939
940
941
942
943
944

945
946
947
948
949
950
951
952







-
+







} -result {{} {} 0}
test unixMenu-23.14 {TkpDrawMenuEntry - active border - custom entry} -constraints {
    unix
} -setup {
    destroy .m1
} -body {
    menu .m1
    .m1 add command -label foo -activeforeground yellow
    .m1 add command -label foo -activecolor yellow
    set tearoff [tk::TearOffMenu .m1 40 40]
    .m1 entryconfigure 1 -state active
    list [update] [destroy .m1]
} -result {{} {}}
test unixMenu-23.15 {TkpDrawMenuEntry - active border} -constraints unix -setup {
    destroy .m1
} -body {
Changes to tests/unixWm.test.
272
273
274
275
276
277
278
279

280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300

301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319

320
321
322
323
324
325
326
327
328


329
330
331
332
333
334
335
336
337
338

339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355

356
357
358
359
360
361
362
272
273
274
275
276
277
278

279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299

300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318

319
320
321
322
323
324
325
326


327
328
329
330
331
332
333
334
335
336
337

338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354

355
356
357
358
359
360
361
362







-
+




















-
+


















-
+







-
-
+
+









-
+
















-
+







destroy .t

test unixWm-8.1 {icon windows} unix {
    destroy .t
    destroy .icon
    toplevel .t -width 100 -height 30
    wm geometry .t +0+0
    toplevel .icon -width 50 -height 50 -bg red
    toplevel .icon -width 50 -height 50 -background red
    wm iconwindow .t .icon
    list [catch {wm withdraw .icon} msg] $msg
} {1 {can't withdraw .icon: it is an icon for .t}}
test unixWm-8.2 {icon windows} unix {
    destroy .t
    toplevel .t -width 100 -height 30
    list [catch {wm iconwindow} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
test unixWm-8.3 {icon windows} unix {
    destroy .t
    toplevel .t -width 100 -height 30
    list [catch {wm iconwindow .t b c} msg] $msg
} {1 {wrong # args: should be "wm iconwindow window ?pathName?"}}
test unixWm-8.4 {icon windows} {unix failsOnUbuntu} {
    destroy .t
    destroy .icon
    toplevel .t -width 100 -height 30
    wm geom .t +0+0
    update idletasks
    set result [wm iconwindow .t]
    toplevel .icon -width 50 -height 50 -bg red
    toplevel .icon -width 50 -height 50 -background red
    wm iconwindow .t .icon
    lappend result [wm iconwindow .t] [wm state .icon]
    wm iconwindow .t {}
    lappend result [wm iconwindow .t] [wm state .icon]
    update
    lappend result [winfo ismapped .t] [winfo ismapped .icon]
    wm iconify .t
    update idletasks
    lappend result [winfo ismapped .t] [winfo ismapped .icon]
} {.icon icon {} withdrawn 1 0 0 0}
test unixWm-8.5 {icon windows} unix {
    destroy .t
    toplevel .t -width 100 -height 30
    list [catch {wm iconwindow .t .gorp} msg] $msg
} {1 {bad window path name ".gorp"}}
test unixWm-8.6 {icon windows} unix {
    destroy .t
    toplevel .t -width 100 -height 30
    frame .t.icon -width 50 -height 50 -bg red
    frame .t.icon -width 50 -height 50 -background red
    list [catch {wm iconwindow .t .t.icon} msg] $msg
} {1 {can't use .t.icon as icon window: not at top level}}
test unixWm-8.7 {icon windows} unix {
    destroy .t
    destroy .icon
    toplevel .t -width 100 -height 30
    wm geom .t +0+0
    toplevel .icon -width 50 -height 50 -bg red
    toplevel .icon2 -width 50 -height 50 -bg green
    toplevel .icon -width 50 -height 50 -background red
    toplevel .icon2 -width 50 -height 50 -background green
    wm iconwindow .t .icon
    set result "[wm iconwindow .t] [wm state .icon] [wm state .icon2]"
    wm iconwindow .t .icon2
    lappend result [wm iconwindow .t] [wm state .icon] [wm state .icon2]
} {.icon icon normal .icon2 withdrawn icon}
destroy .icon2
test unixWm-8.8 {icon windows} unix {
    destroy .t
    destroy .icon
    toplevel .icon -width 50 -height 50 -bg red
    toplevel .icon -width 50 -height 50 -background red
    wm geom .icon +0+0
    update
    set result [winfo ismapped .icon]
    toplevel .t -width 100 -height 30
    wm geom .t +0+0
    tkwait visibility .t	;# Needed to keep tvtwm happy.
    wm iconwindow .t .icon
    lappend result [winfo ismapped .t] [winfo ismapped .icon]
} {1 1 0}
test unixWm-8.9 {icon windows} {unix nonPortable} {
    # This test is non-portable because some window managers will
    # destroy an icon window when it's associated window is destroyed.

    destroy .t
    destroy .icon
    toplevel .t -width 100 -height 30
    toplevel .icon -width 50 -height 50 -bg red
    toplevel .icon -width 50 -height 50 -background red
    wm geom .t +0+0
    wm iconwindow .t .icon
    update
    set result "[wm state .icon] [winfo ismapped .t] [winfo ismapped .icon]"
    destroy .t
    wm geom .icon +0+0
    update
407
408
409
410
411
412
413
414

415
416
417
418
419
420
421

422
423
424
425
426
427
428
407
408
409
410
411
412
413

414
415
416
417
418
419
420

421
422
423
424
425
426
427
428







-
+






-
+







    update
    testprop [testwrapper .t] WM_COMMAND
} {test
command
}
test unixWm-9.3 {TkWmMapWindow procedure, iconic windows} unix {
    destroy .t
    toplevel .t -width 100 -height 300 -bg blue
    toplevel .t -width 100 -height 300 -background blue
    wm geom .t +0+0
    wm iconify .t
    winfo ismapped .t
} 0
test unixWm-9.4 {TkWmMapWindow procedure, icon windows} unix {
    destroy .t
    toplevel .t -width 100 -height 50 -bg blue
    toplevel .t -width 100 -height 50 -background blue
    tkwait visibility .t
    wm iconwindow . .t
    update
    set result [winfo ismapped .t]
} 0
test unixWm-9.5 {TkWmMapWindow procedure, normal windows} unix {
    destroy .t
439
440
441
442
443
444
445
446

447
448
449

450
451
452
453
454
455
456
439
440
441
442
443
444
445

446
447
448

449
450
451
452
453
454
455
456







-
+


-
+







    update
    .t configure -width 200 -height 100
    destroy .t
} {}
test unixWm-10.2 {TkWmDeadWindow procedure, destroying menubar} {unix testmenubar} {
    destroy .t
    destroy .f
    toplevel .t -width 300 -height 200 -bd 2 -relief raised
    toplevel .t -width 300 -height 200 -borderwidth 2 -relief raised
    wm geom .t +0+0
    update
    frame .f -width 400 -height 30 -bd 2 -relief raised -bg green
    frame .f -width 400 -height 30 -borderwidth 2 -relief raised -background green
    bind .f <Destroy> {lappend result destroyed}
    testmenubar window .t .f
    update
    set result {}
    destroy .t
    lappend result [winfo exists .f]
} {destroyed 0}
625
626
627
628
629
630
631
632

633
634
635
636
637
638
639
625
626
627
628
629
630
631

632
633
634
635
636
637
638
639







-
+







} {1 {unmatched open brace in list}}

test unixWm-16.1 {Tk_WmCmd procedure, "deiconify" option} unix {
    list [catch {wm deiconify .t 12} msg] $msg
} {1 {wrong # args: should be "wm deiconify window"}}
test unixWm-16.2 {Tk_WmCmd procedure, "deiconify" option} unix {
    destroy .icon
    toplevel .icon -width 50 -height 50 -bg red
    toplevel .icon -width 50 -height 50 -background red
    wm iconwindow .t .icon
    set result [list [catch {wm deiconify .icon} msg] $msg]
    destroy .icon
    set result
} {1 {can't deiconify .icon: it is an icon for .t}}
test unixWm-16.3 {Tk_WmCmd procedure, "deiconify" option} {unix failsOnUbuntu} {
    wm iconify .t
938
939
940
941
942
943
944
945

946
947
948
949
950
951
952
938
939
940
941
942
943
944

945
946
947
948
949
950
951
952







-
+







} {1 {expected integer but got "lousy"}}

test unixWm-27.1 {Tk_WmCmd procedure, "iconwindow" option} unix {
    list [catch {wm iconwindow .t 12 13} msg] $msg
} {1 {wrong # args: should be "wm iconwindow window ?pathName?"}}
test unixWm-27.2 {Tk_WmCmd procedure, "iconwindow" option} {unix testwrapper} {
    destroy .icon
    toplevel .icon -width 50 -height 50 -bg green
    toplevel .icon -width 50 -height 50 -background green
    set result {}
    lappend result [wm iconwindow .t]
    wm iconwindow .t .icon
    set prop [testprop [testwrapper .t] WM_HINTS]
    lappend result [wm iconwindow .t] [wm state .icon]
    lappend result [format 0x%x [expr 0x8 & [lindex $prop 0]]]
    lappend result [expr [testwrapper .icon] == [lindex $prop 4]]
965
966
967
968
969
970
971
972

973
974
975
976
977
978
979
980
981
982
983
984
985
986


987
988
989
990
991
992
993
994
995
996
997

998
999
1000
1001
1002
1003
1004
965
966
967
968
969
970
971

972
973
974
975
976
977
978
979
980
981
982
983
984


985
986
987
988
989
990
991
992
993
994
995
996

997
998
999
1000
1001
1002
1003
1004







-
+












-
-
+
+










-
+







    button .b -text Help
    set result [list [catch {wm iconwindow .t .b} msg] $msg]
    destroy .b
    set result
} {1 {can't use .b as icon window: not at top level}}
test unixWm-27.5 {Tk_WmCmd procedure, "iconwindow" option} unix {
    destroy .icon
    toplevel .icon -width 50 -height 50 -bg green
    toplevel .icon -width 50 -height 50 -background green
    destroy .t2
    toplevel .t2
    wm geom .t2 -0+0
    wm iconwindow .t2 .icon
    set result [list [catch {wm iconwindow .t .icon} msg] $msg]
    destroy .t2
    destroy .icon
    set result
} {1 {.icon is already an icon for .t2}}
test unixWm-27.6 {Tk_WmCmd procedure, "iconwindow" option, changing icons} unix {
    destroy .icon
    destroy .icon2
    toplevel .icon -width 50 -height 50 -bg green
    toplevel .icon2 -width 50 -height 50 -bg red
    toplevel .icon -width 50 -height 50 -background green
    toplevel .icon2 -width 50 -height 50 -background red
    set result {}
    wm iconwindow .t .icon
    lappend result [wm state .icon] [wm state .icon2]
    wm iconwindow .t .icon2
    lappend result [wm state .icon] [wm state .icon2]
    destroy .icon .icon2
    set result
} {icon normal withdrawn icon}
test unixWm-27.7 {Tk_WmCmd procedure, "iconwindow" option, withdrawing icon} unix {
    destroy .icon
    toplevel .icon -width 50 -height 50 -bg green
    toplevel .icon -width 50 -height 50 -background green
    wm geometry .icon +0+0
    update
    set result {}
    lappend result [wm state .icon] [winfo viewable .icon]
    wm iconwindow .t .icon
    lappend result [wm state .icon] [winfo viewable .icon]
    destroy .icon
1383
1384
1385
1386
1387
1388
1389
1390

1391
1392
1393
1394
1395

1396
1397
1398
1399
1400
1401
1402
1383
1384
1385
1386
1387
1388
1389

1390
1391
1392
1393
1394

1395
1396
1397
1398
1399
1400
1401
1402







-
+




-
+







    lappend result [winfo width .t] [winfo height .t]
    .t configure -width 200 -height 300
    update idletasks
    lappend result [winfo width .t] [winfo height .t]
} {400 150 200 300}
test unixWm-41.2 {ConfigureEvent procedure, menubars} {nonPortable testmenubar} {
    destroy .t
    toplevel .t -width 300 -height 200 -bd 2 -relief raised
    toplevel .t -width 300 -height 200 -borderwidth 2 -relief raised
    wm geom .t +0+0
    update
    set x [winfo rootx .t]
    set y [winfo rooty .t]
    frame .t.m -bd 2 -relief raised -height 20
    frame .t.m -borderwidth 2 -relief raised -height 20
    testmenubar window .t .t.m
    update
    set result {}
    bind .t <Configure> {
	if {"%W" == ".t"} {
	    lappend result "%W: %wx%h"
	}
1454
1455
1456
1457
1458
1459
1460
1461

1462
1463
1464

1465
1466
1467
1468
1469
1470
1471
1454
1455
1456
1457
1458
1459
1460

1461
1462
1463

1464
1465
1466
1467
1468
1469
1470
1471







-
+


-
+







    lappend result $x [winfo ismapped .t]
} {unmapped 0 mapped 1}

test unixWm-43.1 {TopLevelReqProc procedure, embedded in same process} unix {
    destroy .t
    toplevel .t -width 200 -height 200
    wm geom .t +0+0
    frame .t.f -container 1 -bd 2 -relief raised
    frame .t.f -container 1 -borderwidth 2 -relief raised
    place .t.f -x 20 -y 10
    tkwait visibility .t.f
    toplevel .t2 -use [winfo id .t.f] -width 30 -height 20 -bg blue
    toplevel .t2 -use [winfo id .t.f] -width 30 -height 20 -background blue
    tkwait visibility .t2
    set result {}
    .t2 configure -width 70 -height 120
    update
    lappend result [winfo reqwidth .t.f] [winfo reqheight .t.f]
    lappend result [winfo width .t2] [winfo height .t2]
    # destroy .t2
1588
1589
1590
1591
1592
1593
1594
1595

1596
1597
1598
1599
1600
1601
1602
1588
1589
1590
1591
1592
1593
1594

1595
1596
1597
1598
1599
1600
1601
1602







-
+







test unixWm-44.10 {UpdateGeometryInfo procedure, menubar changing} testmenubar {
    destroy .t
    toplevel .t -width 80 -height 60
    wm resizable .t 0 0
    wm geometry .t +0+0
    tkwait visibility .t
    .t configure -width 180 -height 50
    frame .t.m -bd 2 -relief raised -width 100 -height 50
    frame .t.m -borderwidth 2 -relief raised -width 100 -height 50
    testmenubar window .t .t.m
    update
    .t configure -height 70
    .t.m configure -height 30
    list [update] [destroy .t]
} {{} {}}

1671
1672
1673
1674
1675
1676
1677
1678

1679
1680
1681
1682
1683
1684
1685
1671
1672
1673
1674
1675
1676
1677

1678
1679
1680
1681
1682
1683
1684
1685







-
+







    update
    list $result $x
} {no yes}

test unixWm-47.1 {WaitRestrictProc procedure} {unix nonPortable} {
    destroy .t
    toplevel .t -width 300 -height 200
    frame .t.f -bd 2 -relief raised
    frame .t.f -borderwidth 2 -relief raised
    place .t.f -x 20 -y 30 -width 100 -height 20
    wm geometry .t +0+0
    tkwait visibility .t
    set result {}
    bind .t.f <Configure> {lappend result {configure on .t.f}}
    bind .t <Map> {lappend result {map on .t}}
    bind .t <Unmap> {lappend result {unmap on .t}; bind .t <Unmap> {}}
1755
1756
1757
1758
1759
1760
1761
1762

1763
1764

1765
1766
1767
1768
1769
1770
1771
1772
1773

1774
1775
1776
1777
1778
1779


1780
1781

1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800

1801
1802
1803

1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822

1823
1824
1825

1826
1827
1828
1829
1830
1831
1832
1755
1756
1757
1758
1759
1760
1761

1762
1763

1764
1765
1766
1767
1768
1769
1770
1771
1772

1773
1774
1775
1776
1777


1778
1779
1780

1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799

1800
1801
1802

1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821

1822
1823
1824

1825
1826
1827
1828
1829
1830
1831
1832







-
+

-
+








-
+




-
-
+
+

-
+


















-
+


-
+


















-
+


-
+







    list [expr [winfo x .t] - $x] [expr [winfo y .t] - $y] \
	    [winfo width .t] [winfo height .t]
} {50 -100 150 300}

test unixWm-49.1 {Tk_GetRootCoords procedure} unix {
    destroy .t
    toplevel .t -width 300 -height 200
    frame .t.f -width 150 -height 100 -bd 2 -relief raised
    frame .t.f -width 150 -height 100 -borderwidth 2 -relief raised
    place .t.f -x 150 -y 120
    frame .t.f.f -width 20 -height 20 -bd 2 -relief raised
    frame .t.f.f -width 20 -height 20 -borderwidth 2 -relief raised
    place .t.f.f -x 10 -y 20
    wm overrideredirect .t 1
    wm geometry .t +40+50
    tkwait visibility .t
    list [winfo rootx .t.f.f] [winfo rooty .t.f.f]
} {202 192}
test unixWm-49.2 {Tk_GetRootCoords procedure, menubars} {unix testmenubar} {
    destroy .t
    toplevel .t -width 300 -height 200 -bd 2 -relief raised
    toplevel .t -width 300 -height 200 -borderwidth 2 -relief raised
    wm geom .t +0+0
    update
    set x [winfo rootx .t]
    set y [winfo rooty .t]
    frame .t.m -bd 2 -relief raised -width 100 -height 30
    frame .t.m.f -width 20 -height 10 -bd 2 -relief raised
    frame .t.m -borderwidth 2 -relief raised -width 100 -height 30
    frame .t.m.f -width 20 -height 10 -borderwidth 2 -relief raised
    place .t.m.f -x 50 -y 5
    frame .t.f -width 20 -height 30 -bd 2 -relief raised
    frame .t.f -width 20 -height 30 -borderwidth 2 -relief raised
    place .t.f -x 10 -y 30
    testmenubar window .t .t.m
    update
    list [expr [winfo rootx .t.m.f] - $x] [expr [winfo rooty .t.m.f] - $y] \
	    [expr [winfo rootx .t.f] - $x] [expr [winfo rooty .t.f] - $y]
} {52 7 12 62}

deleteWindows
wm withdraw .
if {[tk windowingsystem] == "aqua"} {
    # Modern mac windows have no border.
    set result_50_1 {{} {} .t .t .t2 {} .t2 .t .t}
} else {
    # Windows are assumed to have a border (invisible in Gnome 3).
    set result_50_1 {{} {} .t {} .t2 {} .t2 {} .t}
}
test unixWm-50.1 {Tk_CoordsToWindow procedure, finding a toplevel, x-coords, title bar} {unix failsOnUbuntu failsOnXQuarz} {
    update
    toplevel .t -width 300 -height 400 -bg green
    toplevel .t -width 300 -height 400 -background green
    wm geom .t +100+100
    tkwait visibility .t
    toplevel .t2 -width 100 -height 200 -bg red
    toplevel .t2 -width 100 -height 200 -background red
    wm geom .t2 +200+200
    tkwait visibility .t2
    raise .t2
    update
    set x [winfo rootx .t]
    set y [winfo rooty .t]
    list [winfo containing [expr $x - 30]  [expr $y + 250]] \
	 [winfo containing [expr $x - 1]   [expr $y + 250]] \
	 [winfo containing $x              [expr $y + 250]] \
	 [winfo containing [expr $x + 99]  [expr $y + 250]] \
	 [winfo containing [expr $x + 100] [expr $y + 250]] \
	 [winfo containing [expr $x + 150] [expr $y + 90]] \
	 [winfo containing [expr $x + 199] [expr $y + 250]] \
	 [winfo containing [expr $x + 200] [expr $y + 250]] \
	 [winfo containing [expr $x + 220] [expr $y + 250]] \
} $result_50_1
test unixWm-50.2 {Tk_CoordsToWindow procedure, finding a toplevel, y-coords and overrideredirect} unix {
    deleteWindows
    toplevel .t -width 400 -height 300 -bg yellow
    toplevel .t -width 400 -height 300 -background yellow
    wm geom .t +100+100
    tkwait visibility .t
    toplevel .t2 -width 200 -height 100 -bg blue
    toplevel .t2 -width 200 -height 100 -background blue
    wm overrideredirect .t2 1
    wm geom .t2 +200+200
    tkwait visibility .t2
    raise .t2
    set x [winfo rootx .t]
    set y [winfo rooty .t]
    set y2 [winfo rooty .t2]
1841
1842
1843
1844
1845
1846
1847
1848

1849
1850

1851
1852
1853
1854
1855
1856
1857
1858
1859

1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878

1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893


1894
1895
1896
1897


1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914

1915
1916
1917
1918
1919

1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931

1932
1933

1934
1935

1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948

1949
1950

1951
1952

1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966

1967
1968
1969

1970
1971
1972
1973
1974
1975
1976
1977
1978
1979

1980
1981

1982
1983
1984
1985
1986
1987
1988
1841
1842
1843
1844
1845
1846
1847

1848
1849

1850
1851
1852
1853
1854
1855
1856
1857
1858

1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877

1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891


1892
1893
1894
1895


1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913

1914
1915
1916
1917
1918

1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930

1931
1932

1933
1934

1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947

1948
1949

1950
1951

1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965

1966
1967
1968

1969
1970
1971
1972
1973
1974
1975
1976
1977
1978

1979
1980

1981
1982
1983
1984
1985
1986
1987
1988







-
+

-
+








-
+


















-
+













-
-
+
+


-
-
+
+
















-
+




-
+











-
+

-
+

-
+












-
+

-
+

-
+













-
+


-
+









-
+

-
+







} {{} {} .t .t .t2 .t2 .t {}}
test unixWm-50.3 {
	Tk_CoordsToWindow procedure, finding a toplevel with embedding
} tempNotWin {
    deleteWindows
    catch {interp delete child}

    toplevel .t -width 300 -height 400 -bg blue
    toplevel .t -width 300 -height 400 -background blue
    wm geom .t +100+100
    frame .t.f -container 1 -bg red
    frame .t.f -container 1 -background red
    place .t.f -x 150 -y 50
    tkwait visibility .t.f
    update
    interp create child
    load {} Tk child
    child alias frameid winfo id .t.f
    child eval {
	wm withdraw .
        toplevel .x -width 100 -height 80 -use [frameid] -bg yellow
        toplevel .x -width 100 -height 80 -use [frameid] -background yellow
        tkwait visibility .x
        update
        set x [winfo rootx .x]
        set y [winfo rooty .x]
    }
    set result [list [child eval {winfo containing [expr $x - 1]  [expr $y + 50]}] \
	       	     [child eval {winfo containing $x [expr $y + 50]}]]
    interp delete child
    set x [winfo rootx .t]
    set y [winfo rooty .t]
    lappend result [winfo containing [expr $x + 200] [expr $y + 49]] \
	[winfo containing [expr $x + 200] [expr $y +50]]
    set result
} {{} .x .t .t.f}
test unixWm-50.4 {Tk_CoordsToWindow procedure, window in other application} unix {
    destroy .t

    catch {interp delete child}
    toplevel .t -width 200 -height 200 -bg green
    toplevel .t -width 200 -height 200 -background green
    wm geometry .t +100+100
    tkwait visibility .t
    update
    interp create child
    load {} Tk child
    child eval {wm geometry . 200x200+100+100; tkwait visibility . ; update}
    set result [list [winfo containing 200 200] \
	    [child eval {winfo containing 200 200}]]
    interp delete child
    set result
} {{} .}
test unixWm-50.5 {Tk_CoordsToWindow procedure, handling menubars} {unix testmenubar} {
    deleteWindows
    toplevel .t -width 300 -height 400 -bd 2 -relief raised
    frame .t.f -width 150 -height 120 -bg green
    toplevel .t -width 300 -height 400 -borderwidth 2 -relief raised
    frame .t.f -width 150 -height 120 -background green
    place .t.f -x 10 -y 150
    wm geom .t +0+50
    frame .t.menu -width 100 -height 30 -bd 2 -relief raised
    frame .t.menu.f -width 40 -height 20 -bg purple
    frame .t.menu -width 100 -height 30 -borderwidth 2 -relief raised
    frame .t.menu.f -width 40 -height 20 -background purple
    place .t.menu.f -x 30 -y 10
    testmenubar window .t .t.menu
    tkwait visibility .t.menu
    update
    set x [winfo rootx .t]
    set y [winfo rooty .t]
    list [winfo containing $x             [expr $y - 31]] \
	 [winfo containing $x             [expr $y - 30]] \
	 [winfo containing [expr $x + 50] [expr $y - 19]] \
	 [winfo containing [expr $x + 50] [expr $y - 18]] \
	 [winfo containing [expr $x + 50] $y] \
	 [winfo containing [expr $x + 11] [expr $y + 152]] \
	 [winfo containing [expr $x + 12] [expr $y + 152]]
} {{} .t.menu .t.menu .t.menu.f .t .t .t.f}
test unixWm-50.6 {Tk_CoordsToWindow procedure, embedding within one app.} unix {
    deleteWindows
    toplevel .t -width 300 -height 400 -bg orange
    toplevel .t -width 300 -height 400 -background orange
    wm geom .t +0+50
    frame .t.f -container 1
    place .t.f -x 150 -y 50
    tkwait visibility .t.f
    toplevel .t2 -width 100 -height 80 -bg green -use [winfo id .t.f]
    toplevel .t2 -width 100 -height 80 -background green -use [winfo id .t.f]
    tkwait visibility .t2
    update
    set x [winfo rootx .t]
    set y [winfo rooty .t]
    list [winfo containing [expr $x +149] [expr $y + 80]] \
	    [winfo containing [expr $x +150] [expr $y +80]] \
	    [winfo containing [expr $x +249] [expr $y +80]] \
	    [winfo containing [expr $x +250] [expr $y +80]]
} {.t .t2 .t2 .t}
test unixWm-50.7 {Tk_CoordsToWindow procedure, more basics} unix {
    destroy .t
    toplevel .t -width 300 -height 400 -bg green
    toplevel .t -width 300 -height 400 -background green
    wm geom .t +0+0
    frame .t.f -width 100 -height 200 -bd 2 -relief raised
    frame .t.f -width 100 -height 200 -borderwidth 2 -relief raised
    place .t.f -x 100 -y 100
    frame .t.f.f -width 100 -height 200 -bd 2 -relief raised
    frame .t.f.f -width 100 -height 200 -borderwidth 2 -relief raised
    place .t.f.f -x 0 -y 100
    tkwait visibility .t.f.f
    set x [expr [winfo rootx .t] + 150]
    set y [winfo rooty .t]
    list [winfo containing $x [expr $y + 50]] \
	    [winfo containing $x [expr $y + 150]] \
	    [winfo containing $x [expr $y + 250]] \
	    [winfo containing $x [expr $y + 350]] \
	    [winfo containing $x [expr $y + 450]]
} {.t .t.f .t.f.f .t {}}
test unixWm-50.8 {Tk_CoordsToWindow procedure, more basics} unix {
    destroy .t
    toplevel .t -width 400 -height 300 -bg green
    toplevel .t -width 400 -height 300 -background green
    wm geom .t +0+30
    frame .t.f -width 200 -height 100 -bd 2 -relief raised
    frame .t.f -width 200 -height 100 -borderwidth 2 -relief raised
    place .t.f -x 100 -y 100
    frame .t.f.f -width 200 -height 100 -bd 2 -relief raised
    frame .t.f.f -width 200 -height 100 -borderwidth 2 -relief raised
    place .t.f.f -x 100 -y 0
    update
    set x [winfo rootx .t]
    set y [expr [winfo rooty .t] + 150]
    list [winfo containing [expr $x + 50] $y] \
	    [winfo containing [expr $x + 150] $y] \
	    [winfo containing [expr $x + 250] $y] \
	    [winfo containing [expr $x + 350] $y] \
	    [winfo containing [expr $x + 450] $y]
} {.t .t.f .t.f.f .t {}}
test unixWm-50.9 {Tk_CoordsToWindow procedure, unmapped windows} {unix failsOnUbuntu} {
    destroy .t
    destroy .t2
    toplevel .t -width 200 -height 200 -bg green
    toplevel .t -width 200 -height 200 -background green
    wm geometry .t +0+0
    tkwait visibility .t
    toplevel .t2 -width 200 -height 200 -bg red
    toplevel .t2 -width 200 -height 200 -background red
    wm geometry .t2 +0+0
    tkwait visibility .t2
    set result [list [winfo containing 100 100]]
    wm iconify .t2
    update idletasks
    lappend result [winfo containing 100 100]
} {.t2 .t}
test unixWm-50.10 {Tk_CoordsToWindow procedure, unmapped windows} unix {
    destroy .t
    toplevel .t -width 200 -height 200 -bg green
    toplevel .t -width 200 -height 200 -background green
    wm geometry .t +0+0
    frame .t.f -width 150 -height 150 -bd 2 -relief raised
    frame .t.f -width 150 -height 150 -borderwidth 2 -relief raised
    place .t.f -x 25 -y 25
    tkwait visibility .t.f
    update idletasks
    set result [list [winfo containing 100 100]]
    place forget .t.f
    update idletasks
    lappend result [winfo containing 100 100]
2040
2041
2042
2043
2044
2045
2046
2047

2048
2049
2050
2051

2052
2053
2054
2055
2056
2057
2058
2059

2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070

2071
2072
2073
2074
2075

2076
2077
2078
2079
2080
2081
2082
2040
2041
2042
2043
2044
2045
2046

2047
2048
2049
2050

2051
2052
2053
2054
2055
2056
2057
2058

2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069

2070
2071
2072
2073
2074

2075
2076
2077
2078
2079
2080
2081
2082







-
+



-
+







-
+










-
+




-
+







    destroy .raise1
    list $result [winfo containing [winfo rootx .raise2] \
	    [winfo rooty .raise2]]
} {.raise1 .raise3}
deleteWindows
test unixWm-51.6 {TkWmRestackToplevel procedure, window to be stacked isn't mapped} unix {
    destroy .t
    toplevel .t -width 200 -height 200 -bg green
    toplevel .t -width 200 -height 200 -background green
    wm geometry .t +0+0
    tkwait visibility .t
    destroy .t2
    toplevel .t2 -width 200 -height 200 -bg red
    toplevel .t2 -width 200 -height 200 -background red
    wm geometry .t2 +0+0
    winfo containing 100 100
} {.t}
test unixWm-51.7 {TkWmRestackToplevel procedure, other window isn't mapped} {unix failsOnXQuarz} {
    foreach w {.t .t2 .t3} {
	destroy $w
	update
	toplevel $w -width 200 -height 200 -bg green
	toplevel $w -width 200 -height 200 -background green
	wm geometry $w +0+0
    }
    raise .t .t2
    update
    set result [list [winfo containing 100 100]]
    lower .t3
    lappend result [winfo containing 100 100]
} {.t3 .t}
test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix {
    destroy .t
    toplevel .t -width 200 -height 200 -bg green
    toplevel .t -width 200 -height 200 -background green
    wm overrideredirect .t 1
    wm geometry .t +0+0
    tkwait visibility .t
    destroy .t2
    toplevel .t2 -width 200 -height 200 -bg red
    toplevel .t2 -width 200 -height 200 -background red
    wm overrideredirect .t2 1
    wm geometry .t2 +0+0
    tkwait visibility .t2

    # Need to use vrootx and vrooty to make tests work correctly with
    # virtual root window measures managers: overrideredirect windows
    # come up at (0,0) in display coordinates, not virtual root
2094
2095
2096
2097
2098
2099
2100
2101

2102
2103
2104
2105
2106
2107
2108
2094
2095
2096
2097
2098
2099
2100

2101
2102
2103
2104
2105
2106
2107
2108







-
+







if {[tk windowingsystem] == "aqua"} {
    wm withdraw .
}
test unixWm-51.9 {TkWmRestackToplevel procedure, other window overrideredirect} unix {
    foreach w {.t .t2 .t3} {
	destroy $w
	update
	toplevel $w -width 200 -height 200 -bg green
	toplevel $w -width 200 -height 200 -background green
	wm overrideredirect $w 1
	wm geometry $w +0+0
	tkwait visibility $w
	update
    }
    lower .t3 .t2
    update
2141
2142
2143
2144
2145
2146
2147
2148

2149
2150
2151
2152
2153
2154
2155

2156
2157

2158
2159
2160
2161
2162
2163
2164
2165
2166

2167
2168

2169
2170
2171
2172
2173
2174
2175
2176
2177

2178
2179
2180
2181

2182
2183
2184
2185
2186
2187
2188
2189
2190
2191

2192
2193

2194
2195
2196
2197
2198
2199
2200
2201
2202
2203

2204
2205

2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216

2217
2218
2219
2220
2221
2222
2223
2141
2142
2143
2144
2145
2146
2147

2148
2149
2150
2151
2152
2153
2154

2155
2156

2157
2158
2159
2160
2161
2162
2163
2164
2165

2166
2167

2168
2169
2170
2171
2172
2173
2174
2175
2176

2177
2178
2179
2180

2181
2182
2183
2184
2185
2186
2187
2188
2189
2190

2191
2192

2193
2194
2195
2196
2197
2198
2199
2200
2201
2202

2203
2204

2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215

2216
2217
2218
2219
2220
2221
2222
2223







-
+






-
+

-
+








-
+

-
+








-
+



-
+









-
+

-
+









-
+

-
+










-
+







    makeToplevels
    set time [lindex [time {lower .raise1 .raise2}] 0]
    expr {$time < 2000000}
} 1

test unixWm-52.1 {TkWmAddToColormapWindows procedure} unix {
    destroy .t
    toplevel .t -width 200 -height 200 -colormap new -relief raised -bd 2
    toplevel .t -width 200 -height 200 -colormap new -relief raised -borderwidth 2
    wm geom .t +0+0
    update
    wm colormap .t
} {}
test unixWm-52.2 {TkWmAddToColormapWindows procedure} unix {
    destroy .t
    toplevel .t -colormap new -relief raised -bd 2
    toplevel .t -colormap new -relief raised -borderwidth 2
    wm geom .t +0+0
    frame .t.f -width 100 -height 100 -colormap new -relief sunken -bd 2
    frame .t.f -width 100 -height 100 -colormap new -relief sunken -borderwidth 2
    pack .t.f
    update
    wm colormap .t
} {.t.f .t}
test unixWm-52.3 {TkWmAddToColormapWindows procedure} unix {
    destroy .t
    toplevel .t -colormap new
    wm geom .t +0+0
    frame .t.f -width 100 -height 100 -colormap new -relief sunken -bd 2
    frame .t.f -width 100 -height 100 -colormap new -relief sunken -borderwidth 2
    pack .t.f
    frame .t.f2 -width 100 -height 100 -colormap new -relief sunken -bd 2
    frame .t.f2 -width 100 -height 100 -colormap new -relief sunken -borderwidth 2
    pack .t.f2
    update
    wm colormap .t
} {.t.f .t.f2 .t}
test unixWm-52.4 {TkWmAddToColormapWindows procedure} unix {
    destroy .t
    toplevel .t -colormap new
    wm geom .t +0+0
    frame .t.f -width 100 -height 100 -colormap new -relief sunken -bd 2
    frame .t.f -width 100 -height 100 -colormap new -relief sunken -borderwidth 2
    pack .t.f
    update
    wm colormapwindows .t .t.f
    frame .t.f2 -width 100 -height 100 -colormap new -relief sunken -bd 2
    frame .t.f2 -width 100 -height 100 -colormap new -relief sunken -borderwidth 2
    pack .t.f2
    update
    wm colormapwindows .t
} {.t.f}

test unixWm-53.1 {TkWmRemoveFromColormapWindows procedure} unix {
    destroy .t
    toplevel .t -colormap new
    wm geom .t +0+0
    frame .t.f -width 100 -height 100 -colormap new -relief sunken -bd 2
    frame .t.f -width 100 -height 100 -colormap new -relief sunken -borderwidth 2
    pack .t.f
    frame .t.f2 -width 100 -height 100 -colormap new -relief sunken -bd 2
    frame .t.f2 -width 100 -height 100 -colormap new -relief sunken -borderwidth 2
    pack .t.f2
    update
    destroy .t.f2
    wm colormap .t
} {.t.f .t}
test unixWm-53.2 {TkWmRemoveFromColormapWindows procedure} unix {
    destroy .t
    toplevel .t -colormap new
    wm geom .t +0+0
    frame .t.f -width 100 -height 100 -colormap new -relief sunken -bd 2
    frame .t.f -width 100 -height 100 -colormap new -relief sunken -borderwidth 2
    pack .t.f
    frame .t.f2 -width 100 -height 100 -colormap new -relief sunken -bd 2
    frame .t.f2 -width 100 -height 100 -colormap new -relief sunken -borderwidth 2
    pack .t.f2
    update
    wm colormapwindows .t .t.f2
    destroy .t.f2
    wm colormap .t
} {}

test unixWm-54.1 {TkpMakeMenuWindow procedure, setting save_under} {unix nonUnixUserInteraction} {
    destroy .t
    destroy .m
    toplevel .t -width 300 -height 200 -bd 2 -relief raised
    toplevel .t -width 300 -height 200 -borderwidth 2 -relief raised
    bind .t <Expose> {set x exposed}
    wm geom .t +0+0
    update
    menu .m
    .m add command -label First
    .m add command -label Second
    .m add command -label Third
2240
2241
2242
2243
2244
2245
2246
2247

2248
2249
2250

2251
2252
2253
2254
2255
2256
2257
2258
2259
2260

2261
2262
2263
2264
2265

2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278

2279
2280
2281
2282
2283

2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296


2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308


2309
2310
2311
2312

2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326


2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341



2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358

2359
2360
2361
2362

2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373

2374
2375
2376
2377
2378

2379
2380
2381
2382
2383
2384
2385
2386
2387
2388

2389
2390
2391
2392
2393

2394
2395
2396
2397
2398
2399
2400
2240
2241
2242
2243
2244
2245
2246

2247
2248
2249

2250
2251
2252
2253
2254
2255
2256
2257
2258
2259

2260
2261
2262
2263
2264

2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277

2278
2279
2280
2281
2282

2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294


2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306


2307
2308
2309
2310
2311

2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324


2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338



2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357

2358
2359
2360
2361

2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372

2373
2374
2375
2376
2377

2378
2379
2380
2381
2382
2383
2384
2385
2386
2387

2388
2389
2390
2391
2392

2393
2394
2395
2396
2397
2398
2399
2400







-
+


-
+









-
+




-
+












-
+




-
+











-
-
+
+










-
-
+
+



-
+












-
-
+
+












-
-
-
+
+
+
















-
+



-
+










-
+




-
+









-
+




-
+







    set result
} 1

# No tests for TkGetPointerCoords, CreateWrapper, or GetMaxSize.

test unixWm-55.1 {TkUnixSetMenubar procedure} {unix testmenubar} {
    destroy .t
    toplevel .t -width 300 -height 200 -bd 2 -relief raised
    toplevel .t -width 300 -height 200 -borderwidth 2 -relief raised
    wm geom .t +0+0
    update
    frame .t.f -width 400 -height 30 -bd 2 -relief raised -bg green
    frame .t.f -width 400 -height 30 -borderwidth 2 -relief raised -background green
    testmenubar window .t .t.f
    update
    list [winfo ismapped .t.f] [winfo geometry .t.f] \
	    [expr [winfo rootx .t] - [winfo rootx .t.f]] \
	    [expr [winfo rooty .t] - [winfo rooty .t.f]]
} {1 300x30+0+0 0 30}
test unixWm-55.2 {TkUnixSetMenubar procedure, removing menubar} {unix testmenubar} {
    destroy .t
    destroy .f
    toplevel .t -width 300 -height 200 -bd 2 -relief raised
    toplevel .t -width 300 -height 200 -borderwidth 2 -relief raised
    wm geom .t +0+0
    update
    set x [winfo rootx .t]
    set y [winfo rooty .t]
    frame .f -width 400 -height 30 -bd 2 -relief raised -bg green
    frame .f -width 400 -height 30 -borderwidth 2 -relief raised -background green
    testmenubar window .t .f
    update
    testmenubar window .t {}
    update
    list [winfo ismapped .f] [winfo geometry .f] \
	    [expr [winfo rootx .t] - $x] \
	    [expr [winfo rooty .t] - $y] \
	    [expr [winfo rootx .] - [winfo rootx .f]] \
	    [expr [winfo rooty .] - [winfo rooty .f]]
} {0 300x30+0+0 0 0 0 0}
test unixWm-55.3 {TkUnixSetMenubar procedure, removing geometry manager} {unix testmenubar} {
    destroy .t
    toplevel .t -width 300 -height 200 -bd 2 -relief raised
    toplevel .t -width 300 -height 200 -borderwidth 2 -relief raised
    wm geom .t +0+0
    update
    set x [winfo rootx .t]
    set y [winfo rooty .t]
    frame .t.f -width 400 -height 30 -bd 2 -relief raised -bg green
    frame .t.f -width 400 -height 30 -borderwidth 2 -relief raised -background green
    testmenubar window .t .t.f
    update
    testmenubar window .t {}
    update
    set result "[expr [winfo rootx .t] - $x] [expr [winfo rooty .t] - $y]"
    .t.f configure -height 100
    update
    lappend result [expr [winfo rootx .t] - $x] [expr [winfo rooty .t] - $y]
} {0 0 0 0}
test unixWm-55.4 {TkUnixSetMenubar procedure, toplevel not yet created} {unix testmenubar} {
    destroy .t
    toplevel .t -width 300 -height 200 -bd 2 -relief raised
    frame .t.f -width 400 -height 30 -bd 2 -relief raised -bg green
    toplevel .t -width 300 -height 200 -borderwidth 2 -relief raised
    frame .t.f -width 400 -height 30 -borderwidth 2 -relief raised -background green
    testmenubar window .t .t.f
    wm geom .t +0+0
    update
    list [winfo ismapped .t.f] [winfo geometry .t.f] \
	    [expr [winfo rootx .t] - [winfo rootx .t.f]] \
	    [expr [winfo rooty .t] - [winfo rooty .t.f]]
} {1 300x30+0+0 0 30}
test unixWm-55.5 {TkUnixSetMenubar procedure, changing menubar} {unix testmenubar} {
    destroy .t
    destroy .f
    toplevel .t -width 300 -height 200 -bd 2 -relief raised
    frame .t.f -width 400 -height 30 -bd 2 -relief raised -bg green
    toplevel .t -width 300 -height 200 -borderwidth 2 -relief raised
    frame .t.f -width 400 -height 30 -borderwidth 2 -relief raised -background green
    wm geom .t +0+0
    update
    set y [winfo rooty .t]
    frame .f -width 400 -height 50 -bd 2 -relief raised -bg green
    frame .f -width 400 -height 50 -borderwidth 2 -relief raised -background green
    testmenubar window .t .t.f
    update
    set result {}
    lappend result [winfo ismapped .f] [winfo ismapped .t.f]
    lappend result [expr [winfo rooty .t.f] - $y]
    testmenubar window .t .f
    update
    lappend result [winfo ismapped .f] [winfo ismapped .t.f]
    lappend result [expr [winfo rooty .f] - $y]
} {0 1 0 1 0 0}
test unixWm-55.6 {TkUnixSetMenubar procedure, changing menubar to self} {unix testmenubar} {
    destroy .t
    toplevel .t -width 300 -height 200 -bd 2 -relief raised
    frame .t.f -width 400 -height 30 -bd 2 -relief raised -bg green
    toplevel .t -width 300 -height 200 -borderwidth 2 -relief raised
    frame .t.f -width 400 -height 30 -borderwidth 2 -relief raised -background green
    testmenubar window .t .t.f
    wm geom .t +0+0
    update
    testmenubar window .t .t.f
    update
    list [winfo ismapped .t.f] [winfo geometry .t.f] \
	    [expr [winfo rootx .t] - [winfo rootx .t.f]] \
	    [expr [winfo rooty .t] - [winfo rooty .t.f]]
} {1 300x30+0+0 0 30}
test unixWm-55.7 {TkUnixSetMenubar procedure, unsetting event handler} {unix testmenubar} {
    destroy .t
    destroy .f
    toplevel .t -width 300 -height 200 -bd 2 -relief raised
    frame .t.f -width 400 -height 30 -bd 2 -relief raised -bg green
    frame .f -width 400 -height 40 -bd 2 -relief raised -bg blue
    toplevel .t -width 300 -height 200 -borderwidth 2 -relief raised
    frame .t.f -width 400 -height 30 -borderwidth 2 -relief raised -background green
    frame .f -width 400 -height 40 -borderwidth 2 -relief raised -background blue
    wm geom .t +0+0
    update
    set y [winfo rooty .t]
    testmenubar window .t .t.f
    update
    set result [expr [winfo rooty .t] - $y]
    testmenubar window .t .f
    update
    lappend result [expr [winfo rooty .t] - $y]
    destroy .t.f
    update
    lappend result [expr [winfo rooty .t] - $y]
} {30 40 40}

test unixWm-56.1 {MenubarDestroyProc procedure} {unix testmenubar} {
    destroy .t
    toplevel .t -width 300 -height 200 -bd 2 -relief raised
    toplevel .t -width 300 -height 200 -borderwidth 2 -relief raised
    wm geom .t +0+0
    update
    set y [winfo rooty .t]
    frame .t.f -width 400 -height 30 -bd 2 -relief raised -bg green
    frame .t.f -width 400 -height 30 -borderwidth 2 -relief raised -background green
    testmenubar window .t .t.f
    update
    set result [expr [winfo rooty .t] - $y]
    destroy .t.f
    update
    lappend result [expr [winfo rooty .t] - $y]
} {30 0}

test unixWm-57.1 {MenubarReqProc procedure} {unix testmenubar} {
    destroy .t
    toplevel .t -width 300 -height 200 -bd 2 -relief raised
    toplevel .t -width 300 -height 200 -borderwidth 2 -relief raised
    wm geom .t +0+0
    update
    set x [winfo rootx .t]
    set y [winfo rooty .t]
    frame .t.f -width 400 -height 10 -bd 2 -relief raised -bg green
    frame .t.f -width 400 -height 10 -borderwidth 2 -relief raised -background green
    testmenubar window .t .t.f
    update
    set result "[expr [winfo rootx .t] - $x] [expr [winfo rooty .t] - $y]"
    .t.f configure -height 100
    update
    lappend result [expr [winfo rootx .t] - $x] [expr [winfo rooty .t] - $y]
} {0 10 0 100}
test unixWm-57.2 {MenubarReqProc procedure} {unix testmenubar} {
    destroy .t
    toplevel .t -width 300 -height 200 -bd 2 -relief raised
    toplevel .t -width 300 -height 200 -borderwidth 2 -relief raised
    wm geom .t +0+0
    update
    set x [winfo rootx .t]
    set y [winfo rooty .t]
    frame .t.f -width 400 -height 20 -bd 2 -relief raised -bg green
    frame .t.f -width 400 -height 20 -borderwidth 2 -relief raised -background green
    testmenubar window .t .t.f
    update
    set result "[expr [winfo rootx .t] - $x] [expr [winfo rooty .t] - $y]"
    .t.f configure -height 0
    update
    lappend result [expr [winfo rootx .t] - $x] [expr [winfo rooty .t] - $y]
} {0 20 0 1}
Changes to tests/util.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14

15
16
17
18
19
20
21
1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
21













-
+







# This file is a Tcl script to test out the procedures in the file
# tkUtil.c.  It is organized in the standard fashion for Tcl tests.
#
# Copyright © 1994 The Regents of the University of California.
# Copyright © 1994 Sun Microsystems, Inc.
# Copyright © 1998-1999 by Scriptics Corporation.
# All rights reserved.

package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
namespace import -force tcltest::test

listbox .l -width 20 -height 5 -relief sunken -bd 2
listbox .l -width 20 -height 5 -relief sunken -borderwidth 2
pack .l
.l insert 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
update
test util-1.1 {Tk_GetScrollInfo procedure} -body {
    .l yview moveto a b
} -returnCodes error -result {wrong # args: should be ".l yview moveto fraction"}
test util-1.2 {Tk_GetScrollInfo procedure} -body {
Changes to tests/visual.test.
21
22
23
24
25
26
27
28

29
30
31
32
33
34
35
21
22
23
24
25
26
27

28
29
30
31
32
33
34
35







-
+







# Arguments:
# w -        Name of toplevel window to create.

proc eatColors {w} {
    catch {destroy $w}
    toplevel $w
    wm geom $w +0+0
    canvas $w.c -width 400 -height 200 -bd 0
    canvas $w.c -width 400 -height 200 -borderwidth 0
    pack $w.c
    for {set y 0} {$y < 8} {incr y} {
        for {set x 0} {$x < 40} {incr x} {
            set color [format #%02x%02x%02x [expr {$x*6}] [expr {$y*30}] 0]
            $w.c create rectangle [expr {10*$x}] [expr {20*$y}] \
                [expr {10*$x + 10}] [expr {20*$y + 20}] -outline {} \
                -fill $color
Changes to tests/winButton.test.
26
27
28
29
30
31
32
33
34
35



36
37

38
39
40
41
42
43
44
26
27
28
29
30
31
32



33
34
35
36

37
38
39
40
41
42
43
44







-
-
-
+
+
+

-
+







} -setup {
    # nonPortable because of [3e3e25f483]: on Win7 first started with a high DPI screen
    # the smallest size (i.e. 8) is not available for "MS Sans Serif" font
    deleteWindows
} -body {
    image create test image1
    image1 changed 0 0 0 0 60 40
    label .b1 -image image1 -bd 4 -padx 0 -pady 2
    button .b2 -image image1 -bd 4 -padx 0 -pady 2
    checkbutton .b3 -image image1 -bd 4 -padx 1 -pady 1 \
    label .b1 -image image1 -borderwidth 4 -padx 0 -pady 2
    button .b2 -image image1 -borderwidth 4 -padx 0 -pady 2
    checkbutton .b3 -image image1 -borderwidth 4 -padx 1 -pady 1 \
        -font {{MS Sans Serif} 8}
    radiobutton .b4 -image image1 -bd 4 -padx 2 -pady 0 \
    radiobutton .b4 -image image1 -borderwidth 4 -padx 2 -pady 0 \
        -font {{MS Sans Serif} 8}
    pack .b1 .b2 .b3 .b4
    update
    # with patch 463234 with native L&F enabled, this returns:
    # {68 48 70 50 88 50 88 50}
    list [winfo reqwidth .b1] [winfo reqheight .b1] \
        [winfo reqwidth .b2] [winfo reqheight .b2] \
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
94
95
96
97
98
99
100
101
102
103
104
105




106
107
108
109
110
111
112
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
94
95
96
97
98
99
100
101




102
103
104
105
106
107
108
109
110
111
112







-
-
-
+
+
+

-
+
















-
-
-
+
+
+

-
+

















-
-
-
-
+
+
+
+







test winbutton-1.2 {TkpComputeButtonGeometry procedure} -constraints {
    win nonPortable
} -setup {
    # nonPortable because of [3e3e25f483]: on Win7 first started with a high DPI screen
    # the smallest size (i.e. 8) is not available for "MS Sans Serif" font
    deleteWindows
} -body {
    label .b1 -bitmap question -bd 3 -padx 0 -pady 2
    button .b2 -bitmap question -bd 3 -padx 0 -pady 2
    checkbutton .b3 -bitmap question -bd 3 -padx 1 -pady 1 \
    label .b1 -bitmap question -borderwidth 3 -padx 0 -pady 2
    button .b2 -bitmap question -borderwidth 3 -padx 0 -pady 2
    checkbutton .b3 -bitmap question -borderwidth 3 -padx 1 -pady 1 \
        -font {{MS Sans Serif} 8}
    radiobutton .b4 -bitmap question -bd 3 -padx 2 -pady 0 \
    radiobutton .b4 -bitmap question -borderwidth 3 -padx 2 -pady 0 \
        -font {{MS Sans Serif} 8}
    pack .b1 .b2 .b3 .b4
    update
    # with patch 463234 with native L&F enabled, this returns:
    # {23 33 25 35 43 35 43 35}
    list [winfo reqwidth .b1] [winfo reqheight .b1] \
        [winfo reqwidth .b2] [winfo reqheight .b2] \
        [winfo reqwidth .b3] [winfo reqheight .b3] \
        [winfo reqwidth .b4] [winfo reqheight .b4]
} -cleanup {
    deleteWindows
} -result {23 33 25 35 45 37 45 37}

test winbutton-1.3 {TkpComputeButtonGeometry procedure} -constraints win -setup {
    deleteWindows
} -body {
    label .b1 -bitmap question -bd 3 -highlightthickness 4
    button .b2 -bitmap question -bd 3 -highlightthickness 0
    checkbutton .b3 -bitmap question -bd 3 -highlightthickness 1 \
    label .b1 -bitmap question -borderwidth 3 -highlightthickness 4
    button .b2 -bitmap question -borderwidth 3 -highlightthickness 0
    checkbutton .b3 -bitmap question -borderwidth 3 -highlightthickness 1 \
        -indicatoron 0
    radiobutton .b4 -bitmap question -bd 3 -indicatoron false
    radiobutton .b4 -bitmap question -borderwidth 3 -indicatoron false
    pack .b1 .b2 .b3 .b4
    update
    # with patch 463234 with native L&F enabled, this returns:
    # {31 41 23 33 25 35 25 35}
    list [winfo reqwidth .b1] [winfo reqheight .b1] \
        [winfo reqwidth .b2] [winfo reqheight .b2] \
        [winfo reqwidth .b3] [winfo reqheight .b3] \
        [winfo reqwidth .b4] [winfo reqheight .b4]
} -cleanup {
    deleteWindows
} -result {31 41 23 33 27 37 27 37}

test winbutton-1.4 {TkpComputeButtonGeometry procedure} -constraints {
    win nonPortable
} -setup {
    deleteWindows
} -body {
    label .b1 -text Xagqpim -bd 2 -padx 0 -pady 2 -font {{MS Sans Serif} 8}
    button .b2 -text Xagqpim -bd 2 -padx 0 -pady 2 -font {{MS Sans Serif} 8}
    checkbutton .b3 -text Xagqpim -bd 2 -padx 1 -pady 1 -font {{MS Sans Serif} 8}
    radiobutton .b4 -text Xagqpim -bd 2 -padx 2 -pady 0 -font {{MS Sans Serif} 8}
    label .b1 -text Xagqpim -borderwidth 2 -padx 0 -pady 2 -font {{MS Sans Serif} 8}
    button .b2 -text Xagqpim -borderwidth 2 -padx 0 -pady 2 -font {{MS Sans Serif} 8}
    checkbutton .b3 -text Xagqpim -borderwidth 2 -padx 1 -pady 1 -font {{MS Sans Serif} 8}
    radiobutton .b4 -text Xagqpim -borderwidth 2 -padx 2 -pady 0 -font {{MS Sans Serif} 8}
    pack .b1 .b2 .b3 .b4
    update
    list [winfo reqwidth .b1] [winfo reqheight .b1] \
        [winfo reqwidth .b2] [winfo reqheight .b2] \
        [winfo reqwidth .b3] [winfo reqheight .b3] \
        [winfo reqwidth .b4] [winfo reqheight .b4]
} -cleanup {
142
143
144
145
146
147
148
149
150
151
152




153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168

169
170

171
172

173
174

175
176
177
178
179
180
181
142
143
144
145
146
147
148




149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167

168
169

170
171

172
173

174
175
176
177
178
179
180
181







-
-
-
-
+
+
+
+















-
+

-
+

-
+

-
+







} -result {222 52}

test winbutton-1.7 {TkpComputeButtonGeometry procedure} -constraints {
    win nonPortable
} -setup {
    deleteWindows
} -body {
    label .b1 -text Xagqpim -bd 2 -padx 0 -pady 2 -width 10
    button .b2 -text Xagqpim -bd 2 -padx 0 -pady 2 -height 5
    checkbutton .b3 -text Xagqpim -bd 2 -padx 1 -pady 1 -width 20 -height 2
    radiobutton .b4 -text Xagqpim -bd 2 -padx 2 -pady 0 -width 4
    label .b1 -text Xagqpim -borderwidth 2 -padx 0 -pady 2 -width 10
    button .b2 -text Xagqpim -borderwidth 2 -padx 0 -pady 2 -height 5
    checkbutton .b3 -text Xagqpim -borderwidth 2 -padx 1 -pady 1 -width 20 -height 2
    radiobutton .b4 -text Xagqpim -borderwidth 2 -padx 2 -pady 0 -width 4
    pack .b1 .b2 .b3 .b4
    update
    list [winfo reqwidth .b1] [winfo reqheight .b1] \
        [winfo reqwidth .b2] [winfo reqheight .b2] \
        [winfo reqwidth .b3] [winfo reqheight .b3] \
        [winfo reqwidth .b4] [winfo reqheight .b4]
} -cleanup {
    deleteWindows
} -result {74 24 67 97 174 46 64 28}

test winbutton-1.8 {TkpComputeButtonGeometry procedure} -constraints {
    win nonPortable
} -setup {
    deleteWindows
} -body {
    label .b1 -text Xagqpim -bd 2 -padx 0 -pady 2 \
    label .b1 -text Xagqpim -borderwidth 2 -padx 0 -pady 2 \
    -highlightthickness 4
    button .b2 -text Xagqpim -bd 2 -padx 0 -pady 2 \
    button .b2 -text Xagqpim -borderwidth 2 -padx 0 -pady 2 \
    -highlightthickness 0
    checkbutton .b3 -text Xagqpim -bd 2 -padx 1 -pady 1  \
    checkbutton .b3 -text Xagqpim -borderwidth 2 -padx 1 -pady 1  \
    -highlightthickness 1 -indicatoron no
    radiobutton .b4 -text Xagqpim -bd 2 -padx 2 -pady 0 -indicatoron 0
    radiobutton .b4 -text Xagqpim -borderwidth 2 -padx 2 -pady 0 -indicatoron 0
    pack .b1 .b2 .b3 .b4
    update
    list [winfo reqwidth .b1] [winfo reqheight .b1] \
        [winfo reqwidth .b2] [winfo reqheight .b2] \
        [winfo reqwidth .b3] [winfo reqheight .b3] \
        [winfo reqwidth .b4] [winfo reqheight .b4]
} -cleanup {
Changes to tests/winFont.test.
109
110
111
112
113
114
115
116

117
118
119
120
121
122
123
109
110
111
112
113
114
115

116
117
118
119
120
121
122
123







-
+







    set x {}
} -result {}

destroy .t
toplevel .t
wm geometry .t +0+0
update idletasks
label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left -text "0" -font systemfixed
label .t.l -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0 -justify left -text "0" -font systemfixed
pack .t.l
canvas .t.c -closeenough 0

set courier {Courier 14}
set cx [font measure $courier 0]
set t [.t.c create text 0 0 -anchor nw -just left -font $courier]
pack .t.c
131
132
133
134
135
136
137
138

139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157

158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176

177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195

196
197
198
199
200
201
202
131
132
133
134
135
136
137

138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156

157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175

176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194

195
196
197
198
199
200
201
202







-
+


















-
+


















-
+


















-
+







}

test winfont-5.1 {Tk_MeasureChars procedure: unbounded right margin} -constraints {
    win
} -setup {
    destroy .t.l
} -body {
    label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
    label .t.l -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0 -justify left \
        -text "0" -font systemfixed
    pack .t.l
    update
    set ax [winfo reqwidth .t.l]
    set ay [winfo reqheight .t.l]

    .t.l config -wrap 0 -text "000000"
    list [expr {[winfo reqwidth .t.l] eq 6*$ax}] \
        [expr {[winfo reqheight .t.l] eq $ay}]
} -cleanup {
    destroy .t.l
} -result {1 1}

test winfont-5.2 {Tk_MeasureChars procedure: static width buffer exceeded} -constraints {
    win
} -setup {
    destroy .t.l
}  -body {
    label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
    label .t.l -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0 -justify left \
        -text "0" -font systemfixed
    pack .t.l
    update
    set ax [winfo reqwidth .t.l]
    set ay [winfo reqheight .t.l]

    .t.l config -wrap 100000 -text "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
    list [expr {[winfo reqwidth .t.l] eq 256*$ax}] \
        [expr {[winfo reqheight .t.l] eq $ay}]
} -cleanup {
    destroy .t.l
} -result {1 1}

test winfont-5.3 {Tk_MeasureChars procedure: all chars did fit} -constraints {
    win
} -setup {
    destroy .t.l
}  -body {
    label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
    label .t.l -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0 -justify left \
        -text "0" -font systemfixed
    pack .t.l
    update
    set ax [winfo reqwidth .t.l]
    set ay [winfo reqheight .t.l]

    .t.l config -wrap [expr {$ax*10}] -text "00000000"
    list [expr {[winfo reqwidth .t.l] eq 8*$ax}] \
        [expr {[winfo reqheight .t.l] eq $ay}]
} -cleanup {
    destroy .t.l
} -result {1 1}

test winfont-5.4 {Tk_MeasureChars procedure: not all chars fit} -constraints {
    win
} -setup {
    destroy .t.l
}  -body {
    label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
    label .t.l -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0 -justify left \
        -text "0" -font systemfixed
    pack .t.l
    update
    set ax [winfo reqwidth .t.l]
    set ay [winfo reqheight .t.l]

    .t.l config -wrap [expr {$ax*6}] -text "00000000"
224
225
226
227
228
229
230
231

232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250

251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269

270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288

289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307

308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326

327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346

347
348
349
350
351
352
353
224
225
226
227
228
229
230

231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249

250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268

269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287

288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306

307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325

326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345

346
347
348
349
350
351
352
353







-
+


















-
+


















-
+


















-
+


















-
+


















-
+



















-
+







} -result 2

test winfont-5.6 {Tk_MeasureChars procedure: at least one char on line} -constraints {
    win
} -setup {
    destroy .t.l
}  -body {
    label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
    label .t.l -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0 -justify left \
        -text "0" -font systemfixed
    pack .t.l
    update
    set ax [winfo reqwidth .t.l]
    set ay [winfo reqheight .t.l]

    .t.l config -text "000000" -wrap 1
    list [expr {[winfo reqwidth .t.l] eq $ax}] \
        [expr {[winfo reqheight .t.l] eq 6*$ay}]
} -cleanup {
    destroy .t.l
} -result {1 1}

test winfont-5.7 {Tk_MeasureChars procedure: whole words} -constraints {
    win
} -setup {
    destroy .t.l
}  -body {
    label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
    label .t.l -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0 -justify left \
        -text "0" -font systemfixed
    pack .t.l
    update
    set ax [winfo reqwidth .t.l]
    set ay [winfo reqheight .t.l]

    .t.l config -wrap [expr {$ax*8}] -text "000000 0000"
    list [expr {[winfo reqwidth .t.l] eq 6*$ax}] \
        [expr {[winfo reqheight .t.l] eq 2*$ay}]
} -cleanup {
    destroy .t.l
} -result {1 1}

test winfont-5.8 {Tk_MeasureChars procedure: already saw space in line} -constraints {
    win
} -setup {
    destroy .t.l
}  -body {
    label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
    label .t.l -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0 -justify left \
        -text "0" -font systemfixed
    pack .t.l
    update
    set ax [winfo reqwidth .t.l]
    set ay [winfo reqheight .t.l]

    .t.l config -wrap [expr {$ax*12}] -text "000000    0000000"
    list [expr {[winfo reqwidth .t.l] eq 7*$ax}] \
        [expr {[winfo reqheight .t.l] eq 2*$ay}]
} -cleanup {
    destroy .t.l
} -result {1 1}

test winfont-5.9 {Tk_MeasureChars procedure: internal spaces significant} -constraints {
    win
} -setup {
    destroy .t.l
}  -body {
    label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
    label .t.l -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0 -justify left \
        -text "0" -font systemfixed
    pack .t.l
    update
    set ax [winfo reqwidth .t.l]
    set ay [winfo reqheight .t.l]

    .t.l config -wrap [expr {$ax*12}] -text "000  00   00000"
    list [expr {[winfo reqwidth .t.l] eq 7*$ax}] \
        [expr {[winfo reqheight .t.l] eq 2*$ay}]
} -cleanup {
    destroy .t.l
} -result {1 1}

test winfont-5.10 {Tk_MeasureChars procedure: make first part of word fit} -constraints {
    win
} -setup {
    destroy .t.l
}  -body {
    label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
    label .t.l -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0 -justify left \
        -text "0" -font systemfixed
    pack .t.l
    update
    set ax [winfo reqwidth .t.l]
    set ay [winfo reqheight .t.l]

    .t.l config -wrap [expr {$ax*12}] -text "0000000000000000"
    list [expr {[winfo reqwidth .t.l] eq 12*$ax}] \
        [expr {[winfo reqheight .t.l] eq 2*$ay}]
} -cleanup {
    destroy .t.l
} -result {1 1}

test winfont-5.11 {Tk_MeasureChars procedure: check for kerning} -constraints {
    win nonPortable
} -setup {
    destroy .t.l
}  -body {
    label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
    label .t.l -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0 -justify left \
        -text "0" -font systemfixed
    pack .t.l
    update

    set font [.t.l cget -font]
    .t.l config -font {{MS Sans Serif} 8} -text "W"
    set width [winfo reqwidth .t.l]
    .t.l config -text "XaYoYaKaWx"
    set x [lindex [getsize] 0]
    .t.l config -font $font
    expr {$x < ($width*10)}
} -cleanup {
    destroy .t.l
} -result 1


test winfont-6.1 {Tk_DrawChars procedure: loop test} -constraints win -setup {
    destroy .t.l
}  -body {
    label .t.l -padx 0 -pady 0 -bd 0 -highlightthickness 0 -justify left \
    label .t.l -padx 0 -pady 0 -borderwidth 0 -highlightthickness 0 -justify left \
        -text "0" -font systemfixed
    pack .t.l
    update
    .t.l config -text "a"
    update
} -cleanup {
    destroy .t.l
Changes to tests/winMenu.test.
721
722
723
724
725
726
727
728

729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748

749
750
751
752
753
754
755
721
722
723
724
725
726
727

728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747

748
749
750
751
752
753
754
755







-
+



















-
+







    list [update] [destroy .m1]
} -result {{} {}}


test winMenu-20.1 {DrawMenuEntryAccelerator - disabled} -constraints win -setup {
    destroy .m1
} -body {
    menu .m1 -disabledforeground red
    menu .m1 -disabledcolor red
    .m1 add command -label foo -accel "Ctrl+U" -state disabled
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [update] [destroy .m1]
} -result {{} {}}
test winMenu-20.2 {DrawMenuEntryAccelerator - normal text} -constraints {
    win
} -setup {
    destroy .m1
} -body {
    menu .m1
    .m1 add command -label foo -accel "Ctrl+U"
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [update] [destroy .m1]
} -result {{} {}}
test winMenu-20.3 {DrawMenuEntryAccelerator - disabled, no disabledforeground} -constraints {
    win
} -setup {
    destroy .m1
} -body {
    menu .m1 -disabledforeground ""
    menu .m1 -disabledcolor ""
    .m1 add command -label foo -accel "Ctrl+U" -state disabled
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [update] [destroy .m1]
} -result {{} {}}
test winMenu-20.4 {DrawMenuEntryAccelerator - cascade, drawArrow true} -constraints {
    win
} -setup {
810
811
812
813
814
815
816
817

818
819
820
821
822
823
824
825
826
827

828
829
830
831
832
833
834
810
811
812
813
814
815
816

817
818
819
820
821
822
823
824
825
826

827
828
829
830
831
832
833
834







-
+









-
+







    list [update] [destroy .m1]
} -result {{} {}}
test winMenu-25.2 {DrawMenuEntryLabel - disabled with fg} -constraints {
    win
} -setup {
    destroy .m1
} -body {
    menu .m1 -disabledforeground red
    menu .m1 -disabledcolor red
    .m1 add command -label foo -state disabled
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [update] [destroy .m1]
} -result {{} {}}
test winMenu-25.3 {DrawMenuEntryLabel - disabled with no fg} -constraints {
    win
} -setup {
    destroy .m1
} -body {
    menu .m1 -disabledforeground ""
    menu .m1 -disabledcolor ""
    .m1 add command -label foo -state disabled
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [update] [destroy .m1]
} -result {{} {}}


test winMenu-26.1 {TkpComputeMenubarGeometry} -constraints win -setup {
885
886
887
888
889
890
891
892

893
894
895
896
897
898
899
885
886
887
888
889
890
891

892
893
894
895
896
897
898
899







-
+







} -result {{} {}}
test winMenu-29.2 {TkpDrawMenuEntry - gc for active menu item with its own gc} -constraints {
    win
} -setup {
    destroy .m1
} -body {
    menu .m1
    .m1 add command -label foo -activeforeground red
    .m1 add command -label foo -activecolor red
    set tearoff [tk::TearOffMenu .m1 40 40]
    .m1 entryconfigure 1 -state active
    list [update] [destroy .m1]
} -result {{} {}}
test winMenu-29.3 {TkpDrawMenuEntry - gc for active and strict motif} -constraints {
    win
} -setup {
907
908
909
910
911
912
913
914

915
916
917
918
919
920
921
922
923
924

925
926
927
928
929
930
931
932
933
934

935
936
937
938
939
940
941
942
943
944
945

946
947
948
949
950
951
952
907
908
909
910
911
912
913

914
915
916
917
918
919
920
921
922
923

924
925
926
927
928
929
930
931
932
933

934
935
936
937
938
939
940
941
942
943
944

945
946
947
948
949
950
951
952







-
+









-
+









-
+










-
+







    list [update] [destroy .m1] [set tk_strictMotif 0]
} -result {{} {} 0}
test winMenu-29.4 {TkpDrawMenuEntry - gc for disabled with disabledfg and custom entry} -constraints {
    win
} -setup {
    destroy .m1
} -body {
    menu .m1 -disabledforeground blue
    menu .m1 -disabledcolor blue
    .m1 add command -label foo -state disabled -background red
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [update] [destroy .m1]
} -result {{} {}}
test winMenu-29.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} -constraints {
    win
} -setup {
    destroy .m1
} -body {
    menu .m1 -disabledforeground blue
    menu .m1 -disabledcolor blue
    .m1 add command -label foo -state disabled
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [update] [destroy .m1]
} -result {{} {}}
test winMenu-29.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} -constraints {
    win
} -setup {
    destroy .m1
} -body {
    menu .m1 -disabledforeground ""
    menu .m1 -disabledcolor ""
    .m1 add command -label foo -state disabled
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [update] [destroy .m1]
} -result {{} {}}
test winMenu-29.7 {TkpDrawMenuEntry - gc for normal - custom entry} -constraints {
    win
} -setup {
    destroy .m1
} -body {
    menu .m1
    .m1 add command -label foo -foreground red
    .m1 add command -label foo -color red
    set tearoff [tk::TearOffMenu .m1 40 40]
    list [update] [destroy .m1]
} -result {{} {}}
test winMenu-29.8 {TkpDrawMenuEntry - gc for normal} -constraints win -setup {
    destroy .m1
} -body {
    menu .m1
1010
1011
1012
1013
1014
1015
1016
1017

1018
1019
1020
1021
1022
1023
1024
1010
1011
1012
1013
1014
1015
1016

1017
1018
1019
1020
1021
1022
1023
1024







-
+







} -result {{} {} 0}
test winMenu-29.14 {TkpDrawMenuEntry - active border - custom entry} -constraints {
    win
} -setup {
    destroy .m1
} -body {
    menu .m1
    .m1 add command -label foo -activeforeground yellow
    .m1 add command -label foo -activecolor yellow
    set tearoff [tk::TearOffMenu .m1 40 40]
    .m1 entryconfigure 1 -state active
    list [update] [destroy .m1]
} -result {{} {}}
test winMenu-29.15 {TkpDrawMenuEntry - active border} -constraints win -setup {
    destroy .m1
} -body {
Changes to tests/window.test.
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
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







-
+

-
+










-
+

-
+








-
+



-
+

-
+







# will simply dump core if there are bugs.

test window-2.1 {Tk_DestroyWindow procedure, destroy handler deletes parent} -setup {
    destroy .t
} -body {
    toplevel .t -width 300 -height 200
    wm geometry .t +0+0
    frame .t.f  -width 200 -height 200 -relief raised -bd 2
    frame .t.f  -width 200 -height 200 -relief raised -borderwidth 2
    place .t.f -x 0 -y 0
    frame .t.f.f -width 100 -height 100 -relief raised -bd 2
    frame .t.f.f -width 100 -height 100 -relief raised -borderwidth 2
    place .t.f.f -relx 1 -rely 1 -anchor se
    bind .t.f <Destroy> {destroy .t}
    update
    destroy .t.f
} -result {}
test window-2.2 {Tk_DestroyWindow procedure, destroy handler deletes parent} -setup {
    destroy .t
} -body {
    toplevel .t -width 300 -height 200
    wm geometry .t +0+0
    frame .t.f  -width 200 -height 200 -relief raised -bd 2
    frame .t.f  -width 200 -height 200 -relief raised -borderwidth 2
    place .t.f -x 0 -y 0
    frame .t.f.f -width 100 -height 100 -relief raised -bd 2
    frame .t.f.f -width 100 -height 100 -relief raised -borderwidth 2
    place .t.f.f -relx 1 -rely 1 -anchor se
    bind .t.f.f <Destroy> {destroy .t}
    update
    destroy .t.f
} -result {}
test window-2.3 {Tk_DestroyWindow procedure, destroy handler deletes parent} -setup {
    destroy .f
} -body {
    frame .f -width 80 -height 120 -relief raised -bd 2
    frame .f -width 80 -height 120 -relief raised -borderwidth 2
    place .f -relx 0.5 -rely 0.5 -anchor center
    toplevel .f.t -width 300 -height 200
    wm geometry .f.t +0+0
    frame .f.t.f  -width 200 -height 200 -relief raised -bd 2
    frame .f.t.f  -width 200 -height 200 -relief raised -borderwidth 2
    place .f.t.f -x 0 -y 0
    frame .f.t.f.f -width 100 -height 100 -relief raised -bd 2
    frame .f.t.f.f -width 100 -height 100 -relief raised -borderwidth 2
    place .f.t.f.f -relx 1 -rely 1 -anchor se
    update
    destroy .f
} -result {}

test window-2.4 {Tk_DestroyWindow, cleanup half dead window at exit} -constraints {
    unixOrWin
268
269
270
271
272
273
274
275

276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292

293
294
295
296
297
298
299
268
269
270
271
272
273
274

275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291

292
293
294
295
296
297
298
299







-
+
















-
+







    unix testmenubar
} -setup {
    destroy .t
} -body {
    toplevel .t -width 300 -height 200
    wm geometry .t +0+0
    pack [entry .t.e]
    frame .t.f -bd 2 -relief raised
    frame .t.f -borderwidth 2 -relief raised
    testmenubar window .t .t.f
    update
    # If stacking order isn't handle properly, generates an X error.
} -cleanup {
    destroy .t
} -result {}
test window-3.2 {Tk_MakeWindowExist procedure, stacking order and menubars} -constraints {
    unix testmenubar
} -setup {
    destroy .t
} -body {
    toplevel .t -width 300 -height 200
    wm geometry .t +0+0
    pack [entry .t.e]
    pack [entry .t.e2]
    update
    frame .t.f -bd 2 -relief raised
    frame .t.f -borderwidth 2 -relief raised
    raise .t.f .t.e
    testmenubar window .t .t.f
    update
    # If stacking order isn't handled properly, generates an X error.
} -cleanup {
    destroy .t
} -result {}
327
328
329
330
331
332
333
334

335
336
337
338
339
340
341
327
328
329
330
331
332
333

334
335
336
337
338
339
340
341







-
+







} -setup {
    destroy .t
} -body {
    toplevel .t -width 300 -height 200
    wm geometry .t +0+0
    pack [entry .t.e]
    pack [entry .t.e2]
    frame .t.f -bd 2 -relief raised
    frame .t.f -borderwidth 2 -relief raised
    testmenubar window .t .t.f
    update
    lower .t.e2 .t.f
    update
    # If stacking order isn't handled properly, generates an X error.
} -cleanup {
    destroy .t
Changes to tests/winfo.test.
22
23
24
25
26
27
28
29

30
31
32
33
34
35
36
22
23
24
25
26
27
28

29
30
31
32
33
34
35
36







-
+







# w -        Name of toplevel window to create.
# options -    Options for w, such as "-colormap new".

proc eatColors {w {options ""}} {
    destroy $w
    eval toplevel $w $options
    wm geom $w +0+0
    canvas $w.c -width 400 -height 200 -bd 0
    canvas $w.c -width 400 -height 200 -borderwidth 0
    pack $w.c
    for {set y 0} {$y < 8} {incr y} {
        for {set x 0} {$x < 40} {incr x} {
            set color [format #%02x%02x%02x [expr {$x*6}] [expr {$y*30}] 0]
            $w.c create rectangle [expr {10*$x}] [expr {20*$y}] \
                [expr {10*$x + 10}] [expr {20*$y + 20}] -outline {} \
                -fill $color
134
135
136
137
138
139
140
141

142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157

158
159
160
161
162
163
164
165
166
167
168
169
170

171
172
173
174
175
176
177
134
135
136
137
138
139
140

141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156

157
158
159
160
161
162
163
164
165
166
167
168
169

170
171
172
173
174
175
176
177







-
+















-
+












-
+







    winfo containing -displayof geek 25 30
} -returnCodes error -result {bad window path name "geek"}
test winfo-4.5 {"winfo containing" command} -body {
} -setup {
    destroy .t
} -body {
    toplevel .t -width 550 -height 400
    frame .t.f -width 80 -height 60 -bd 2 -relief raised
    frame .t.f -width 80 -height 60 -borderwidth 2 -relief raised
    place .t.f -x 50 -y 50
    wm geom .t +0+0
    update

    raise .t
    winfo containing [winfo rootx .t.f] [winfo rooty .t.f]
} -cleanup {
    destroy .t
} -result .t.f
test winfo-4.6 {"winfo containing" command} -constraints {
    nonPortable
} -setup {
    destroy .t
} -body {
    toplevel .t -width 550 -height 400
    frame .t.f -width 80 -height 60 -bd 2 -relief raised
    frame .t.f -width 80 -height 60 -borderwidth 2 -relief raised
    place .t.f -x 50 -y 50
    wm geom .t +0+0
    update

    winfo containing [expr {[winfo rootx .t.f]-1}] [expr {[winfo rooty .t.f]-1}]
} -cleanup {
    destroy .t
} -result .t
test winfo-4.7 {"winfo containing" command} -setup {
    destroy .t
} -body {
    toplevel .t -width 550 -height 400
    frame .t.f -width 80 -height 60 -bd 2 -relief raised
    frame .t.f -width 80 -height 60 -borderwidth 2 -relief raised
    place .t.f -x 50 -y 50
    wm geom .t +0+0
    update

    set x [winfo containing -display .t.f [expr {[winfo rootx .t]+600}] \
        [expr {[winfo rooty .t.f]+450}]]
    expr {($x == ".") || ($x == "")}
299
300
301
302
303
304
305
306

307
308

309
310
311
312
313
314
315
316
317
318
319


320
321
322
323
324
325
326
327
328
329

330
331

332
333
334
335
336
337
338
299
300
301
302
303
304
305

306
307

308
309
310
311
312
313
314
315
316
317


318
319
320
321
322
323
324
325
326
327
328

329
330

331
332
333
334
335
336
337
338







-
+

-
+









-
-
+
+









-
+

-
+







    winfo viewable .
} -cleanup {
    wm deiconify .
} -result 0
test winfo-9.5 {"winfo viewable" command} -setup {
    deleteWindows
} -body {
    frame .f1 -width 100 -height 100 -relief raised -bd 2
    frame .f1 -width 100 -height 100 -relief raised -borderwidth 2
    place .f1 -x 0 -y 0
    frame .f1.f2 -width 50 -height 50 -relief raised -bd 2
    frame .f1.f2 -width 50 -height 50 -relief raised -borderwidth 2
    place .f1.f2 -x 0 -y 0
    update
    list [winfo viewable .f1] [winfo viewable .f1.f2]
} -cleanup {
    deleteWindows
} -result {1 1}
test winfo-9.6 {"winfo viewable" command} -setup {
    deleteWindows
} -body {
    frame .f1 -width 100 -height 100 -relief raised -bd 2
    frame .f1.f2 -width 50 -height 50 -relief raised -bd 2
    frame .f1 -width 100 -height 100 -relief raised -borderwidth 2
    frame .f1.f2 -width 50 -height 50 -relief raised -borderwidth 2
    place .f1.f2 -x 0 -y 0
    update
    list [winfo viewable .f1] [winfo viewable .f1.f2]
} -cleanup {
    deleteWindows
} -result {0 0}
test winfo-9.7 {"winfo viewable" command} -constraints {failsOnUbuntu failsOnXQuarz} -setup {
    deleteWindows
} -body {
    frame .f1 -width 100 -height 100 -relief raised -bd 2
    frame .f1 -width 100 -height 100 -relief raised -borderwidth 2
    place .f1 -x 0 -y 0
    frame .f1.f2 -width 50 -height 50 -relief raised -bd 2
    frame .f1.f2 -width 50 -height 50 -relief raised -borderwidth 2
    place .f1.f2 -x 0 -y 0
    update
    wm iconify .
    list [winfo viewable .f1] [winfo viewable .f1.f2]
} -cleanup {
    wm deiconify .
    deleteWindows
382
383
384
385
386
387
388
389

390
391
392
393
394
395
396
382
383
384
385
386
387
388

389
390
391
392
393
394
395
396







-
+







# Some embedding tests
#
test winfo-13.1 {root coordinates of embedded toplevel} -setup {
    deleteWindows
} -body {
    frame .con -container 1
    pack .con -expand yes -fill both
    toplevel .emb -use [winfo id .con] -bd 0 -highlightthickness 0
    toplevel .emb -use [winfo id .con] -borderwidth 0 -highlightthickness 0
    button .emb.b
    pack .emb.b -expand yes -fill both
    update

    list rootx [expr {[winfo rootx .emb] == [winfo rootx .con]}] \
        rooty [expr {[winfo rooty .emb] == [winfo rooty .con]}]
} -cleanup {
405
406
407
408
409
410
411
412

413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429

430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446

447
448
449
450
451
452
453
405
406
407
408
409
410
411

412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428

429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445

446
447
448
449
450
451
452
453







-
+
















-
+
















-
+







   set result_13_2 {embedded 0 container 0}
}
test winfo-13.2 {destroying embedded toplevel} -setup {
    deleteWindows
} -body {
    frame .con -container 1
    pack .con -expand yes -fill both
    toplevel .emb -use [winfo id .con] -bd 0 -highlightthickness 0
    toplevel .emb -use [winfo id .con] -borderwidth 0 -highlightthickness 0
    button .emb.b
    pack .emb.b -expand yes -fill both
    update

    destroy .emb
    update
    list embedded [winfo exists .emb.b] container [winfo exists .con]
} -cleanup {
    deleteWindows
} -result $result_13_2

test winfo-13.3 {destroying container window} -setup {
    deleteWindows
} -body {
    frame .con -container 1
    pack .con -expand yes -fill both
    toplevel .emb -use [winfo id .con] -bd 0 -highlightthickness 0
    toplevel .emb -use [winfo id .con] -borderwidth 0 -highlightthickness 0
    button .emb.b
    pack .emb.b -expand yes -fill both
    update

    destroy .con
    update
    list child [winfo exists .emb.b] parent [winfo exists .emb]
} -cleanup {
    deleteWindows
} -result {child 0 parent 0}

test winfo-13.4 {[winfo containing] with embedded windows} -setup {
    deleteWindows
} -body {
    frame .con -container 1
    pack .con -expand yes -fill both
    toplevel .emb -use [winfo id .con] -bd 0 -highlightthickness 0
    toplevel .emb -use [winfo id .con] -borderwidth 0 -highlightthickness 0
    button .emb.b
    pack .emb.b -expand yes -fill both
    update

    button .b
    pack .b -expand yes -fill both
    update
Changes to tests/wm.test.
524
525
526
527
528
529
530
531

532
533
534
535
536
537
538
524
525
526
527
528
529
530

531
532
533
534
535
536
537
538







-
+







} -result {wrong # args: should be "wm deiconify window"}
test wm-deiconify-1.3 {usage} -returnCodes error -body {
    wm deiconify _
} -result {bad window path name "_"}
test wm-deiconify-1.4 {usage} -setup {
    destroy .icon
} -body {
    toplevel .icon -width 50 -height 50 -bg red
    toplevel .icon -width 50 -height 50 -background red
    wm iconwindow .t .icon
    wm deiconify .icon
} -returnCodes error -cleanup {
    destroy .icon
} -result {can't deiconify .icon: it is an icon for .t}
# test embedded window for Windows
test wm-deiconify-1.5 {usage} -constraints win -setup {
933
934
935
936
937
938
939
940

941
942
943
944
945
946
947
948
949
950
951
952
953
954

955
956
957
958
959
960
961
933
934
935
936
937
938
939

940
941
942
943
944
945
946
947
948
949
950
951
952
953

954
955
956
957
958
959
960
961







-
+













-
+







    wm iconwindow .t .b
} -returnCodes error -cleanup {
    destroy .b
} -result {can't use .b as icon window: not at top level}
test wm-iconwindow-1.5 {usage} -setup {
    destroy .icon .t2
} -body {
    toplevel .icon -width 50 -height 50 -bg green
    toplevel .icon -width 50 -height 50 -background green
    toplevel .t2
    wm geom .t2 -0+0
    wm iconwindow .t2 .icon
    wm iconwindow .t .icon
} -returnCodes error -cleanup {
    destroy .t2 .icon
} -result {.icon is already an icon for .t2}

test wm-iconwindow-2.1 {setting and reading values} -setup {
    destroy .icon
    set result {}
} -body {
    lappend result [wm iconwindow .t]
    toplevel .icon -width 50 -height 50 -bg green
    toplevel .icon -width 50 -height 50 -background green
    wm iconwindow .t .icon
    lappend result [wm iconwindow .t]
    wm iconwindow .t {}
    destroy .icon
    lappend result [wm iconwindow .t]
} -result {{} .icon {}}

1563
1564
1565
1566
1567
1568
1569
1570

1571
1572
1573
1574
1575
1576
1577
1563
1564
1565
1566
1567
1568
1569

1570
1571
1572
1573
1574
1575
1576
1577







-
+







} -cleanup {
    destroy .t
} -result 1

test wm-stackorder-6.1 {An embedded toplevel does not appear in the \
	stacking order} -body {
    toplevel .real -container 1
    toplevel .embd -bg blue -use [winfo id .real]
    toplevel .embd -background blue -use [winfo id .real]
    update
    wm stackorder .
} -cleanup {
    deleteWindows
} -result {. .real}

stdWindow
1615
1616
1617
1618
1619
1620
1621
1622

1623
1624
1625
1626
1627
1628
1629
1630
1631

1632
1633
1634
1635
1636
1637
1638
1615
1616
1617
1618
1619
1620
1621

1622
1623
1624
1625
1626
1627
1628
1629
1630

1631
1632
1633
1634
1635
1636
1637
1638







-
+








-
+







    toplevel .subject
    wm transient .subject .top
    wm iconify .subject
} -cleanup {
    deleteWindows
} -result {can't iconify ".subject": it is a transient}
test wm-transient-1.5 {usage} -returnCodes error -body {
    toplevel .icon -bg blue
    toplevel .icon -background blue
    toplevel .top
    wm iconwindow .top .icon
    toplevel .dummy
    wm transient .icon .dummy
} -cleanup {
    deleteWindows
} -result {can't make ".icon" a transient: it is an icon for .top}
test wm-transient-1.6 {usage} -returnCodes error -body {
    toplevel .icon -bg blue
    toplevel .icon -background blue
    toplevel .top
    wm iconwindow .top .icon
    toplevel .dummy
    wm transient .dummy .icon
} -cleanup {
    deleteWindows
} -result {can't make ".icon" a container: it is an icon for .top}