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 | - 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" | < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 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/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" - 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" - 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" # 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" - 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" - 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" # 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 | 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. | | | 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 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 | 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 | | | 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 \-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 | 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 | | | 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 \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 | Tk_Cursor \fBTk_GetCursor(\fIinterp, tkwin, name\fB)\fR .sp Tk_Cursor \fBTk_GetCursorFromObj(\fItkwin, objPtr\fB)\fR .sp Tk_Cursor | | | 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, 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 | 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. | | | | | 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 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 | 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 | | | | | | | | 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[\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 \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 \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\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. \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\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 | 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 | | | 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 \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 | void *\fIdst\fR; const char *\fIhelp\fR; } \fBTk_ArgvInfo\fR; .CE The \fIkey\fR field is a string such as .QW \-display or | | | 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 \-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 | 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). | | | 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\-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 | .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, | | | | 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 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 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 | \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 | | | | 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\-color \fIcolor\fR . 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 | .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 | | | | | | | 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 \-disabledcolor \-relief \-activecolor \-font \-repeatdelay \-anchor \-highlightbackground \-repeatinterval \-background \-highlightcolor \-takefocus \-bitmap \-highlightthickness \-text \-borderwidth \-image \-textvariable \-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 | 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 | | | | | 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\-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\-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\-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 | .SH SYNOPSIS \fBcanvas\fR \fIpathName \fR?\fIoptions\fR? .SO \-background \-borderwidth \-cursor \-highlightbackground \-highlightcolor \-highlightthickness \-insertbackground \-insertborderwidth \-insertofftime \-insertontime \-insertwidth \-relief | | | 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 \-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 | .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. | | | 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 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 | \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 | | | | | 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\-colord \fIcolor\fR .TP \fB\-activecolor \fIcolor\fR .TP \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 | .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 | | | | | | | 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 \-cursor \-padx \-activecolor \-disabledcolor \-pady \-anchor \-font \-relief \-background \-highlightbackground \-takefocus \-bitmap \-highlightcolor \-text \-borderwidth \-highlightthickness \-textvariable \-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 | 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 | | | | | 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\-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\-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\-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 | 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 | | | 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 \-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 | .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 | | | | | | | | | | 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 \-color \-insertborderwidth \-selectcolor \-cursor \-insertofftime \-takefocus \-exportselection \-insertontime \-textvariable \-font \-insertwidth \-xscrollcommand \-highlightbackground \-justify \-highlightcolor \-relief \-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 \-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 | \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 | | | 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\-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 | .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 | | | | | | | | 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 \-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\-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\-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 | .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 | | | | 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" \-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 | 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 | | | 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 \-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 | '\" 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 | | | | | 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 \-disabledcolor \-exportselection \-font \-color \-highlightbackground \-highlightcolor \-highlightthickness \-justify \-relief \-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 | 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, | | | 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\-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 | .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 | | | | | | 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\-color \fIcolor\fR . \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\-selectcolor \fIcolor\fR . \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 | .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 | | | | 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 \-color \-activeborderwidth \-cursor \-relief \-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 | 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 | | | | | 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\-activecolor \fIvalue\fR . 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\-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 | . 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 | | | | | 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\-color \fIvalue\fR . 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\-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 | 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 | | | | | 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\-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\-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\-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 | .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 | | | | | 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 \-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 | 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 | | | | | 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 \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\-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\-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 | '\" 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 | | | 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 \-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 | 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 | | | | 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 \fBcolor\fR for the \fBButton\fR class (note that on some platforms the option is ignored): .CS \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 | 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 | | | | 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\-color\fR and there exists a widget \fB.a.b.c\fR, then the command .CS \&\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 | .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). | | | | 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 \-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 | 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. | | | | | | | 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 \-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 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 \-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 | 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. | | | | 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 \-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 | .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. | | | | 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 \-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 | 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 | | | | 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" \-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 | 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 | | | | | | 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 \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 | 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 | | | 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!" \-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 | .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 | | | | | 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 \-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 | 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 | | | | | 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\-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\-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\-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 | .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 | | | 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 \-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 | 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 | | | | | | | | 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 \-selectcolor \-exportselection \-insertwidth \-takefocus \-font \-insertofftime \-textvariable \-color \-justify \-xscrollcommand \-highlightbackground \-relief \-highlightcolor \-repeatdelay \-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 \-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 | \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 | | | 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\-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 | 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 | | | 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 \-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 | \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 | | | | 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 \-selectcolor \-font \-insertontime \-setgrid \-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 | .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 | | | | | | 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\-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\-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\-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\-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 | .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 | | | | 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\-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\-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 | \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 | | | | | 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\-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\-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 | 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 | | | | 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\-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\-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 | 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, | | | | 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\-selectcolor\fR options for the text widget are tied to the \fB\-background\fR, \fB\-borderwidth\fR, and \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 | .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 | | | 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 \-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 | are: .PP \fB\-anchor\fP \fIanchor\fP .br \fB\-background\fP \fIcolor\fP .br \fB\-bordercolor\fP \fIcolor\fP .br \fB\-compound\fP \fIcompound\fP .br \fB\-darkcolor\fP \fIcolor\fP .br | > > < < | 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\-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 | \fBpressed\fP, \fBselected\fP, \fBreadonly\fP. .PP \fBTCheckbutton\fP styling options configurable with \fBttk::style\fP are: .PP \fB\-background\fP \fIcolor\fP .br | | | | 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\-color\fP \fIcolor\fP .br \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 | .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 | | | 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 \-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 | \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\-darkcolor\fP \fIcolor\fP .br \fB\-focusfill\fP \fIcolor\fP .br | > > < < | | | | | | 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\-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\-placeholdercolor\fP \fIcolor\fP .br \fB\-postoffset\fP \fIpadding\fP .br \fB\-selectbackground\fP \fIcolor\fP .RS Text entry select background. .RE \fB\-selectcolor\fP \fIcolor\fP .RS 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.color \fIcolor\fP .br option add *TCombobox*Listbox.selectBackground \fIcolor\fP .br 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 | 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 | | | | | 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 \-color \-style \-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 \-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 | .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 | | | | | 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\-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\-placeholdercolor\fP \fIcolor\fP .br \fB\-relief\fP \fIrelief\fP .br \fB\-selectbackground\fP \fIcolor\fP .br \fB\-selectborderwidth\fP \fIamount\fP .br \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 | 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 | | | 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\-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 | 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 | | | | | 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 \-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 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 \-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 | .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 | | | 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 \-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 | Dynamic states: \fBdisabled\fP, \fBreadonly\fP. .PP \fBTLabel\fP styling options configurable with \fBttk::style\fP are: .PP \fB\-background\fP \fIcolor\fP .br | | | | 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\-color\fP \fIcolor\fP .br \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 | \fB\-relief\fP \fIrelief\fP .PP \fBTLabelframe.Label\fP styling options configurable with \fBttk::style\fP are: .PP \fB\-background\fP \fIcolor\fP .br | | | | 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\-color\fP \fIcolor\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), ttk::frame(n), labelframe(n) |
︙ | ︙ |
Changes to doc/ttk_menubutton.n.
︙ | ︙ | |||
54 55 56 57 58 59 60 | \fBTMenubutton\fP styling options configurable with \fBttk::style\fP are: .PP \fB\-arrowsize\fP \fIamount\fP .br \fB\-background\fP \fIcolor\fP .br | | | | 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\-color\fP \fIcolor\fP .br \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 | .PP \fB\-background\fP \fIcolor\fP .br \fB\-bordercolor\fP \fIcolor\fP .br \fB\-darkcolor\fP \fIcolor\fP .br | | > > < < | 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\-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\-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 | 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 | | | | 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-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 \-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 | \fBpressed\fP, \fBreadonly\fP, \fBselected\fP. .PP \fBTRadiobutton\fP styling options configurable with \fBttk::style\fP are: .PP \fB\-background\fP \fIcolor\fP .br | | | | 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\-color\fP \fIcolor\fP .br \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 | .br \fB\-arrowsize\fP \fIamount\fP .br \fB\-background\fP \fIcolor\fP .br \fB\-bordercolor\fP \fIcolor\fP .br | | | | 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\-color\fP \fIcolor\fP .br \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 | 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 | | | 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 \-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 | \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\-darkcolor\fP \fIcolor\fP .br \fB\-fieldbackground\fP \fIcolor\fP .br | > > < < | | | 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\-insertcolor\fP \fIcolor\fP .br \fB\-insertwidth\fP \fIamount\fP .br \fB\-lightcolor\fP \fIcolor\fP .br \fB\-padding\fP \fIpadding\fP .br \fB\-placeholdercolor\fP \fIcolor\fP .br \fB\-selectbackground\fP \fIcolor\fP .br \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 | 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: | | | | 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\-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 | .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\-fieldbackground\fP \fIcolor\fP .br \fB\-font\fP \fIfont\fP .br | > > < < | 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\-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 | \fB\-font\fP \fIfont\fP .br \fB\-relief\fP \fIrelief\fP .PP \fBItem\fP styling options configurable with \fBttk::style\fP are: .PP | | | 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\-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 | .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. | | | | 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 \-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 | 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 | | | | | 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\-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 | /* * Information used for parsing configuration options. There is a * separate table for each of the four widget classes. */ static const Tk_OptionSpec labelOptionSpecs[] = { | | | > > > > > > > > | | | | > > > | | > > | | > | 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", "ActiveBackground", DEF_BUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeBorder), 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {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}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_BUTTON_CURSOR, TCL_INDEX_NONE, offsetof(TkButton, cursor), TK_OPTION_NULL_OK, 0, 0}, {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", "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_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 | {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[] = { | | | > > > > > > > > | | > > > | | > > | | > | 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", "ActiveBackground", DEF_BUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeBorder), 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {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, "-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", "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_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 | {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[] = { | | | > > > > > > > > | | > > > | | > > | | > | 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", "ActiveBackground", DEF_BUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeBorder), 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {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, "-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", "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_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 | {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[] = { | | | > > > > > > > > | | > > > | | > > | | > | 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", "ActiveBackground", DEF_BUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, activeBorder), 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {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, "-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", "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_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 | 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. */ | | | | | | | | | 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 * color in normal mode. */ 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 | TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { | | | | > > > | | > > | | | > | | > | 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", "activebackground", "Activebackground", NULL, offsetof(BitmapItem, activeBgColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-activebitmap", "activebitmap", "Activebitmap", NULL, offsetof(BitmapItem, activeBitmap), TK_CONFIG_NULL_OK, 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", "background", "Background", NULL, offsetof(BitmapItem, bgColor), TK_CONFIG_NULL_OK, 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", "disabledbackground", "Disabledbackground", NULL, offsetof(BitmapItem, disabledBgColor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-disabledbitmap", "disabledbitmap", "Disabledbitmap", NULL, offsetof(BitmapItem, disabledBitmap), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-disabledcolor", "disabledcolor", "Disabledcolor", NULL, offsetof(BitmapItem, disabledFgColor), TK_CONFIG_NULL_OK, NULL}, #ifndef TK_NO_DEPRECATED {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 | 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}, {TK_CONFIG_SYNONYM, "-bd", "borderWidth", NULL, NULL, 0, 0, NULL}, {TK_CONFIG_SYNONYM, "-bg", "background", NULL, NULL, 0, 0, NULL}, {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}, | > > | | | | | | | | | | | > > > | | | | 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", "InsertBackground", DEF_CANVAS_INSERT_BG, offsetof(TkCanvas, textInfo.insertBorder), 0, NULL}, {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", "InsertBorderWidth", DEF_CANVAS_INSERT_BD_MONO, offsetof(TkCanvas, textInfo.insertBorderWidth), TK_CONFIG_MONO_ONLY, NULL}, {TK_CONFIG_INT, "-insertofftime", "insertOffTime", "InsertOffTime", DEF_CANVAS_INSERT_OFF_TIME, offsetof(TkCanvas, insertOffTime), 0, NULL}, {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", "SelectBackground", DEF_CANVAS_SELECT_COLOR, offsetof(TkCanvas, textInfo.selBorder), TK_CONFIG_COLOR_ONLY, NULL}, {TK_CONFIG_BORDER, "-selectbackground", "selectBackground", "SelectBackground", DEF_CANVAS_SELECT_MONO, offsetof(TkCanvas, textInfo.selBorder), TK_CONFIG_MONO_ONLY, NULL}, {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", "SelectBorderWidth", DEF_CANVAS_SELECT_BD_MONO, offsetof(TkCanvas, textInfo.selBorderWidth), TK_CONFIG_MONO_ONLY, NULL}, {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, "-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", "XScrollCommand", DEF_CANVAS_X_SCROLL_CMD, offsetof(TkCanvas, xScrollCmd), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_PIXELS, "-xscrollincrement", "xScrollIncrement", "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", "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 | * 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}, {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}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_ENTRY_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Entry, borderWidth), 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}, | > > > > | | > > > > > | | > > | | > | 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, "-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", "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_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 | {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}, {TK_OPTION_SYNONYM, "-invcmd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-invalidcommand", 0}, {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}, | > > | | | > > > > | > > > > > > | 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, "-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, "-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 | 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}, {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}, {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_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}, | > > > > | | > > > > > | | > > | | > | 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, "-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", "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_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 | {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}, {TK_OPTION_SYNONYM, "-invcmd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-invalidcommand", 0}, {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}, | > > | | | > > > > | > > > > > > | 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, "-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, "-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 | * * 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 | | | | 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 * 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 | * 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}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {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. */ | > > | 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 | {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}, {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}, {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}, {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}, {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}, | > > > > | 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 | {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}, | > > > | | > > | | > | 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", "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_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 | if (length < 2) { continue; } c = arg[1]; if (((c == 'c') && (length >= 2) && (strncmp(arg, "-class", length) == 0)) | | | 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 >= 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 | }; /* * Information used for parsing configuration specs: */ static const Tk_ConfigSpec configSpecs[] = { | | > > > | < > | 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", "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_SYNONYM, "-foreground", "color", NULL, NULL, 0, 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 | */ 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", | | | > | | > | | > > | | | | | > > > > | | > | | > | > | | > | | | | | | | | | | | | | | | > > > > | | | | | | | | | | | | | | | | | | > | > > > > > | | | | < > | | | | | | | | > > > > > > | 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}, #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_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, "-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}, #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}, #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}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "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}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "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", "SelectBackground", DEF_LISTBOX_SELECT_COLOR, TCL_INDEX_NONE, offsetof(Listbox, selBorder), 0, DEF_LISTBOX_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", "SelectBorderWidth", DEF_LISTBOX_SELECT_BD, TCL_INDEX_NONE, offsetof(Listbox, selBorderWidth), 0, 0, 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}, {TK_OPTION_BOOLEAN, "-setgrid", "setGrid", "SetGrid", 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}, {TK_OPTION_INT, "-width", "width", "Width", 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}, #ifndef TK_NO_DEPRECATED {TK_OPTION_SYNONYM, "-bg", NULL, NULL, 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}, #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 | */ static const char *const compoundStrings[] = { "bottom", "center", "left", "none", "right", "top", NULL }; static const Tk_OptionSpec tkBasicMenuEntryConfigSpecs[] = { | < < < < < < > > > > > > > > > > | | > > > > | 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_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", "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, "-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 | static const char *const menuTypeStrings[] = { "normal", "tearoff", "menubar", NULL }; static const Tk_OptionSpec tkMenuConfigSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", | | | | | > > > > > > > > | | > > > | | > > | | > | 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", "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", "ActiveBorderWidth", DEF_MENU_ACTIVE_BORDER_WIDTH, offsetof(TkMenu, activeBorderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0}, {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, "-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", "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_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 | }; /* * Information used for parsing configuration specs: */ static const Tk_OptionSpec optionSpecs[] = { | | | > > > > > > > > | | > > > | | > > | | > | 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", "ActiveBackground", DEF_MENUBUTTON_ACTIVE_BG_COLOR, TCL_INDEX_NONE, offsetof(TkMenuButton, activeBorder), 0, (ClientData) DEF_MENUBUTTON_ACTIVE_BG_MONO, 0}, {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, "-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", "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_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 | 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}, | | | | | 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", "PadX", DEF_MENUBUTTON_PADX, TCL_INDEX_NONE, offsetof(TkMenuButton, padX), 0, 0, 0}, {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", "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 | /* * Information used for argv parsing. */ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MESSAGE_ANCHOR, | | | | | > | | > | | > > | | > | | > > | | > | | | | | | | | | 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}, {TK_OPTION_INT, "-aspect", "aspect", "Aspect", DEF_MESSAGE_ASPECT, 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}, #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_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}, #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_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}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", 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}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", 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 | * 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 | | | 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.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 | 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}, {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}, {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", | > > | 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 | 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}, {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}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_SCALE_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(TkScale, borderWidth), 0, 0, 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}, | > > > > > > | | > > | | | | 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", "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_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 | 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}, {TK_CONFIG_SYNONYM, "-bd", "borderWidth", NULL, NULL, 0, 0, NULL}, {TK_CONFIG_SYNONYM, "-bg", "background", NULL, NULL, 0, 0, NULL}, {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}, | > > | 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 | * 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}, {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}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", "2", offsetof(Square, borderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_BOOLEAN, "-dbl", "doubleBuffer", "DoubleBuffer", "1", offsetof(Square, doubleBufferPtr), TCL_INDEX_NONE, 0 , NULL, 0}, | > > > > > > | | | | < > | 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", "color", NULL, NULL, 0, TCL_INDEX_NONE, 0, "-color", 0}, {TK_OPTION_SYNONYM, "-foreground", "color" , NULL, NULL, 0, TCL_INDEX_NONE, 0, "-color", 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 | {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}, {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}, {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_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}, | > > > > > > | | > > | | < > | 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", "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_SYNONYM, "-foreground", "color" , NULL, NULL, 0, TCL_INDEX_NONE, 0, "-color", 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 | {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}, | | | | > > > > | 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", "SelectBackground", DEF_TEXT_SELECT_COLOR, TCL_INDEX_NONE, offsetof(TkText, selBorder), 0, DEF_TEXT_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", "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, "-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 | 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}, | | > > > > > > > | | > > | | > | | > > > > | > > > > > > | | > > > > | 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, "-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_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_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, "-overstrikecolor", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, overstrikeColor), 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, "-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, "-underlinecolor", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, underlineColor), 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 | } 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 }, | | > > > > | 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, "-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 | 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" }, | | | 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" }, { "-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 | /* 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", | | | | 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 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 | Tcl_Obj *borderColorObj; Tcl_Obj *marginObj; } IndicatorElement; static const Ttk_ElementOptionSpec IndicatorElementOptions[] = { { "-background", TK_OPTION_COLOR, offsetof(IndicatorElement,backgroundObj), DEFAULT_BACKGROUND }, | | | 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 }, { "-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 | typedef struct { Tcl_Obj *colorObj; Tcl_Obj *marginObj; Tcl_Obj *diameterObj; } TreeitemIndicator; static const Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = { | | | 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[] = { { "-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 | 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}, | | > > > > | | | > > > | 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, "-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, "-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 | /* Initialize to fallback values: */ *es = entryPtr->entry.styleDefaults; # define INIT(member, name) \ if ((tmp=Ttk_QueryOption(entryPtr->core.layout,name,state))) \ es->member=tmp; | | | | | 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, "-placeholdercolor"); INIT(foregroundObj, "-color"); INIT(selBorderObj, "-selectbackground") INIT(selBorderWidthObj, "-selectborderwidth") 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 | * 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 }, | | | 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 }, { "-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 | /* 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 }, | | | 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 }, { "-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 | { {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 }, | | > > > > | 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, "-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 | * 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", | | | | | | | > > > | | | | | | | | | 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, "-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}, {TK_OPTION_PIXELS, "-height", "height", "Height", "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 }, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", 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}, 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 | Tcl_Obj *heightObj; } SquareElement; static const Ttk_ElementOptionSpec SquareElementOptions[] = { { "-background", TK_OPTION_BORDER, offsetof(SquareElement,borderObj), DEFAULT_BACKGROUND }, | | | 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 }, { "-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 | 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 }, | | > > > > | 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, "-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 | typedef struct { Tcl_Obj *colorObj; Tcl_Obj *sizeObj; Tcl_Obj *marginsObj; } TreeitemIndicator; static const Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = { | | | 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[] = { { "-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 | # 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 # | | | 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 -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 | -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] - | | | | 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 -borderwidth]) }] canvas $f.color -height $height \ -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 | # 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] | | | | | 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 -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 -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 | [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. | | | 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 -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 | # 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)] | | | 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 -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 | } 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 | | | | | | 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 -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 | # 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 | | | | | | 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 -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 -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 | # Set up display styles. if {[winfo depth $w] > 1} { set bold "-background #43ce80 -relief raised -borderwidth 1" set normal "-background {} -relief flat" } else { | | | | 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 "-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 | 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} { | | | 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 -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 | 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 \ | | | 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 -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 | 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} | | | 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 -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 | -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 | | | 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 -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 | ## See Code / Dismiss buttons set btns [addSeeDismiss $w.buttons $w] pack $btns -side bottom -fill x entry $w.e1 entry $w.e2 | | | 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} -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 | 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." | | | 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} -placeholdercolor gray75 |
Changes to library/demos/entry3.tcl.
︙ | ︙ | |||
46 47 48 49 50 51 52 | # 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} { | | | | | | | | 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 -color $fg -background $bg } else { if {$count%2} { $W configure -color $bg -background $fg } else { $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 -validatecommand {string is integer %P} $w.l1.e configure -invalidcommand \ "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 -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 | # 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} | | | 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 -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 | # Can't move any further bell return -code break } } labelframe $w.l3 -text "US Phone-Number Entry" | | | | | 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 -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 "*" -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 | 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} { | | | 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 -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 | 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 | | | | 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 -borderwidth 2 -relief raised] \ -side left -fill both -expand 1 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 | 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 \ | | | | 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 \ -color $::C(fg) $w.c create bitmap 644 $yy -bitmap gray25 -anchor nw \ -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 | ## 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 | | | 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 -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 | ## 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] | | | | 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 -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 -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 | 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 | | | 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 -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 | } 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 | | | 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 -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 | #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" | | | | 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 -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 -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 | ## 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 | | | | 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 -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 | 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 \ | | | 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] -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 | # 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. | | | | 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 -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 -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 | if {[tk windowingsystem] eq "aqua"} { set frameSize 168 } else { set frameSize 120 } frame $w.frame -width $frameSize -height $frameSize -borderwidth 2\ | | | | 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 -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 -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 | $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 \ | | | 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 -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 | 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 \ | | | | | | 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 -color white" 800 "$w.text tag configure \ search -background {} -color {}" 200 } else { textToggle "$w.text tag configure search -background \ 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 | set australianCities { Canberra Sydney Melbourne Perth Adelaide Brisbane Hobart Darwin "Alice Springs" } spinbox $w.s1 -from 1 -to 10 -width 10 -validate key \ | | | 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 \ -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 | $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 | | | | | | | | 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 -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 -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 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 | $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 " | | | | 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 backgroundstipple $w.text insert end " or " $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 | [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] | | | 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 -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 | } 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] | | | 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 -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 | # 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} | | | 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 -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 | 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]] | | | 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 -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 | 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 | | | 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 -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 | } elseif {$windowingsystem eq "x11"} { wm attributes $w -type dialog } frame $w.bot frame $w.top if {$windowingsystem eq "x11"} { | | | | 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 -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 | } if {$rTag < 0 || $rTag >= [llength $list]} { return } set bbox [$canvas bbox item$rTag] | | | 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 -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 | $sbar configure -command "" } return } set W [winfo width $canvas] set H [winfo height $canvas] | | | 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 -borderwidth]}] if {$pad < 2} { set pad 2 } incr W [expr {$pad*-2}] incr H [expr {$pad*-2}] |
︙ | ︙ | |||
376 377 378 379 380 381 382 | } method DrawSelection {} { $canvas delete selection $canvas itemconfigure selectionText -fill black $canvas dtag selectionText set cbg [ttk::style lookup TEntry -selectbackground focus] | | | 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 -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 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Ensure existence of ::tk::dialog namespace # namespace eval ::tk::dialog {} | | | | | | | | | 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 -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 -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 -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 -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 -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 -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 -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 | # 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} | | | 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 -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 | # 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 | | | | | | | | | | | 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 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(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(color) black } else { set new(color) white } } 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 {activeColor insertBackground selectColor \ highlightColor} { if {![info exists new($i)]} { set new($i) $new(color) } } 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 | # ::tk_bisque -- # Reset the Tk color palette to the old "bisque" colors. # # Arguments: # None. proc ::tk_bisque {} { | | | | | 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 activeColor black \ background #ffe4c4 disabledColor #b0b0b0 color black \ highlightBackground #ffe4c4 highlightColor black \ insertBackground 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 | # # Ttk widget set: Alternate theme # namespace eval ttk::theme::alt { variable colors array set colors { -frame "#d9d9d9" -window "#ffffff" -darker "#c3c3c3" -border "#414141" | | | | | | | | | | | 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" -activebackground "#ececec" -disabledcolor "#a3a3a3" -selectbackground "#4a6984" -selectcolor "#ffffff" -altindicator "#aaaaaa" } ttk::style theme settings alt { ttk::style configure "." \ -background $colors(-frame) \ -color black \ -troughcolor $colors(-darker) \ -bordercolor $colors(-border) \ -selectbackground $colors(-selectbackground) \ -selectcolor $colors(-selectcolor) \ -font TkDefaultFont \ ; ttk::style map "." -background \ [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 | 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)] \ | | | | | | | | | 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(-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(-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(-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(-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(-selectbackground) -borderwidth 0 } } |
Changes to library/ttk/aquaTheme.tcl.
1 2 3 4 5 6 7 8 9 10 | # # Aqua theme (OSX native look and feel) # namespace eval ttk::theme::aqua { ttk::style theme settings aqua { ttk::style configure . \ -font TkDefaultFont \ -background systemWindowBackgroundColor \ | | | | | | | | | | | | | | | | | | | | | | 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 \ -color systemLabelColor \ -selectbackground systemSelectedTextBackgroundColor \ -selectcolor systemSelectedTextColor \ -selectborderwidth 0 \ -insertwidth 1 ttk::style map . \ -color { disabled systemDisabledControlTextColor background systemLabelColor} \ -selectbackground { background systemSelectedTextBackgroundColor !focus systemSelectedTextBackgroundColor} \ -selectcolor { background systemSelectedTextColor !focus systemSelectedTextColor} # Button ttk::style configure TButton -anchor center -width -6 \ -color systemControlTextColor ttk::style map TButton \ -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 \ -color systemTextColor \ -background systemTextBackgroundColor ttk::style map TEntry \ -color { disabled systemDisabledControlTextColor } \ -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 -color systemControlTextColor ttk::style map TNotebook.Tab \ -color { background systemControlTextColor disabled systemDisabledControlTextColor selected systemSelectedTabTextColor} # Combobox: ttk::style configure TCombobox \ -color systemTextColor \ -background systemTransparent ttk::style map TCombobox \ -color { disabled systemDisabledControlTextColor } \ -selectcolor { background systemTextColor } \ -selectbackground { background systemTransparent } # Spinbox ttk::style configure TSpinbox \ -color systemTextColor \ -background systemTextBackgroundColor \ -selectcolor systemSelectedTextColor \ -selectbackground systemSelectedTextBackgroundColor ttk::style map TSpinbox \ -color { disabled systemDisabledControlTextColor } \ -selectcolor { !active systemTextColor } \ -selectbackground { !active systemTextBackgroundColor !focus systemTextBackgroundColor focus systemSelectedTextBackgroundColor } # Treeview: ttk::style configure Heading \ -font TkHeadingFont \ -color systemTextColor \ -background systemWindowBackgroundColor ttk::style configure Treeview -rowheight 18 \ -background systemTextBackgroundColor \ -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 | # # "Clam" theme. # # Inspired by the XFCE family of Gnome themes. # namespace eval ttk::theme::clam { variable colors array set colors { | | | | | | | | | | 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 { -disabledcolor "#999999" -frame "#dcdad5" -window "#ffffff" -dark "#cfcdc8" -darker "#bab5ab" -darkest "#9e9a91" -lighter "#eeebe7" -lightest "#ffffff" -selectbackground "#4a6984" -selectcolor "#ffffff" -altindicator "#5895bc" -disabledaltindicator "#a0a0a0" } ttk::style theme settings clam { ttk::style configure "." \ -background $colors(-frame) \ -color black \ -bordercolor $colors(-darkest) \ -darkcolor $colors(-dark) \ -lightcolor $colors(-lighter) \ -troughcolor $colors(-darker) \ -selectbackground $colors(-selectbackground) \ -selectcolor $colors(-selectcolor) \ -selectborderwidth 0 \ -font TkDefaultFont \ ; ttk::style map "." \ -background [list disabled $colors(-frame) \ active $colors(-lighter)] \ -color [list disabled $colors(-disabledcolor)] \ -selectbackground [list !focus $colors(-darkest)] \ -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 | 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)] \ | | | | | | | | | | 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(-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(-selectbackground) \ readonly $colors(-frame)] \ -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(-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(-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 | # # "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" | | | | | | | | | | | | | | 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" -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) \ -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(-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 | 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} \ | | | | | | | 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(-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(-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(-troughbackground) active $colors(-activebackground)] } } |
Changes to library/ttk/defaults.tcl.
1 2 3 4 5 6 7 8 | # # Settings for default theme. # namespace eval ttk::theme::default { variable colors array set colors { -frame "#d9d9d9" | | | | | | | | | | | | | | | | | | | | | | | 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" -color "#000000" -window "#ffffff" -text "#000000" -activebackground "#ececec" -selectbackground "#4a6984" -selectcolor "#ffffff" -darker "#c3c3c3" -disabledcolor "#a3a3a3" -indicator "#4a6984" -disabledindicator "#a3a3a3" -altindicator "#9fbdd8" -disabledaltindicator "#c0c0c0" } ttk::style theme settings default { ttk::style configure "." \ -borderwidth 1 \ -background $colors(-frame) \ -color $colors(-color) \ -troughcolor $colors(-darker) \ -font TkDefaultFont \ -selectborderwidth 1 \ -selectbackground $colors(-selectbackground) \ -selectcolor $colors(-selectcolor) \ -insertwidth 1 \ -indicatordiameter 10 \ ; ttk::style map "." -background \ [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(-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(-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(-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(-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(-disabledcolor)] ttk::style configure TScale \ -sliderrelief raised ttk::style configure TProgressbar \ -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) \ -color $colors(-text) ; ttk::style map Treeview \ -background [list disabled $colors(-frame)\ 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 | } 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 \ | | | 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(-activebackground)] } } |
Changes to library/ttk/vistaTheme.tcl.
︙ | ︙ | |||
14 15 16 17 18 19 20 | namespace eval ttk::theme::vista { ttk::style theme settings vista { ttk::style configure . \ -background SystemButtonFace \ | | | | | 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 \ -color SystemWindowText \ -selectcolor SystemHighlightText \ -selectbackground SystemHighlight \ -insertcolor SystemWindowText \ -font TkDefaultFont \ ; ttk::style map "." \ -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 | # Treeview: ttk::style configure Heading -font TkHeadingFont ttk::style configure Treeview -background SystemWindow ttk::style map Treeview \ -background [list disabled SystemButtonFace \ selected SystemHighlight] \ | | | | 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] \ -color [list disabled SystemGrayText \ selected SystemHighlightText] # Label and Toolbutton 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 | ttk::style layout ComboboxPopdownFrame { ComboboxPopdownFrame.background -sticky news -border 1 -children { ComboboxPopdownFrame.padding -sticky news } } ttk::style map TCombobox \ -selectbackground [list !focus SystemWindow] \ | | | | 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] \ -selectcolor [list !focus SystemWindowText] \ -color [list \ disabled SystemGrayText \ {readonly focus} SystemHighlightText \ ] \ -focusfill [list {readonly focus} SystemHighlight] \ ; # Entry |
︙ | ︙ | |||
109 110 111 112 113 114 115 | Entry.textarea -sticky news } } } } ttk::style map TEntry \ -selectbackground [list !focus SystemWindow] \ | | | 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] \ -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 | Spinbox.uparrow -side top -sticky ens Spinbox.downarrow -side bottom -sticky ens } } } ttk::style map TSpinbox \ -selectbackground [list !focus SystemWindow] \ | | | 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] \ -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 | # # Settings for 'winnative' theme. # namespace eval ttk::theme::winnative { ttk::style theme settings winnative { ttk::style configure "." \ -background SystemButtonFace \ | | | | | | | | 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 \ -color SystemWindowText \ -selectcolor SystemHighlightText \ -selectbackground SystemHighlight \ -fieldbackground SystemWindow \ -insertcolor SystemWindowText \ -troughcolor SystemScrollbar \ -font TkDefaultFont \ ; 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] \ -selectcolor [list !focus SystemWindowText] \ ; ttk::style configure TCombobox -padding 2 ttk::style map TCombobox \ -selectbackground [list !focus SystemWindow] \ -selectcolor [list !focus SystemWindowText] \ -fieldbackground [list \ readonly SystemButtonFace \ disabled SystemButtonFace] \ -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 | # 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] \ | | | 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] \ -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 | # # Settings for 'xpnative' theme # namespace eval ttk::theme::xpnative { ttk::style theme settings xpnative { ttk::style configure . \ -background SystemButtonFace \ | | | | | | | | | | | 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 \ -color SystemWindowText \ -selectcolor SystemHighlightText \ -selectbackground SystemHighlight \ -insertcolor SystemWindowText \ -font TkDefaultFont \ ; ttk::style map "." \ -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 -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] \ -selectcolor [list !focus SystemWindowText] \ ; ttk::style configure TCombobox -padding 2 ttk::style map TCombobox \ -selectbackground [list !focus SystemWindow] \ -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] \ -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] \ -color [list disabled SystemGrayText \ selected SystemHighlightText]; } } |
Changes to library/xmfbox.tcl.
︙ | ︙ | |||
323 324 325 326 327 328 329 | 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 | | | | 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 -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 | #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 | | | 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 modalError -2 /* * Vars for filtering in "open file" and "save file" dialogs. */ typedef struct { |
︙ | ︙ | |||
371 372 373 374 375 376 377 | if ([NSApp macOSVersion] > 101400) { modalReturnCode = [panel runModal]; } else { modalReturnCode = [NSApp runModalForWindow:panel]; } } else { | | | 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 | # 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} \ | | | 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 -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 | .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 \ | | | | 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 \ -color red -font TkFixedFont .t.t tag configure sol12 -relief solid -borderwidth 12 \ -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 | namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands tk useinputmethods 0 testConstraint nodeprecated [expr {"nodeprecated" ni [tk::pkgconfig list]}] | < | 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 | 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 \ | | | 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 -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 | tcltest::loadTestedCommands test border-1.1 {Tk_AllocBorderFromObj - converting internal reps} -constraints { testborder } -body { set x orange lindex $x 0 | | | | | | | | | | | | | 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 -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 -background $x -text First destroy .b1 lappend result [testborder orange] 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 -background $x -text First lappend result [testborder orange] 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 -background $x -text First pack .b1 -side top lappend result [testborder purple] button .t.b -background $x -text Second pack .t.b -side top lappend result [testborder purple] 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 -background $x -text First pack .b1 -side top button .t.b -background $x -text Second pack .t.b -side top 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 | 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 | | | | | | | | | | | | 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 -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 | 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] | | | | | 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 -background $x -text .b1 set y [copy purple] .b configure -background $y set z [copy purple] .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 | button .t.quit -text Quit -command {destroy .t} pack .t.quit -side bottom -pady 2m set sepId 1 proc sep {} { global sepId | | | 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 -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 | 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 | | | | | 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 -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 | button .t.quit -text Quit -command {destroy .t} pack .t.quit -side bottom -pady 2m set sepId 1 proc sep {} { global sepId | | | | 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 -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 -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 | 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 | | | | | 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 -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 | package require tcltest 2.2 namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands imageInit 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 | > > | 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 | } -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 { | | | | | | | | | | | | | | 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 -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 -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 -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 -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 -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 -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 -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 -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 | } -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 { | | | | | | | | | | | | | | | | | | | | | | | | | | 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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 | } -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 { | | | | | | | | | | | | | | | | | | | | | | | | | | 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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 | } -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 { | | | | | | | | | | | | | | 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 -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 -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 -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 -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 -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 -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 -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 -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 | } -cleanup { destroy .b } -returnCodes {error} -result {unknown option "-gorp"} #ex 4.7 test button-3.6 {ButtonWidgetCmd procedure, "cget" option} -body { label .l | | | | 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 -disabledcolor } -cleanup { destroy .l } -returnCodes {ok} -match {glob} -result {*} test button-3.7 {ButtonWidgetCmd procedure, "cget" option} -body { button .b .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 | # 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 | | | | | | | | | 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} -constraints nodeprecated -body { checkbutton .c llength [.c configure] } -cleanup { destroy .c } -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 -background #ffffff -color } -cleanup { destroy .b } -returnCodes {error} -result {value for "-color" missing} test button-3.17 {ButtonWidgetCmd procedure, "configure" option} -setup { button .b } -body { .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 | test button-4.1 {DestroyButton procedure} -constraints { testImageType } -setup { image create test image1 unset -nocomplain x } -body { button .b1 -image image1 | | | | | | | | | 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 -color #ff0000 -text "Button 2" button .b3 -state active -text "Button 3" 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 -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 -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 | } -cleanup { destroy .b } -result {0 {}} test button-6.2 {ButtonEventProc procedure} -setup { set x {} } -body { | | | | 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 -background #543210 rename .b1 .b2 lappend x [winfo children .] 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 | test button-11.1 {ButtonImageProc procedure} -constraints { testImageType } -setup { label .l -highlightthickness 0 -font {Helvetica -12 bold} image create test image1 } -body { | | | 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 -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 | # 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 | | | 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 -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 | package require tcltest 2.2 namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands imageInit # canvas used in 1.* and 2.* test cases | | | 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 -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 | .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 | | | | 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 -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 -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 | 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 | | | 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 -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 | 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 | | | | | | | | | | | | 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 -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 {} -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 {} -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 -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 {} -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 {} -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 -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 -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 -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 {} -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 | 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 | | | | 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 -borderwidth 2 pack .t.mid -side top -expand yes -fill both -padx 2m -pady 2m 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 | 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] \ | | | 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 -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 | 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 | | | 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 -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 | package require tcltest 2.2 namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands # Canvas used in every test case of the whole file | | | 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 -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 | .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). | | | 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 -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 | 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 | | | 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 -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 | } -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 { | | | 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 -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 | end %%EOF } } -body { set font {Courier 12 italic} set ax [font measure $font 0] set ay [font metrics $font -linespace] | | | 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 -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 | } -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 | | | 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 -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 | } -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 | | | 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 -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 | eval tcltest::configure $argv tcltest::loadTestedCommands test canvWind-1.1 {DisplayWinItem, windows off-screen vertically} -setup { destroy .t } -body { toplevel .t | | | | 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 -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 -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 | 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 | | | | 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 -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 -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 | 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 | | | | 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 -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 -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 | 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 | | | | 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 -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 -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 | .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 { | | | | | | | | 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 -background #ff0000 .c cget -background } -result {#ff0000} test canvas-1.4 {configuration options: bad value for "bg"} -body { .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 -borderwidth 4 .c cget -borderwidth } -result 4 test canvas-1.6 {configuration options: bad value for "bd"} -body { .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 | .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 { | | | | | 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 -selectcolor #654321 .c cget -selectcolor } -result {#654321} test canvas-1.40 {configuration options: bad value for "selectforeground"} -body { .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 | 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 | | | 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} -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 | } -result {{0.0 0.5} {0.1 0.6}} destroy .c test canvas-4.1 {ButtonEventProc procedure} -setup { deleteWindows set x {} } -body { | | | | 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 -background #543210 rename .c1 .c2 lappend x [winfo children .] 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 | 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} { | | | | | | 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 -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 -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 -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 | # 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} | | | 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 -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 | destroy .t.c .t.c2 } test color-1.1 {Tk_AllocColorFromObj - converting internal reps} colorsFree { set x green lindex $x 0 destroy .b1 | | | | | | | | | | 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 -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 -color $x -text First destroy .b1 set result {} lappend result [testcolor green] 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 -color $x -text First set result {} lappend result [testcolor green] 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 -color $x -text First pack .b1 -side top set result {} lappend result [testcolor purple] button .t.b -color $x -text Second pack .t.b -side top lappend result [testcolor purple] 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 | 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 | | | | | | | | | | | | | | | | | | 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 -color $x -text First pack .b1 -side top button .t.b -color $x -text Second pack .t.b -side top 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 -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 -color $x -text .b1 set y [copy purple] .b configure -color $y set z [copy purple] .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 | 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 | | | | 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} -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} -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 | # 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 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 { | > | 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 | } -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 { | | | | | | | | 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 -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 -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 -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 -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 | } -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 { | | | | | 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 -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 -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 | } -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 { | | | | | 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 -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 -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 | } -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 { | | | | | 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 -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 -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 | } -body { .e configure -invalidcommand "any string" .e cget -invalidcommand } -cleanup { destroy .e } -result {any string} | | | 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} -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 | } -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 { | | | | | 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 -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 -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 | } -body { .e configure -placeholder {Some text} .e cget -placeholder } -cleanup { destroy .e } -result {Some text} | | | | | 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: "-placeholdercolor"} -setup { pack [entry .e] } -body { .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 | .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 { | | | | | | | | | 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 -borderwidth 4 .e cget -borderwidth } -cleanup { destroy .e } -result 4 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 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 -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 | } -result {62x37+0+0} test entry-5.9 {ConfigureEntry procedure} -constraints { fonts } -setup { entry .e -borderwidth 2 -highlightthickness 2 pack .e } -body { | | | | 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} -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} -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 | test entry-6.1 {EntryComputeGeometry procedure} -constraints { fonts } -setup { entry .e pack .e } -body { | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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} -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} -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} -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} -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} -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} -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} -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} -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} -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 -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 -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} -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 | unset x } -result {12345 12345} test entry-10.1 {EntrySetValue procedure} -constraints fonts -body { set x abcde set y ab | | | | | | | | | | | | | | | | | | | 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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -color #112233 rename .e1 .e2 lappend x [winfo children .] 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 -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 -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 -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 -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 -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 -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 | 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: | | | | | | | | | 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 -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 -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 -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 -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 -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 -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 -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 | 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 { | | | | | | | | | | | | 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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 | 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 \ | | | | | | | | | | | | | | | | | 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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 | 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 \ | | | 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 -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 | 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 \ | | | | | 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 -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 -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 -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 | 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 \ | | | 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 -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 | 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 \ | | | 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 \ -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 | 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} { | | | | 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 -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 -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 | tkwait variable x dobg {focus -force .; update} update } # Button used in some tests in the whole test file | | | 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 -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 | unix } -setup { destroy .t2 } -body { focusClear toplevel .t2 wm geom .t2 +10+10 | | | | 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 -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 | 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 | | | | 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 -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 -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 | } -body { setupbg toplevel .t wm geometry .t +0+0 frame .t.f1 -container 1 frame .t.f2 pack .t.f1 .t.f2 | | | | 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 -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 -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 | proc setup1 w { if {$w == "."} { set w "" } foreach i {a b c d} { destroy $w.$i | | | 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 -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 | 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 | | | 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 -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 | # 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", ...) | | | 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 -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 | set x [psfontname {{times new roman} 12 italic bold}] } -result {Times-BoldItalic} test font-22.1 {Tk_TextWidth procedure} -setup { destroy .t.l } -body { | | | 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 -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 | } -cleanup { destroy .t.t } -result {} # Data used in 24.* tests destroy .t.l | | | 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 -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 | # All rights reserved. package require tcltest 2.2 namespace import ::tcltest::* tcltest::configure {*}$argv tcltest::loadTestedCommands 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 | > | | 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 -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 | } -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 { | | | | | | | | | | 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 -borderwidth 4 lindex [.f configure -borderwidth] 4 } -cleanup { .f configure -borderwidth [lindex [.f configure -borderwidth] 3] } -result 4 test frame-1.16 {frame configuration options} -body { .f configure -borderwidth badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-1.17 {frame configuration options} -body { .f configure -background #00ff00 lindex [.f configure -background] 4 } -cleanup { .f configure -background [lindex [.f configure -background] 3] } -result "#00ff00" test frame-1.18 {frame configuration options} -body { .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 | .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 { | | | | | | | | 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 -borderwidth 4 lindex [.t configure -borderwidth] 4 } -result 4 test frame-2.23 {toplevel configuration options} -body { .t configure -borderwidth badValue } -returnCodes error -result {bad screen distance "badValue"} test frame-2.24 {toplevel configuration options} -body { .t configure -background #00ff00 lindex [.t configure -background] 4 } -result "#00ff00" test frame-2.25 {toplevel configuration options} -body { .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 | .t configure -class } -cleanup { deleteWindows } -result {-class class Class Toplevel Toplevel} test frame-3.4 {TkCreateFrame procedure} -setup { deleteWindows } -body { | | | 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 -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 | 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 | | | 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] -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 | wm geometry .t +0+0 if {[tk windowingsystem] eq "aqua"} { update idletasks } else { update } option add *x.use [winfo id .t] | | | 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 -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 | eatColors .t1 } test frame-3.11 {TkCreateFrame procedure} -constraints { defaultPseudocolor8 nonPortable } -setup { destroy .t } -body { | | | | | | | | | | | | | | 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 -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 -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 n |