summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2022-11-09 21:40:51 (GMT)
committerfvogel <fvogelnew1@free.fr>2022-11-09 21:40:51 (GMT)
commit16a63be615ba1ff0eddd22b777c041361eb7c0ef (patch)
treeeefd6674a199a676740186e5e0f4f12770f2b424
parent3dbd737f1811d01dcff8791b15a8cf9dd1bc8735 (diff)
parent104947147225fa0d71faf4e8769567377370fb6f (diff)
downloadtk-16a63be615ba1ff0eddd22b777c041361eb7c0ef.zip
tk-16a63be615ba1ff0eddd22b777c041361eb7c0ef.tar.gz
tk-16a63be615ba1ff0eddd22b777c041361eb7c0ef.tar.bz2
merge 8.6
-rw-r--r--.fossil-settings/ignore-glob3
-rw-r--r--.github/workflows/linux-build.yml8
-rw-r--r--.github/workflows/mac-build.yml8
-rw-r--r--.github/workflows/win-build.yml55
-rw-r--r--.gitignore8
-rw-r--r--changes3
-rw-r--r--compat/stdlib.h23
-rw-r--r--compat/unistd.h12
-rw-r--r--doc/canvas.n3
-rw-r--r--doc/keysyms.n505
-rw-r--r--doc/menubutton.n2
-rw-r--r--doc/messageBox.n5
-rw-r--r--doc/ttk_image.n5
-rw-r--r--generic/ks_names.h502
-rw-r--r--generic/tk.h6
-rw-r--r--generic/tkBind.c189
-rw-r--r--generic/tkBitmap.c4
-rw-r--r--generic/tkCanvImg.c10
-rw-r--r--generic/tkCanvText.c4
-rw-r--r--generic/tkCanvUtil.c4
-rw-r--r--generic/tkCanvas.c44
-rw-r--r--generic/tkEntry.c8
-rw-r--r--generic/tkEvent.c2
-rw-r--r--generic/tkFont.c2
-rw-r--r--generic/tkFrame.c2
-rw-r--r--generic/tkGrab.c2
-rw-r--r--generic/tkImgBmap.c62
-rw-r--r--generic/tkImgGIF.c12
-rw-r--r--generic/tkImgPhoto.c2
-rw-r--r--generic/tkInt.h6
-rw-r--r--generic/tkListbox.c5
-rw-r--r--generic/tkMenu.c1
-rw-r--r--generic/tkObj.c4
-rw-r--r--generic/tkPanedWindow.c2
-rw-r--r--generic/tkTest.c2
-rw-r--r--generic/tkText.c6
-rw-r--r--generic/tkText.h2
-rw-r--r--generic/tkTextBTree.c2
-rw-r--r--generic/tkTextDisp.c11
-rw-r--r--generic/tkWindow.c4
-rw-r--r--generic/ttk/ttkImage.c2
-rw-r--r--generic/ttk/ttkInit.c2
-rw-r--r--generic/ttk/ttkNotebook.c4
-rw-r--r--generic/ttk/ttkScroll.c4
-rw-r--r--generic/ttk/ttkTreeview.c4
-rw-r--r--generic/ttk/ttkWidget.c38
-rw-r--r--library/demos/cscroll.tcl2
-rw-r--r--library/demos/entry2.tcl6
-rw-r--r--library/demos/floor.tcl264
-rw-r--r--library/demos/goldberg.tcl6
-rw-r--r--library/demos/items.tcl2
-rw-r--r--library/demos/menu.tcl5
-rw-r--r--library/demos/menubu.tcl3
-rw-r--r--library/demos/puzzle.tcl2
-rw-r--r--library/menu.tcl32
-rw-r--r--library/msgs/eo.msg70
-rw-r--r--library/msgs/ru.msg24
-rw-r--r--library/tk.tcl9
-rw-r--r--library/ttk/menubutton.tcl13
-rw-r--r--library/ttk/panedwindow.tcl12
-rw-r--r--macosx/README2
-rw-r--r--macosx/tkMacOSXBitmap.c27
-rw-r--r--macosx/tkMacOSXColor.c54
-rw-r--r--macosx/tkMacOSXDialog.c115
-rw-r--r--macosx/tkMacOSXDraw.c78
-rw-r--r--macosx/tkMacOSXFileTypes.c122
-rw-r--r--macosx/tkMacOSXFileTypes.h144
-rw-r--r--macosx/tkMacOSXFont.c14
-rw-r--r--macosx/tkMacOSXInit.c37
-rw-r--r--macosx/tkMacOSXMenu.c100
-rw-r--r--macosx/tkMacOSXMouseEvent.c7
-rw-r--r--macosx/tkMacOSXNotify.c2
-rw-r--r--macosx/tkMacOSXPort.h8
-rw-r--r--macosx/tkMacOSXPrivate.h44
-rw-r--r--macosx/tkMacOSXSubwindows.c4
-rw-r--r--macosx/tkMacOSXTest.c28
-rw-r--r--macosx/tkMacOSXWindowEvent.c4
-rw-r--r--macosx/tkMacOSXWm.c87
-rw-r--r--macosx/tkMacOSXXStubs.c18
-rw-r--r--macosx/ttkMacOSXTheme.c8
-rw-r--r--tests/bind.test21
-rw-r--r--tests/canvImg.test2
-rw-r--r--tests/canvPs.test4
-rw-r--r--tests/constraints.tcl35
-rw-r--r--tests/entry.test72
-rw-r--r--tests/font.test35
-rw-r--r--tests/frame.test160
-rw-r--r--tests/imgBmap.test2
-rw-r--r--tests/menubut.test2
-rw-r--r--tests/option.test6
-rw-r--r--tests/panedwindow.test1390
-rw-r--r--tests/raise.test1
-rw-r--r--tests/spinbox.test70
-rw-r--r--tests/text.test30
-rw-r--r--tests/textDisp.test2415
-rw-r--r--tests/textImage.test18
-rw-r--r--tests/textIndex.test1
-rw-r--r--tests/textWind.test217
-rw-r--r--tests/ttk/notebook.test20
-rw-r--r--tests/ttk/treeview.test23
-rw-r--r--tests/ttk/ttk.test2
-rw-r--r--tests/unixEmbed.test442
-rw-r--r--tests/unixWm.test62
-rw-r--r--tests/winfo.test2
-rw-r--r--tests/wm.test14
-rw-r--r--unix/Makefile.in29
-rwxr-xr-xunix/configure3
-rw-r--r--unix/configure.in3
-rw-r--r--unix/tkUnixDialog.c2
-rw-r--r--unix/tkUnixPort.h6
-rw-r--r--win/Makefile.in2
-rwxr-xr-xwin/configure8
-rw-r--r--win/configure.in8
-rw-r--r--win/rules.vc4
-rw-r--r--win/tkWinDialog.c4
-rw-r--r--win/tkWinPort.h6
-rw-r--r--win/tkWinWm.c4
-rw-r--r--xlib/X11/HPkeysym.h2
-rwxr-xr-xxlib/X11/XF86keysym.h243
-rw-r--r--xlib/X11/Xfuncproto.h203
-rw-r--r--xlib/X11/Xutil.h324
-rw-r--r--xlib/X11/ap_keysym.h2
-rw-r--r--xlib/X11/cursorfont.h34
-rw-r--r--xlib/X11/keysym.h12
-rw-r--r--xlib/X11/keysymdef.h451
-rw-r--r--xlib/xgc.c5
126 files changed, 6089 insertions, 3259 deletions
diff --git a/.fossil-settings/ignore-glob b/.fossil-settings/ignore-glob
index 8100756..93e1db1 100644
--- a/.fossil-settings/ignore-glob
+++ b/.fossil-settings/ignore-glob
@@ -20,11 +20,12 @@
*/config.status
*/tkConfig.sh
*/wish*
-*/tktest*
+*/tktest
*/versions.vc
*/version.vc
*/libtk.vfs
*/libtk*.zip
+*/tkUuid.h
doc/man.macros
html
macosx/configure
diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml
index d0223a7..5559798 100644
--- a/.github/workflows/linux-build.yml
+++ b/.github/workflows/linux-build.yml
@@ -10,7 +10,7 @@ env:
ERROR_ON_FAILURES: 1
jobs:
build:
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
strategy:
matrix:
compiler:
@@ -26,11 +26,11 @@ jobs:
- "--disable-xss"
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
path: tk
- name: Checkout Tcl
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
repository: tcltk/tcl
ref: core-8-6-branch
@@ -116,7 +116,7 @@ jobs:
- "mem"
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
path: tk
- name: Setup Environment (compiler=${{ matrix.compiler }})
diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml
index f647d45..cf19261 100644
--- a/.github/workflows/mac-build.yml
+++ b/.github/workflows/mac-build.yml
@@ -13,11 +13,11 @@ jobs:
working-directory: tk/macosx
steps:
- name: Check out Tk
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
path: tk
- name: Check out Tcl
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
repository: tcltk/tcl
ref: core-8-6-branch
@@ -64,11 +64,11 @@ jobs:
working-directory: tk/unix
steps:
- name: Check out Tk
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
path: tk
- name: Check out Tcl
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
repository: tcltk/tcl
ref: core-8-6-branch
diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml
index 3076ac8..1da53b6 100644
--- a/.github/workflows/win-build.yml
+++ b/.github/workflows/win-build.yml
@@ -6,19 +6,24 @@ env:
ERROR_ON_FAILURES: 1
jobs:
msvc:
- runs-on: windows-2019
+ runs-on: windows-2022
defaults:
run:
shell: powershell
working-directory: tk/win
# Using powershell means we need to explicitly stop on failure
+ strategy:
+ matrix:
+ symbols:
+ - "none"
+ - "symbols"
steps:
- - name: Checkout
- uses: actions/checkout@v2
+ - name: Checkout Tk
+ uses: actions/checkout@v3
with:
path: tk
- - name: Checkout
- uses: actions/checkout@v2
+ - name: Checkout Tcl
+ uses: actions/checkout@v3
with:
repository: tcltk/tcl
ref: core-8-6-branch
@@ -33,32 +38,32 @@ jobs:
mkdir install
cd install
echo "INSTALLDIR=`pwd`" >> $GITHUB_ENV
- - name: Build Tcl
+ - name: Build Tcl (OPTS=${{ matrix.symbols }})
run: |
- &nmake -f makefile.vc release install
+ &nmake -f makefile.vc release install OPTS=${{ matrix.symbols }}
if ($lastexitcode -ne 0) {
throw "nmake exit code: $lastexitcode"
}
working-directory: tcl/win
- - name: Build
+ - name: Build Tk (OPTS=${{ matrix.symbols }})
run: |
- &nmake -f makefile.vc all
+ &nmake -f makefile.vc all OPTS=${{ matrix.symbols }}
if ($lastexitcode -ne 0) {
throw "nmake exit code: $lastexitcode"
}
- - name: Build Test Harness
+ - name: Build Test Harness (OPTS=${{ matrix.symbols }})
run: |
- &nmake -f makefile.vc tktest
+ &nmake -f makefile.vc tktest OPTS=${{ matrix.symbols }}
if ($lastexitcode -ne 0) {
throw "nmake exit code: $lastexitcode"
}
- - name: Run Tests
+ - name: Run Tk Tests (OPTS=${{ matrix.symbols }})
run: |
- nmake -f makefile.vc test-classic | tee out-classic.txt || {
+ nmake -f makefile.vc test-classic OPTS=${{ matrix.symbols }} | tee out-classic.txt || {
echo "::error::Failure during Test"
exit 1
}
- nmake -f makefile.vc test-ttk | tee out-ttk.txt || {
+ nmake -f makefile.vc test-ttk OPTS=${{ matrix.symbols }} | tee out-ttk.txt || {
echo "::error::Failure during Test"
exit 1
}
@@ -73,15 +78,15 @@ jobs:
env:
CI_BUILD_WITH_MSVC: 1
shell: bash
- - name: Build Help
+ - name: Build Help (OPTS=${{ matrix.symbols }})
run: |
- &nmake -f makefile.vc htmlhelp
+ &nmake -f makefile.vc htmlhelp OPTS=${{ matrix.symbols }}
if ($lastexitcode -ne 0) {
throw "nmake exit code: $lastexitcode"
}
- - name: Install
+ - name: Install (OPTS=${{ matrix.symbols }})
run: |
- &nmake -f makefile.vc install
+ &nmake -f makefile.vc install OPTS=${{ matrix.symbols }}
if ($lastexitcode -ne 0) {
throw "nmake exit code: $lastexitcode"
}
@@ -103,10 +108,10 @@ jobs:
with:
msystem: MINGW64
install: git mingw-w64-x86_64-toolchain make
- - name: Checkout
- uses: actions/checkout@v2
- - name: Checkout
- uses: actions/checkout@v2
+ - name: Checkout Tk
+ uses: actions/checkout@v3
+ - name: Checkout Tcl
+ uses: actions/checkout@v3
with:
repository: tcltk/tcl
ref: core-8-6-branch
@@ -133,7 +138,7 @@ jobs:
env:
CFGOPT: --enable-64bit --enable-symbols=${{ matrix.symbols }}
working-directory: tcl/win
- - name: Configure (symbols=${{ matrix.symbols }})
+ - name: Configure Tk (symbols=${{ matrix.symbols }})
run: |
./configure ${CFGOPT} "--prefix=$HOME/INSTALL_DIR" "--with-tcl=$TCL_CONFIG_PATH" || {
cat config.log
@@ -142,13 +147,13 @@ jobs:
}
env:
CFGOPT: --enable-64bit --enable-symbols=${{ matrix.symbols }}
- - name: Build
+ - name: Build Tk
run: |
make all tktest || {
echo "::error::Failure during Build"
exit 1
}
- - name: Run Tests
+ - name: Run Tk Tests
run: |
make test-classic | tee out-classic.txt
make test-ttk | tee out-ttk.txt
diff --git a/.gitignore b/.gitignore
index a49e849..719ef80 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,16 +21,18 @@ config.cache
config.log
config.status
config.status.lineno
+doc/man.macros
html
manifest.uuid
_FOSSIL_
*/tkConfig.sh
*/wish*
-*/tktest*
+*/tktest
*/versions.vc
*/version.vc
-*/libtcl.vfs
-*/libtcl_*.zip
+*/libtk.vfs
+*/libtk*.zip
+*/tkUuid.h
libtommath/bn.ilg
libtommath/bn.ind
libtommath/pretty.build
diff --git a/changes b/changes
index d25e2a9..64b984c 100644
--- a/changes
+++ b/changes
@@ -7903,3 +7903,6 @@ Tk Cocoa 2.0: More drawing internals refinements (culler,walzer)
2021-10-30 (bug)[6ea0b3] Mac: grab from menu makes dead window (culler)
- Released 8.6.12, Nov 5, 2021 - https://core.tcl-lang.org/tk/ for details
+
+2022-02-25 (bug) [f75190] tk_fontchooser: multiple font families, locale change,
+ button activation (holger,fogel)
diff --git a/compat/stdlib.h b/compat/stdlib.h
index 2c64890..2f7eaf4 100644
--- a/compat/stdlib.h
+++ b/compat/stdlib.h
@@ -3,9 +3,9 @@
*
* Declares facilities exported by the "stdlib" portion of the C library.
* This file isn't complete in the ANSI-C sense; it only declares things
- * that are needed by Tk. This file is needed even on many systems with
+ * that are needed by Tcl. This file is needed even on many systems with
* their own stdlib.h (e.g. SunOS) because not all stdlib.h files declare
- * all the procedures needed here (such as strtod).
+ * all the procedures needed here (such as strtol/strtoul).
*
* Copyright (c) 1991 The Regents of the University of California.
* Copyright (c) 1994-1998 Sun Microsystems, Inc.
@@ -17,23 +17,22 @@
#ifndef _STDLIB
#define _STDLIB
-#ifndef _TCL
-# include <tcl.h>
-#endif
-
extern void abort(void);
extern double atof(const char *string);
extern int atoi(const char *string);
extern long atol(const char *string);
-extern char * calloc(unsigned int numElements, unsigned int size);
+extern void * calloc(unsigned long numElements, unsigned long size);
extern void exit(int status);
-extern int free(char *blockPtr);
+extern void free(void *blockPtr);
extern char * getenv(const char *name);
-extern char * malloc(unsigned int numBytes);
-extern void qsort(void *base, int n, int size, int (*compar)(
+extern void * malloc(unsigned long numBytes);
+extern void qsort(void *base, unsigned long n, unsigned long size, int (*compar)(
const void *element1, const void *element2));
-extern char * realloc(char *ptr, unsigned int numBytes);
-extern double strtod(const char *string, char **endPtr);
+extern void * realloc(void *ptr, unsigned long numBytes);
+extern char * realpath(const char *path, char *resolved_path);
+extern int mkstemps(char *templ, int suffixlen);
+extern int mkstemp(char *templ);
+extern char * mkdtemp(char *templ);
extern long strtol(const char *string, char **endPtr, int base);
extern unsigned long strtoul(const char *string, char **endPtr, int base);
diff --git a/compat/unistd.h b/compat/unistd.h
index be966cc..1725590 100644
--- a/compat/unistd.h
+++ b/compat/unistd.h
@@ -15,12 +15,9 @@
#define _UNISTD
#include <sys/types.h>
-#ifndef _TCL
-# include <tcl.h>
-#endif
#ifndef NULL
-#define NULL 0
+# define NULL 0
#endif
/*
@@ -38,9 +35,9 @@ extern int dup2(int oldfd, int newfd);
extern int execl(const char *path, ...);
extern int execle(const char *path, ...);
extern int execlp(const char *file, ...);
-extern int execv(const char *path, char **argv);
-extern int execve(const char *path, char **argv, char **envp);
-extern int execvp(const char *file, char **argv);
+extern int execv(const char *path, char *const argv[]);
+extern int execve(const char *path, char *const argv[], char *const *envp);
+extern int execvp(const char *file, char *const argv[]);
extern pid_t fork(void);
extern char * getcwd(char *buf, size_t size);
extern gid_t getegid(void);
@@ -77,4 +74,3 @@ extern int vfork(void);
#endif /* _POSIX_SOURCE */
#endif /* _UNISTD */
-
diff --git a/doc/canvas.n b/doc/canvas.n
index ea27d6c..a64aebe 100644
--- a/doc/canvas.n
+++ b/doc/canvas.n
@@ -1218,7 +1218,8 @@ in the \fBCOORDINATES\fR section above.
\fB\-disabledfill \fIcolor\fR
.
Specifies the color to be used to fill item's area.
-in its normal, active, and disabled states,
+in its normal, active, and disabled states.
+The even-odd fill rule is used.
\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
For the line item, it specifies the color of the line drawn.
For the text item, it specifies the foreground color of the text.
diff --git a/doc/keysyms.n b/doc/keysyms.n
index 162fa90..6e7699b 100644
--- a/doc/keysyms.n
+++ b/doc/keysyms.n
@@ -818,11 +818,330 @@ hebrew_qoph 3319 0xCF7
hebrew_resh 3320 0xCF8
hebrew_shin 3321 0xCF9
hebrew_taw 3322 0xCFA
+.CE
+.CS
+Thai_kokai 3489 0xDA1
+Thai_khokhai 3490 0xDA2
+Thai_khokhuat 3491 0xDA3
+Thai_khokhwai 3492 0xDA4
+Thai_khokhon 3493 0xDA5
+Thai_khorakhang 3494 0xDA6
+Thai_ngongu 3495 0xDA7
+Thai_chochan 3496 0xDA8
+Thai_choching 3497 0xDA9
+Thai_chochang 3498 0xDAA
+Thai_soso 3499 0xDAB
+Thai_chochoe 3500 0xDAC
+Thai_yoying 3501 0xDAD
+Thai_dochada 3502 0xDAE
+Thai_topatak 3503 0xDAF
+Thai_thothan 3504 0xDB0
+Thai_thonangmontho 3505 0xDB1
+Thai_thophuthao 3506 0xDB2
+Thai_nonen 3507 0xDB3
+Thai_dodek 3508 0xDB4
+Thai_totao 3509 0xDB5
+Thai_thothung 3510 0xDB6
+Thai_thothahan 3511 0xDB7
+Thai_thothong 3512 0xDB8
+Thai_nonu 3513 0xDB9
+Thai_bobaimai 3514 0xDBA
+Thai_popla 3515 0xDBB
+Thai_phophung 3516 0xDBC
+Thai_fofa 3517 0xDBD
+Thai_phophan 3518 0xDBE
+Thai_fofan 3519 0xDBF
+Thai_phosamphao 3520 0xDC0
+Thai_moma 3521 0xDC1
+Thai_yoyak 3522 0xDC2
+Thai_rorua 3523 0xDC3
+Thai_ru 3524 0xDC4
+Thai_loling 3525 0xDC5
+Thai_lu 3526 0xDC6
+Thai_wowaen 3527 0xDC7
+Thai_sosala 3528 0xDC8
+Thai_sorusi 3529 0xDC9
+Thai_sosua 3530 0xDCA
+Thai_hohip 3531 0xDCB
+Thai_lochula 3532 0xDCC
+Thai_oang 3533 0xDCD
+Thai_honokhuk 3534 0xDCE
+Thai_paiyannoi 3535 0xDCF
+Thai_saraa 3536 0xDD0
+Thai_maihanakat 3537 0xDD1
+Thai_saraaa 3538 0xDD2
+Thai_saraam 3539 0xDD3
+Thai_sarai 3540 0xDD4
+Thai_saraii 3541 0xDD5
+Thai_saraue 3542 0xDD6
+Thai_sarauee 3543 0xDD7
+Thai_sarau 3544 0xDD8
+Thai_sarauu 3545 0xDD9
+Thai_phinthu 3546 0xDDA
+Thai_maihanakat_maitho 3550 0xDDE
+Thai_baht 3551 0xDDF
+Thai_sarae 3552 0xDE0
+Thai_saraae 3553 0xDE1
+Thai_sarao 3554 0xDE2
+Thai_saraaimaimuan 3555 0xDE3
+Thai_saraaimaimalai 3556 0xDE4
+Thai_lakkhangyao 3557 0xDE5
+Thai_maiyamok 3558 0xDE6
+Thai_maitaikhu 3559 0xDE7
+Thai_maiek 3560 0xDE8
+Thai_maitho 3561 0xDE9
+Thai_maitri 3562 0xDEA
+Thai_maichattawa 3563 0xDEB
+Thai_thanthakhat 3564 0xDEC
+Thai_nikhahit 3565 0xDED
+Thai_leksun 3568 0xDF0
+Thai_leknung 3569 0xDF1
+Thai_leksong 3570 0xDF2
+Thai_leksam 3571 0xDF3
+Thai_leksi 3572 0xDF4
+Thai_lekha 3573 0xDF5
+Thai_lekhok 3574 0xDF6
+Thai_lekchet 3575 0xDF7
+Thai_lekpaet 3576 0xDF8
+Thai_lekkao 3577 0xDF9
+Hangul_Kiyeog 3745 0xEA1
+Hangul_SsangKiyeog 3746 0xEA2
+Hangul_KiyeogSios 3747 0xEA3
+Hangul_Nieun 3748 0xEA4
+Hangul_NieunJieuj 3749 0xEA5
+Hangul_NieunHieuh 3750 0xEA6
+Hangul_Dikeud 3751 0xEA7
+Hangul_SsangDikeud 3752 0xEA8
+Hangul_Rieul 3753 0xEA9
+Hangul_RieulKiyeog 3754 0xEAA
+Hangul_RieulMieum 3755 0xEAB
+Hangul_RieulPieub 3756 0xEAC
+Hangul_RieulSios 3757 0xEAD
+Hangul_RieulTieut 3758 0xEAE
+Hangul_RieulPhieuf 3759 0xEAF
+Hangul_RieulHieuh 3760 0xEB0
+Hangul_Mieum 3761 0xEB1
+Hangul_Pieub 3762 0xEB2
+Hangul_SsangPieub 3763 0xEB3
+Hangul_PieubSios 3764 0xEB4
+Hangul_Sios 3765 0xEB5
+Hangul_SsangSios 3766 0xEB6
+Hangul_Ieung 3767 0xEB7
+Hangul_Jieuj 3768 0xEB8
+Hangul_SsangJieuj 3769 0xEB9
+Hangul_Cieuc 3770 0xEBA
+Hangul_Khieuq 3771 0xEBB
+Hangul_Tieut 3772 0xEBC
+Hangul_Phieuf 3773 0xEBD
+Hangul_Hieuh 3774 0xEBE
+Hangul_A 3775 0xEBF
+Hangul_AE 3776 0xEC0
+Hangul_YA 3777 0xEC1
+Hangul_YAE 3778 0xEC2
+Hangul_EO 3779 0xEC3
+Hangul_E 3780 0xEC4
+Hangul_YEO 3781 0xEC5
+Hangul_YE 3782 0xEC6
+Hangul_O 3783 0xEC7
+Hangul_WA 3784 0xEC8
+Hangul_WAE 3785 0xEC9
+Hangul_OE 3786 0xECA
+Hangul_YO 3787 0xECB
+Hangul_U 3788 0xECC
+Hangul_WEO 3789 0xECD
+Hangul_WE 3790 0xECE
+Hangul_WI 3791 0xECF
+Hangul_YU 3792 0xED0
+Hangul_EU 3793 0xED1
+Hangul_YI 3794 0xED2
+Hangul_I 3795 0xED3
+Hangul_J_Kiyeog 3796 0xED4
+Hangul_J_SsangKiyeog 3797 0xED5
+Hangul_J_KiyeogSios 3798 0xED6
+Hangul_J_Nieun 3799 0xED7
+Hangul_J_NieunJieuj 3800 0xED8
+Hangul_J_NieunHieuh 3801 0xED9
+Hangul_J_Dikeud 3802 0xEDA
+Hangul_J_Rieul 3803 0xEDB
+Hangul_J_RieulKiyeog 3804 0xEDC
+Hangul_J_RieulMieum 3805 0xEDD
+Hangul_J_RieulPieub 3806 0xEDE
+Hangul_J_RieulSios 3807 0xEDF
+Hangul_J_RieulTieut 3808 0xEE0
+Hangul_J_RieulPhieuf 3809 0xEE1
+Hangul_J_RieulHieuh 3810 0xEE2
+Hangul_J_Mieum 3811 0xEE3
+Hangul_J_Pieub 3812 0xEE4
+Hangul_J_PieubSios 3813 0xEE5
+Hangul_J_Sios 3814 0xEE6
+Hangul_J_SsangSios 3815 0xEE7
+Hangul_J_Ieung 3816 0xEE8
+Hangul_J_Jieuj 3817 0xEE9
+Hangul_J_Cieuc 3818 0xEEA
+Hangul_J_Khieuq 3819 0xEEB
+Hangul_J_Tieut 3820 0xEEC
+Hangul_J_Phieuf 3821 0xEED
+Hangul_J_Hieuh 3822 0xEEE
+Hangul_RieulYeorinHieuh 3823 0xEEF
+Hangul_SunkyeongeumMieum 3824 0xEF0
+Hangul_SunkyeongeumPieub 3825 0xEF1
+Hangul_PanSios 3826 0xEF2
+Hangul_KkogjiDalrinIeung 3827 0xEF3
+Hangul_SunkyeongeumPhieuf 3828 0xEF4
+Hangul_YeorinHieuh 3829 0xEF5
+Hangul_AraeA 3830 0xEF6
+Hangul_AraeAE 3831 0xEF7
+Hangul_J_PanSios 3832 0xEF8
+Hangul_J_KkogjiDalrinIeung 3833 0xEF9
+Hangul_J_YeorinHieuh 3834 0xEFA
+Korean_Won 3839 0xEFF
OE 5052 0x13BC
oe 5053 0x13BD
Ydiaeresis 5054 0x13BE
.CE
.CS
+ISO_Lock 65025 0xFE01
+ISO_Level2_Latch 65026 0xFE02
+ISO_Level3_Shift 65027 0xFE03
+ISO_Level3_Latch 65028 0xFE04
+ISO_Level3_Lock 65029 0xFE05
+ISO_Group_Latch 65030 0xFE06
+ISO_Group_Lock 65031 0xFE07
+ISO_Next_Group 65032 0xFE08
+ISO_Next_Group_Lock 65033 0xFE09
+ISO_Prev_Group 65034 0xFE0A
+ISO_Prev_Group_Lock 65035 0xFE0B
+ISO_First_Group 65036 0xFE0C
+ISO_First_Group_Lock 65037 0xFE0D
+ISO_Last_Group 65038 0xFE0E
+ISO_Last_Group_Lock 65039 0xFE0F
+ISO_Level5_Shift 65041 0xFE11
+ISO_Level5_Latch 65042 0xFE12
+ISO_Level5_Lock 65043 0xFE13
+ISO_Left_Tab 65056 0xFE20
+ISO_Move_Line_Up 65057 0xFE21
+ISO_Move_Line_Down 65058 0xFE22
+ISO_Partial_Line_Up 65059 0xFE23
+ISO_Partial_Line_Down 65060 0xFE24
+ISO_Partial_Space_Left 65061 0xFE25
+ISO_Partial_Space_Right 65062 0xFE26
+ISO_Set_Margin_Left 65063 0xFE27
+ISO_Set_Margin_Right 65064 0xFE28
+ISO_Release_Margin_Left 65065 0xFE29
+ISO_Release_Margin_Right 65066 0xFE2A
+ISO_Release_Both_Margins 65067 0xFE2B
+ISO_Fast_Cursor_Left 65068 0xFE2C
+ISO_Fast_Cursor_Right 65069 0xFE2D
+ISO_Fast_Cursor_Up 65070 0xFE2E
+ISO_Fast_Cursor_Down 65071 0xFE2F
+ISO_Continuous_Underline 65072 0xFE30
+ISO_Discontinuous_Underline 65073 0xFE31
+ISO_Emphasize 65074 0xFE32
+ISO_Center_Object 65075 0xFE33
+ISO_Enter 65076 0xFE34
+dead_grave 65104 0xFE50
+dead_acute 65105 0xFE51
+dead_circumflex 65106 0xFE52
+dead_tilde 65107 0xFE53
+dead_macron 65108 0xFE54
+dead_breve 65109 0xFE55
+dead_abovedot 65110 0xFE56
+dead_diaeresis 65111 0xFE57
+dead_abovering 65112 0xFE58
+dead_doubleacute 65113 0xFE59
+dead_caron 65114 0xFE5A
+dead_cedilla 65115 0xFE5B
+dead_ogonek 65116 0xFE5C
+dead_iota 65117 0xFE5D
+dead_voiced_sound 65118 0xFE5E
+dead_semivoiced_sound 65119 0xFE5F
+dead_belowdot 65120 0xFE60
+dead_hook 65121 0xFE61
+dead_horn 65122 0xFE62
+dead_stroke 65123 0xFE63
+dead_abovecomma 65124 0xFE64
+dead_abovereversedcomma 65125 0xFE65
+dead_doublegrave 65126 0xFE66
+dead_belowring 65127 0xFE67
+dead_belowmacron 65128 0xFE68
+dead_belowcircumflex 65129 0xFE69
+dead_belowtilde 65130 0xFE6A
+dead_belowbreve 65131 0xFE6B
+dead_belowdiaeresis 65132 0xFE6C
+dead_invertedbreve 65133 0xFE6D
+dead_belowcomma 65134 0xFE6E
+dead_currency 65135 0xFE6F
+AccessX_Enable 65136 0xFE70
+AccessX_Feedback_Enable 65137 0xFE71
+RepeatKeys_Enable 65138 0xFE72
+SlowKeys_Enable 65139 0xFE73
+BounceKeys_Enable 65140 0xFE74
+StickyKeys_Enable 65141 0xFE75
+MouseKeys_Enable 65142 0xFE76
+MouseKeys_Accel_Enable 65143 0xFE77
+Overlay1_Enable 65144 0xFE78
+Overlay2_Enable 65145 0xFE79
+AudibleBell_Enable 65146 0xFE7A
+dead_a 65152 0xFE80
+dead_A 65153 0xFE81
+dead_e 65154 0xFE82
+dead_E 65155 0xFE83
+dead_i 65156 0xFE84
+dead_I 65157 0xFE85
+dead_o 65158 0xFE86
+dead_O 65159 0xFE87
+dead_u 65160 0xFE88
+dead_U 65161 0xFE89
+dead_small_schwa 65162 0xFE8A
+dead_capital_schwa 65163 0xFE8B
+dead_greek 65164 0xFE8C
+dead_lowline 65168 0xFE90
+dead_aboveverticalline 65169 0xFE91
+dead_belowverticalline 65170 0xFE92
+dead_longsolidusoverlay 65171 0xFE93
+ch 65184 0xFEA0
+Ch 65185 0xFEA1
+CH 65186 0xFEA2
+c_h 65187 0xFEA3
+C_h 65188 0xFEA4
+C_H 65189 0xFEA5
+First_Virtual_Screen 65232 0xFED0
+Prev_Virtual_Screen 65233 0xFED1
+Next_Virtual_Screen 65234 0xFED2
+Last_Virtual_Screen 65236 0xFED4
+Terminate_Server 65237 0xFED5
+Pointer_Left 65248 0xFEE0
+Pointer_Right 65249 0xFEE1
+Pointer_Up 65250 0xFEE2
+Pointer_Down 65251 0xFEE3
+Pointer_UpLeft 65252 0xFEE4
+Pointer_UpRight 65253 0xFEE5
+Pointer_DownLeft 65254 0xFEE6
+Pointer_DownRight 65255 0xFEE7
+Pointer_Button_Dflt 65256 0xFEE8
+Pointer_Button1 65257 0xFEE9
+Pointer_Button2 65258 0xFEEA
+Pointer_Button3 65259 0xFEEB
+Pointer_Button4 65260 0xFEEC
+Pointer_Button5 65261 0xFEED
+Pointer_DblClick_Dflt 65262 0xFEEE
+Pointer_DblClick1 65263 0xFEEF
+Pointer_DblClick2 65264 0xFEF0
+Pointer_DblClick3 65265 0xFEF1
+Pointer_DblClick4 65266 0xFEF2
+Pointer_DblClick5 65267 0xFEF3
+Pointer_Drag_Dflt 65268 0xFEF4
+Pointer_Drag1 65269 0xFEF5
+Pointer_Drag2 65270 0xFEF6
+Pointer_Drag3 65271 0xFEF7
+Pointer_Drag4 65272 0xFEF8
+Pointer_EnableKeys 65273 0xFEF9
+Pointer_Accelerate 65274 0xFEFA
+Pointer_DfltBtnNext 65275 0xFEFB
+Pointer_DfltBtnPrev 65276 0xFEFC
+Pointer_Drag5 65277 0xFEFD
+.CE
+.CS
BackSpace 65288 0xFF08
Tab 65289 0xFF09
Linefeed 65290 0xFF0A
@@ -849,10 +1168,21 @@ Kana_Lock 65325 0xFF2D
Kana_Shift 65326 0xFF2E
Eisu_Shift 65327 0xFF2F
Eisu_toggle 65328 0xFF30
+Hangul 65329 0xFF31
+Hangul_Start 65330 0xFF32
+Hangul_End 65331 0xFF33
+Hangul_Hanja 65332 0xFF34
+Hangul_Jamo 65333 0xFF35
+Hangul_Romaja 65334 0xFF36
Codeinput 65335 0xFF37
+Hangul_Jeonja 65336 0xFF38
+Hangul_Banja 65337 0xFF39
+Hangul_PreHanja 65338 0xFF3A
+Hangul_PostHanja 65339 0xFF3B
SingleCandidate 65340 0xFF3C
MultipleCandidate 65341 0xFF3D
PreviousCandidate 65342 0xFF3E
+Hangul_Special 65343 0xFF3F
Home 65360 0xFF50
Left 65361 0xFF51
Up 65362 0xFF52
@@ -962,9 +1292,181 @@ Super_L 65515 0xFFEB
Super_R 65516 0xFFEC
Hyper_L 65517 0xFFED
Hyper_R 65518 0xFFEE
+braille_dot_1 65521 0xFFF1
+braille_dot_2 65522 0xFFF2
+braille_dot_3 65523 0xFFF3
+braille_dot_4 65524 0xFFF4
+braille_dot_5 65525 0xFFF5
+braille_dot_6 65526 0xFFF6
+braille_dot_7 65527 0xFFF7
+braille_dot_8 65528 0xFFF8
+braille_dot_9 65529 0xFFF9
+braille_dot_10 65530 0xFFFA
Delete 65535 0xFFFF
.CE
.CS
+SunFA_Grave 268828416 0x1005FF00
+SunFA_Circum 268828417 0x1005FF01
+SunFA_Tilde 268828418 0x1005FF02
+SunFA_Acute 268828419 0x1005FF03
+SunFA_Diaeresis 268828420 0x1005FF04
+SunFA_Cedilla 268828421 0x1005FF05
+SunF36 268828432 0x1005FF10
+SunF37 268828433 0x1005FF11
+SunSys_Req 268828512 0x1005FF60
+SunProps 268828528 0x1005FF70
+SunFront 268828529 0x1005FF71
+SunCopy 268828530 0x1005FF72
+SunOpen 268828531 0x1005FF73
+SunPaste 268828532 0x1005FF74
+SunCut 268828533 0x1005FF75
+SunPowerSwitch 268828534 0x1005FF76
+SunAudioLowerVolume 268828535 0x1005FF77
+SunAudioMute 268828536 0x1005FF78
+SunAudioRaiseVolume 268828537 0x1005FF79
+SunVideoDegauss 268828538 0x1005FF7A
+SunVideoLowerBrightness 268828539 0x1005FF7B
+SunVideoRaiseBrightness 268828540 0x1005FF7C
+SunPowerSwitchShift 268828541 0x1005FF7D
+XF86BrightnessAuto 268964084 0x100810F4
+XF86DisplayOff 268964085 0x100810F5
+XF86Info 268964198 0x10081166
+XF86AspectRatio 268964215 0x10081177
+XF86DVD 268964229 0x10081185
+XF86Audio 268964232 0x10081188
+XF86ChannelUp 268964242 0x10081192
+XF86ChannelDown 268964243 0x10081193
+XF86Break 268964251 0x1008119B
+XF86VideoPhone 268964256 0x100811A0
+XF86ZoomReset 268964260 0x100811A4
+XF86Editor 268964262 0x100811A6
+XF86GraphicsEditor 268964264 0x100811A8
+XF86Presentation 268964265 0x100811A9
+XF86Database 268964266 0x100811AA
+XF86Voicemail 268964268 0x100811AC
+XF86Addressbook 268964269 0x100811AD
+XF86DisplayToggle 268964271 0x100811AF
+XF86SpellCheck 268964272 0x100811B0
+XF86ContextMenu 268964278 0x100811B6
+XF86MediaRepeat 268964279 0x100811B7
+XF8610ChannelsUp 268964280 0x100811B8
+XF8610ChannelsDown 268964281 0x100811B9
+XF86Images 268964282 0x100811BA
+XF86NotificationCenter 268964284 0x100811BC
+XF86PickupPhone 268964285 0x100811BD
+XF86HangupPhone 268964286 0x100811BE
+XF86Fn 268964304 0x100811D0
+XF86Fn_Esc 268964305 0x100811D1
+XF86FnRightShift 268964325 0x100811E5
+XF86Numeric0 268964352 0x10081200
+XF86Numeric1 268964353 0x10081201
+XF86Numeric2 268964354 0x10081202
+XF86Numeric3 268964355 0x10081203
+XF86Numeric4 268964356 0x10081204
+XF86Numeric5 268964357 0x10081205
+XF86Numeric6 268964358 0x10081206
+XF86Numeric7 268964359 0x10081207
+XF86Numeric8 268964360 0x10081208
+XF86Numeric9 268964361 0x10081209
+XF86NumericStar 268964362 0x1008120A
+XF86NumericPound 268964363 0x1008120B
+XF86NumericA 268964364 0x1008120C
+XF86NumericB 268964365 0x1008120D
+XF86NumericC 268964366 0x1008120E
+XF86NumericD 268964367 0x1008120F
+XF86CameraFocus 268964368 0x10081210
+XF86WPSButton 268964369 0x10081211
+XF86CameraZoomIn 268964373 0x10081215
+XF86CameraZoomOut 268964374 0x10081216
+XF86CameraUp 268964375 0x10081217
+XF86CameraDown 268964376 0x10081218
+XF86CameraLeft 268964377 0x10081219
+XF86CameraRight 268964378 0x1008121A
+XF86AttendantOn 268964379 0x1008121B
+XF86AttendantOff 268964380 0x1008121C
+XF86AttendantToggle 268964381 0x1008121D
+XF86LightsToggle 268964382 0x1008121E
+XF86ALSToggle 268964400 0x10081230
+XF86Buttonconfig 268964416 0x10081240
+XF86Taskmanager 268964417 0x10081241
+XF86Journal 268964418 0x10081242
+XF86ControlPanel 268964419 0x10081243
+XF86AppSelect 268964420 0x10081244
+XF86Screensaver 268964421 0x10081245
+XF86VoiceCommand 268964422 0x10081246
+XF86Assistant 268964423 0x10081247
+XF86EmojiPicker 268964425 0x10081249
+XF86Dictate 268964426 0x1008124A
+XF86BrightnessMin 268964432 0x10081250
+XF86BrightnessMax 268964433 0x10081251
+XF86KbdInputAssistPrev 268964448 0x10081260
+XF86KbdInputAssistNext 268964449 0x10081261
+XF86KbdInputAssistPrevgroup 268964450 0x10081262
+XF86KbdInputAssistNextgroup 268964451 0x10081263
+XF86KbdInputAssistAccept 268964452 0x10081264
+XF86KbdInputAssistCancel 268964453 0x10081265
+XF86RightUp 268964454 0x10081266
+XF86RightDown 268964455 0x10081267
+XF86LeftUp 268964456 0x10081268
+XF86LeftDown 268964457 0x10081269
+XF86RootMenu 268964458 0x1008126A
+XF86MediaTopMenu 268964459 0x1008126B
+XF86Numeric11 268964460 0x1008126C
+XF86Numeric12 268964461 0x1008126D
+XF86AudioDesc 268964462 0x1008126E
+XF863DMode 268964463 0x1008126F
+XF86NextFavorite 268964464 0x10081270
+XF86StopRecord 268964465 0x10081271
+XF86PauseRecord 268964466 0x10081272
+XF86VOD 268964467 0x10081273
+XF86Unmute 268964468 0x10081274
+XF86FastReverse 268964469 0x10081275
+XF86SlowReverse 268964470 0x10081276
+XF86Data 268964471 0x10081277
+XF86OnScreenKeyboard 268964472 0x10081278
+XF86PrivacyScreenToggle 268964473 0x10081279
+XF86SelectiveScreenshot 268964474 0x1008127A
+XF86Macro1 268964496 0x10081290
+XF86Macro2 268964497 0x10081291
+XF86Macro3 268964498 0x10081292
+XF86Macro4 268964499 0x10081293
+XF86Macro5 268964500 0x10081294
+XF86Macro6 268964501 0x10081295
+XF86Macro7 268964502 0x10081296
+XF86Macro8 268964503 0x10081297
+XF86Macro9 268964504 0x10081298
+XF86Macro10 268964505 0x10081299
+XF86Macro11 268964506 0x1008129A
+XF86Macro12 268964507 0x1008129B
+XF86Macro13 268964508 0x1008129C
+XF86Macro14 268964509 0x1008129D
+XF86Macro15 268964510 0x1008129E
+XF86Macro16 268964511 0x1008129F
+XF86Macro17 268964512 0x100812A0
+XF86Macro18 268964513 0x100812A1
+XF86Macro19 268964514 0x100812A2
+XF86Macro20 268964515 0x100812A3
+XF86Macro21 268964516 0x100812A4
+XF86Macro22 268964517 0x100812A5
+XF86Macro23 268964518 0x100812A6
+XF86Macro24 268964519 0x100812A7
+XF86Macro25 268964520 0x100812A8
+XF86Macro26 268964521 0x100812A9
+XF86Macro27 268964522 0x100812AA
+XF86Macro28 268964523 0x100812AB
+XF86Macro29 268964524 0x100812AC
+XF86Macro30 268964525 0x100812AD
+XF86MacroRecordStart 268964528 0x100812B0
+XF86MacroRecordStop 268964529 0x100812B1
+XF86MacroPresetCycle 268964530 0x100812B2
+XF86MacroPreset1 268964531 0x100812B3
+XF86MacroPreset2 268964532 0x100812B4
+XF86MacroPreset3 268964533 0x100812B5
+XF86KbdLcdMenu1 268964536 0x100812B8
+XF86KbdLcdMenu2 268964537 0x100812B9
+XF86KbdLcdMenu3 268964538 0x100812BA
+XF86KbdLcdMenu4 268964539 0x100812BB
+XF86KbdLcdMenu5 268964540 0x100812BC
XF86Switch_VT_1 269024769 0x1008FE01
XF86Switch_VT_2 269024770 0x1008FE02
XF86Switch_VT_3 269024771 0x1008FE03
@@ -977,6 +1479,8 @@ XF86Switch_VT_9 269024777 0x1008FE09
XF86Switch_VT_10 269024778 0x1008FE0A
XF86Switch_VT_11 269024779 0x1008FE0B
XF86Switch_VT_12 269024780 0x1008FE0C
+.CE
+.CS
XF86Ungrab 269024800 0x1008FE20
XF86ClearGrab 269024801 0x1008FE21
XF86Next_VMode 269024802 0x1008FE22
@@ -1148,6 +1652,7 @@ XF86WWAN 269025204 0x1008FFB4
XF86RFKill 269025205 0x1008FFB5
XF86AudioPreset 269025206 0x1008FFB6
XF86RotationLockToggle 269025207 0x1008FFB7
+XF86FullScreen 269025208 0x1008FFB8
.CE
.SH "SEE ALSO"
bind(n), event(n)
diff --git a/doc/menubutton.n b/doc/menubutton.n
index 1f596ce..5696794 100644
--- a/doc/menubutton.n
+++ b/doc/menubutton.n
@@ -24,7 +24,7 @@ menubutton \- Create and manipulate 'menubutton' pop-up menu indicator widgets
\-compound \-justify \-wraplength
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
-.OP \-direction direction Height
+.OP \-direction direction Direction
Specifies where the menu is going to be popup up. \fBabove\fR tries to
pop the menu above the menubutton. \fBbelow\fR tries to pop the menu
below the menubutton. \fBleft\fR tries to pop the menu to the left of
diff --git a/doc/messageBox.n b/doc/messageBox.n
index 6bcbc09..4350b22 100644
--- a/doc/messageBox.n
+++ b/doc/messageBox.n
@@ -66,9 +66,8 @@ box is displayed on top of its parent window.
.TP
\fB\-title\fR \fItitleString\fR
.
-Specifies a string to display as the title of the message box. This option
-is ignored on Mac OS X, where platform guidelines forbid the use of a title
-on this kind of dialog.
+Specifies a string to display as the title of the message box. The
+default value is an empty string.
.TP
\fB\-type\fR \fIpredefinedType\fR
.
diff --git a/doc/ttk_image.n b/doc/ttk_image.n
index bc1dd3f..34dbabb 100644
--- a/doc/ttk_image.n
+++ b/doc/ttk_image.n
@@ -79,13 +79,16 @@ The \fB\-border\fR divides the image into 9 regions:
four fixed corners, top and left edges (which may be tiled horizontally),
left and right edges (which may be tiled vertically),
and the central area (which may be tiled in both directions).
+.PP
+An image element that is not meant to claim any space (for example when used
+as a background image) should use \fB\-width 0\fR and \fB\-height 0\fR.
.SH "EXAMPLE"
.PP
.CS
set img1 [image create photo \-file button.png]
set img2 [image create photo \-file button-pressed.png]
set img3 [image create photo \-file button-active.png]
-style element create Button.button image \e
+ttk::style element create Button.button image \e
[list $img1 pressed $img2 active $img3] \e
\-border {2 4} \-sticky we
.CE
diff --git a/generic/ks_names.h b/generic/ks_names.h
index 8d3702d..729436b 100644
--- a/generic/ks_names.h
+++ b/generic/ks_names.h
@@ -38,10 +38,21 @@
{ "Kana_Shift", 0xFF2E },
{ "Eisu_Shift", 0xFF2F },
{ "Eisu_toggle", 0xFF30 },
+{ "Hangul", 0xFF31 },
+{ "Hangul_Start", 0xFF32 },
+{ "Hangul_End", 0xFF33 },
+{ "Hangul_Hanja", 0xFF34 },
+{ "Hangul_Jamo", 0xFF35 },
+{ "Hangul_Romaja", 0xFF36 },
{ "Codeinput", 0xFF37 },
+{ "Hangul_Jeonja", 0xFF38 },
+{ "Hangul_Banja", 0xFF39 },
+{ "Hangul_PreHanja", 0xFF3A },
+{ "Hangul_PostHanja", 0xFF3B },
{ "SingleCandidate", 0xFF3C },
{ "MultipleCandidate", 0xFF3D },
{ "PreviousCandidate", 0xFF3E },
+{ "Hangul_Special", 0xFF3F },
{ "Home", 0xFF50 },
{ "Left", 0xFF51 },
{ "Up", 0xFF52 },
@@ -185,7 +196,160 @@
{ "Super_R", 0xFFEC },
{ "Hyper_L", 0xFFED },
{ "Hyper_R", 0xFFEE },
+{ "braille_dot_1", 0xFFF1 },
+{ "braille_dot_2", 0xFFF2 },
+{ "braille_dot_3", 0xFFF3 },
+{ "braille_dot_4", 0xFFF4 },
+{ "braille_dot_5", 0xFFF5 },
+{ "braille_dot_6", 0xFFF6 },
+{ "braille_dot_7", 0xFFF7 },
+{ "braille_dot_8", 0xFFF8 },
+{ "braille_dot_9", 0xFFF9 },
+{ "braille_dot_10", 0xFFFA },
{ "Delete", 0xFFFF },
+{ "ISO_Lock", 0xFE01 },
+{ "ISO_Level2_Latch", 0xFE02 },
+{ "ISO_Level3_Shift", 0xFE03 },
+{ "ISO_Level3_Latch", 0xFE04 },
+{ "ISO_Level3_Lock", 0xFE05 },
+{ "ISO_Group_Latch", 0xFE06 },
+{ "ISO_Group_Lock", 0xFE07 },
+{ "ISO_Next_Group", 0xFE08 },
+{ "ISO_Next_Group_Lock", 0xFE09 },
+{ "ISO_Prev_Group", 0xFE0A },
+{ "ISO_Prev_Group_Lock", 0xFE0B },
+{ "ISO_First_Group", 0xFE0C },
+{ "ISO_First_Group_Lock", 0xFE0D },
+{ "ISO_Last_Group", 0xFE0E },
+{ "ISO_Last_Group_Lock", 0xFE0F },
+{ "ISO_Level5_Shift", 0xFE11 },
+{ "ISO_Level5_Latch", 0xFE12 },
+{ "ISO_Level5_Lock", 0xFE13 },
+{ "ISO_Left_Tab", 0xFE20 },
+{ "ISO_Move_Line_Up", 0xFE21 },
+{ "ISO_Move_Line_Down", 0xFE22 },
+{ "ISO_Partial_Line_Up", 0xFE23 },
+{ "ISO_Partial_Line_Down", 0xFE24 },
+{ "ISO_Partial_Space_Left", 0xFE25 },
+{ "ISO_Partial_Space_Right", 0xFE26 },
+{ "ISO_Set_Margin_Left", 0xFE27 },
+{ "ISO_Set_Margin_Right", 0xFE28 },
+{ "ISO_Release_Margin_Left", 0xFE29 },
+{ "ISO_Release_Margin_Right", 0xFE2A },
+{ "ISO_Release_Both_Margins", 0xFE2B },
+{ "ISO_Fast_Cursor_Left", 0xFE2C },
+{ "ISO_Fast_Cursor_Right", 0xFE2D },
+{ "ISO_Fast_Cursor_Up", 0xFE2E },
+{ "ISO_Fast_Cursor_Down", 0xFE2F },
+{ "ISO_Continuous_Underline", 0xFE30 },
+{ "ISO_Discontinuous_Underline", 0xFE31 },
+{ "ISO_Emphasize", 0xFE32 },
+{ "ISO_Center_Object", 0xFE33 },
+{ "ISO_Enter", 0xFE34 },
+{ "dead_grave", 0xFE50 },
+{ "dead_acute", 0xFE51 },
+{ "dead_circumflex", 0xFE52 },
+{ "dead_tilde", 0xFE53 },
+{ "dead_perispomeni", 0xFE53 },
+{ "dead_macron", 0xFE54 },
+{ "dead_breve", 0xFE55 },
+{ "dead_abovedot", 0xFE56 },
+{ "dead_diaeresis", 0xFE57 },
+{ "dead_abovering", 0xFE58 },
+{ "dead_doubleacute", 0xFE59 },
+{ "dead_caron", 0xFE5A },
+{ "dead_cedilla", 0xFE5B },
+{ "dead_ogonek", 0xFE5C },
+{ "dead_iota", 0xFE5D },
+{ "dead_voiced_sound", 0xFE5E },
+{ "dead_semivoiced_sound", 0xFE5F },
+{ "dead_belowdot", 0xFE60 },
+{ "dead_hook", 0xFE61 },
+{ "dead_horn", 0xFE62 },
+{ "dead_stroke", 0xFE63 },
+{ "dead_abovecomma", 0xFE64 },
+{ "dead_psili", 0xFE64 },
+{ "dead_abovereversedcomma", 0xFE65 },
+{ "dead_dasia", 0xFE65 },
+{ "dead_doublegrave", 0xFE66 },
+{ "dead_belowring", 0xFE67 },
+{ "dead_belowmacron", 0xFE68 },
+{ "dead_belowcircumflex", 0xFE69 },
+{ "dead_belowtilde", 0xFE6A },
+{ "dead_belowbreve", 0xFE6B },
+{ "dead_belowdiaeresis", 0xFE6C },
+{ "dead_invertedbreve", 0xFE6D },
+{ "dead_belowcomma", 0xFE6E },
+{ "dead_currency", 0xFE6F },
+{ "AccessX_Enable", 0xFE70 },
+{ "AccessX_Feedback_Enable", 0xFE71 },
+{ "RepeatKeys_Enable", 0xFE72 },
+{ "SlowKeys_Enable", 0xFE73 },
+{ "BounceKeys_Enable", 0xFE74 },
+{ "StickyKeys_Enable", 0xFE75 },
+{ "MouseKeys_Enable", 0xFE76 },
+{ "MouseKeys_Accel_Enable", 0xFE77 },
+{ "Overlay1_Enable", 0xFE78 },
+{ "Overlay2_Enable", 0xFE79 },
+{ "AudibleBell_Enable", 0xFE7A },
+{ "dead_a", 0xFE80 },
+{ "dead_A", 0xFE81 },
+{ "dead_e", 0xFE82 },
+{ "dead_E", 0xFE83 },
+{ "dead_i", 0xFE84 },
+{ "dead_I", 0xFE85 },
+{ "dead_o", 0xFE86 },
+{ "dead_O", 0xFE87 },
+{ "dead_u", 0xFE88 },
+{ "dead_U", 0xFE89 },
+{ "dead_small_schwa", 0xFE8A },
+{ "dead_capital_schwa", 0xFE8B },
+{ "dead_greek", 0xFE8C },
+{ "dead_lowline", 0xFE90 },
+{ "dead_aboveverticalline", 0xFE91 },
+{ "dead_belowverticalline", 0xFE92 },
+{ "dead_longsolidusoverlay", 0xFE93 },
+{ "ch", 0xFEA0 },
+{ "Ch", 0xFEA1 },
+{ "CH", 0xFEA2 },
+{ "c_h", 0xFEA3 },
+{ "C_h", 0xFEA4 },
+{ "C_H", 0xFEA5 },
+{ "First_Virtual_Screen", 0xFED0 },
+{ "Prev_Virtual_Screen", 0xFED1 },
+{ "Next_Virtual_Screen", 0xFED2 },
+{ "Last_Virtual_Screen", 0xFED4 },
+{ "Terminate_Server", 0xFED5 },
+{ "Pointer_Left", 0xFEE0 },
+{ "Pointer_Right", 0xFEE1 },
+{ "Pointer_Up", 0xFEE2 },
+{ "Pointer_Down", 0xFEE3 },
+{ "Pointer_UpLeft", 0xFEE4 },
+{ "Pointer_UpRight", 0xFEE5 },
+{ "Pointer_DownLeft", 0xFEE6 },
+{ "Pointer_DownRight", 0xFEE7 },
+{ "Pointer_Button_Dflt", 0xFEE8 },
+{ "Pointer_Button1", 0xFEE9 },
+{ "Pointer_Button2", 0xFEEA },
+{ "Pointer_Button3", 0xFEEB },
+{ "Pointer_Button4", 0xFEEC },
+{ "Pointer_Button5", 0xFEED },
+{ "Pointer_DblClick_Dflt", 0xFEEE },
+{ "Pointer_DblClick1", 0xFEEF },
+{ "Pointer_DblClick2", 0xFEF0 },
+{ "Pointer_DblClick3", 0xFEF1 },
+{ "Pointer_DblClick4", 0xFEF2 },
+{ "Pointer_DblClick5", 0xFEF3 },
+{ "Pointer_Drag_Dflt", 0xFEF4 },
+{ "Pointer_Drag1", 0xFEF5 },
+{ "Pointer_Drag2", 0xFEF6 },
+{ "Pointer_Drag3", 0xFEF7 },
+{ "Pointer_Drag4", 0xFEF8 },
+{ "Pointer_EnableKeys", 0xFEF9 },
+{ "Pointer_Accelerate", 0xFEFA },
+{ "Pointer_DfltBtnNext", 0xFEFB },
+{ "Pointer_DfltBtnPrev", 0xFEFC },
+{ "Pointer_Drag5", 0xFEFD },
{ "space", 0x20 },
{ "exclam", 0x21 },
{ "quotedbl", 0x22 },
@@ -1019,6 +1183,181 @@
{ "hebrew_shin", 0xCF9 },
{ "hebrew_taw", 0xCFA },
{ "hebrew_taf", 0xCFA },
+{ "Thai_kokai", 0xDA1 },
+{ "Thai_khokhai", 0xDA2 },
+{ "Thai_khokhuat", 0xDA3 },
+{ "Thai_khokhwai", 0xDA4 },
+{ "Thai_khokhon", 0xDA5 },
+{ "Thai_khorakhang", 0xDA6 },
+{ "Thai_ngongu", 0xDA7 },
+{ "Thai_chochan", 0xDA8 },
+{ "Thai_choching", 0xDA9 },
+{ "Thai_chochang", 0xDAA },
+{ "Thai_soso", 0xDAB },
+{ "Thai_chochoe", 0xDAC },
+{ "Thai_yoying", 0xDAD },
+{ "Thai_dochada", 0xDAE },
+{ "Thai_topatak", 0xDAF },
+{ "Thai_thothan", 0xDB0 },
+{ "Thai_thonangmontho", 0xDB1 },
+{ "Thai_thophuthao", 0xDB2 },
+{ "Thai_nonen", 0xDB3 },
+{ "Thai_dodek", 0xDB4 },
+{ "Thai_totao", 0xDB5 },
+{ "Thai_thothung", 0xDB6 },
+{ "Thai_thothahan", 0xDB7 },
+{ "Thai_thothong", 0xDB8 },
+{ "Thai_nonu", 0xDB9 },
+{ "Thai_bobaimai", 0xDBA },
+{ "Thai_popla", 0xDBB },
+{ "Thai_phophung", 0xDBC },
+{ "Thai_fofa", 0xDBD },
+{ "Thai_phophan", 0xDBE },
+{ "Thai_fofan", 0xDBF },
+{ "Thai_phosamphao", 0xDC0 },
+{ "Thai_moma", 0xDC1 },
+{ "Thai_yoyak", 0xDC2 },
+{ "Thai_rorua", 0xDC3 },
+{ "Thai_ru", 0xDC4 },
+{ "Thai_loling", 0xDC5 },
+{ "Thai_lu", 0xDC6 },
+{ "Thai_wowaen", 0xDC7 },
+{ "Thai_sosala", 0xDC8 },
+{ "Thai_sorusi", 0xDC9 },
+{ "Thai_sosua", 0xDCA },
+{ "Thai_hohip", 0xDCB },
+{ "Thai_lochula", 0xDCC },
+{ "Thai_oang", 0xDCD },
+{ "Thai_honokhuk", 0xDCE },
+{ "Thai_paiyannoi", 0xDCF },
+{ "Thai_saraa", 0xDD0 },
+{ "Thai_maihanakat", 0xDD1 },
+{ "Thai_saraaa", 0xDD2 },
+{ "Thai_saraam", 0xDD3 },
+{ "Thai_sarai", 0xDD4 },
+{ "Thai_saraii", 0xDD5 },
+{ "Thai_saraue", 0xDD6 },
+{ "Thai_sarauee", 0xDD7 },
+{ "Thai_sarau", 0xDD8 },
+{ "Thai_sarauu", 0xDD9 },
+{ "Thai_phinthu", 0xDDA },
+{ "Thai_maihanakat_maitho", 0xDDE },
+{ "Thai_baht", 0xDDF },
+{ "Thai_sarae", 0xDE0 },
+{ "Thai_saraae", 0xDE1 },
+{ "Thai_sarao", 0xDE2 },
+{ "Thai_saraaimaimuan", 0xDE3 },
+{ "Thai_saraaimaimalai", 0xDE4 },
+{ "Thai_lakkhangyao", 0xDE5 },
+{ "Thai_maiyamok", 0xDE6 },
+{ "Thai_maitaikhu", 0xDE7 },
+{ "Thai_maiek", 0xDE8 },
+{ "Thai_maitho", 0xDE9 },
+{ "Thai_maitri", 0xDEA },
+{ "Thai_maichattawa", 0xDEB },
+{ "Thai_thanthakhat", 0xDEC },
+{ "Thai_nikhahit", 0xDED },
+{ "Thai_leksun", 0xDF0 },
+{ "Thai_leknung", 0xDF1 },
+{ "Thai_leksong", 0xDF2 },
+{ "Thai_leksam", 0xDF3 },
+{ "Thai_leksi", 0xDF4 },
+{ "Thai_lekha", 0xDF5 },
+{ "Thai_lekhok", 0xDF6 },
+{ "Thai_lekchet", 0xDF7 },
+{ "Thai_lekpaet", 0xDF8 },
+{ "Thai_lekkao", 0xDF9 },
+{ "Hangul_Kiyeog", 0xEA1 },
+{ "Hangul_SsangKiyeog", 0xEA2 },
+{ "Hangul_KiyeogSios", 0xEA3 },
+{ "Hangul_Nieun", 0xEA4 },
+{ "Hangul_NieunJieuj", 0xEA5 },
+{ "Hangul_NieunHieuh", 0xEA6 },
+{ "Hangul_Dikeud", 0xEA7 },
+{ "Hangul_SsangDikeud", 0xEA8 },
+{ "Hangul_Rieul", 0xEA9 },
+{ "Hangul_RieulKiyeog", 0xEAA },
+{ "Hangul_RieulMieum", 0xEAB },
+{ "Hangul_RieulPieub", 0xEAC },
+{ "Hangul_RieulSios", 0xEAD },
+{ "Hangul_RieulTieut", 0xEAE },
+{ "Hangul_RieulPhieuf", 0xEAF },
+{ "Hangul_RieulHieuh", 0xEB0 },
+{ "Hangul_Mieum", 0xEB1 },
+{ "Hangul_Pieub", 0xEB2 },
+{ "Hangul_SsangPieub", 0xEB3 },
+{ "Hangul_PieubSios", 0xEB4 },
+{ "Hangul_Sios", 0xEB5 },
+{ "Hangul_SsangSios", 0xEB6 },
+{ "Hangul_Ieung", 0xEB7 },
+{ "Hangul_Jieuj", 0xEB8 },
+{ "Hangul_SsangJieuj", 0xEB9 },
+{ "Hangul_Cieuc", 0xEBA },
+{ "Hangul_Khieuq", 0xEBB },
+{ "Hangul_Tieut", 0xEBC },
+{ "Hangul_Phieuf", 0xEBD },
+{ "Hangul_Hieuh", 0xEBE },
+{ "Hangul_A", 0xEBF },
+{ "Hangul_AE", 0xEC0 },
+{ "Hangul_YA", 0xEC1 },
+{ "Hangul_YAE", 0xEC2 },
+{ "Hangul_EO", 0xEC3 },
+{ "Hangul_E", 0xEC4 },
+{ "Hangul_YEO", 0xEC5 },
+{ "Hangul_YE", 0xEC6 },
+{ "Hangul_O", 0xEC7 },
+{ "Hangul_WA", 0xEC8 },
+{ "Hangul_WAE", 0xEC9 },
+{ "Hangul_OE", 0xECA },
+{ "Hangul_YO", 0xECB },
+{ "Hangul_U", 0xECC },
+{ "Hangul_WEO", 0xECD },
+{ "Hangul_WE", 0xECE },
+{ "Hangul_WI", 0xECF },
+{ "Hangul_YU", 0xED0 },
+{ "Hangul_EU", 0xED1 },
+{ "Hangul_YI", 0xED2 },
+{ "Hangul_I", 0xED3 },
+{ "Hangul_J_Kiyeog", 0xED4 },
+{ "Hangul_J_SsangKiyeog", 0xED5 },
+{ "Hangul_J_KiyeogSios", 0xED6 },
+{ "Hangul_J_Nieun", 0xED7 },
+{ "Hangul_J_NieunJieuj", 0xED8 },
+{ "Hangul_J_NieunHieuh", 0xED9 },
+{ "Hangul_J_Dikeud", 0xEDA },
+{ "Hangul_J_Rieul", 0xEDB },
+{ "Hangul_J_RieulKiyeog", 0xEDC },
+{ "Hangul_J_RieulMieum", 0xEDD },
+{ "Hangul_J_RieulPieub", 0xEDE },
+{ "Hangul_J_RieulSios", 0xEDF },
+{ "Hangul_J_RieulTieut", 0xEE0 },
+{ "Hangul_J_RieulPhieuf", 0xEE1 },
+{ "Hangul_J_RieulHieuh", 0xEE2 },
+{ "Hangul_J_Mieum", 0xEE3 },
+{ "Hangul_J_Pieub", 0xEE4 },
+{ "Hangul_J_PieubSios", 0xEE5 },
+{ "Hangul_J_Sios", 0xEE6 },
+{ "Hangul_J_SsangSios", 0xEE7 },
+{ "Hangul_J_Ieung", 0xEE8 },
+{ "Hangul_J_Jieuj", 0xEE9 },
+{ "Hangul_J_Cieuc", 0xEEA },
+{ "Hangul_J_Khieuq", 0xEEB },
+{ "Hangul_J_Tieut", 0xEEC },
+{ "Hangul_J_Phieuf", 0xEED },
+{ "Hangul_J_Hieuh", 0xEEE },
+{ "Hangul_RieulYeorinHieuh", 0xEEF },
+{ "Hangul_SunkyeongeumMieum", 0xEF0 },
+{ "Hangul_SunkyeongeumPieub", 0xEF1 },
+{ "Hangul_PanSios", 0xEF2 },
+{ "Hangul_KkogjiDalrinIeung", 0xEF3 },
+{ "Hangul_SunkyeongeumPhieuf", 0xEF4 },
+{ "Hangul_YeorinHieuh", 0xEF5 },
+{ "Hangul_AraeA", 0xEF6 },
+{ "Hangul_AraeAE", 0xEF7 },
+{ "Hangul_J_PanSios", 0xEF8 },
+{ "Hangul_J_KkogjiDalrinIeung", 0xEF9 },
+{ "Hangul_J_YeorinHieuh", 0xEFA },
+{ "Korean_Won", 0xEFF },
{ "XF86ModeLock", 0x1008FF01 },
{ "XF86MonBrightnessUp", 0x1008FF02 },
{ "XF86MonBrightnessDown", 0x1008FF03 },
@@ -1184,6 +1523,7 @@
{ "XF86RFKill", 0x1008FFB5 },
{ "XF86AudioPreset", 0x1008FFB6 },
{ "XF86RotationLockToggle", 0x1008FFB7 },
+{ "XF86FullScreen", 0x1008FFB8 },
{ "XF86Switch_VT_1", 0x1008FE01 },
{ "XF86Switch_VT_2", 0x1008FE02 },
{ "XF86Switch_VT_3", 0x1008FE03 },
@@ -1202,3 +1542,165 @@
{ "XF86Prev_VMode", 0x1008FE23 },
{ "XF86LogWindowTree", 0x1008FE24 },
{ "XF86LogGrabInfo", 0x1008FE25 },
+{ "XF86BrightnessAuto", 0x100810F4 },
+{ "XF86DisplayOff", 0x100810F5 },
+{ "XF86Info", 0x10081166 },
+{ "XF86AspectRatio", 0x10081177 },
+{ "XF86DVD", 0x10081185 },
+{ "XF86Audio", 0x10081188 },
+{ "XF86ChannelUp", 0x10081192 },
+{ "XF86ChannelDown", 0x10081193 },
+{ "XF86Break", 0x1008119B },
+{ "XF86VideoPhone", 0x100811A0 },
+{ "XF86ZoomReset", 0x100811A4 },
+{ "XF86Editor", 0x100811A6 },
+{ "XF86GraphicsEditor", 0x100811A8 },
+{ "XF86Presentation", 0x100811A9 },
+{ "XF86Database", 0x100811AA },
+{ "XF86Voicemail", 0x100811AC },
+{ "XF86Addressbook", 0x100811AD },
+{ "XF86DisplayToggle", 0x100811AF },
+{ "XF86SpellCheck", 0x100811B0 },
+{ "XF86ContextMenu", 0x100811B6 },
+{ "XF86MediaRepeat", 0x100811B7 },
+{ "XF8610ChannelsUp", 0x100811B8 },
+{ "XF8610ChannelsDown", 0x100811B9 },
+{ "XF86Images", 0x100811BA },
+{ "XF86NotificationCenter", 0x100811BC },
+{ "XF86PickupPhone", 0x100811BD },
+{ "XF86HangupPhone", 0x100811BE },
+{ "XF86Fn", 0x100811D0 },
+{ "XF86Fn_Esc", 0x100811D1 },
+{ "XF86FnRightShift", 0x100811E5 },
+{ "XF86Numeric0", 0x10081200 },
+{ "XF86Numeric1", 0x10081201 },
+{ "XF86Numeric2", 0x10081202 },
+{ "XF86Numeric3", 0x10081203 },
+{ "XF86Numeric4", 0x10081204 },
+{ "XF86Numeric5", 0x10081205 },
+{ "XF86Numeric6", 0x10081206 },
+{ "XF86Numeric7", 0x10081207 },
+{ "XF86Numeric8", 0x10081208 },
+{ "XF86Numeric9", 0x10081209 },
+{ "XF86NumericStar", 0x1008120A },
+{ "XF86NumericPound", 0x1008120B },
+{ "XF86NumericA", 0x1008120C },
+{ "XF86NumericB", 0x1008120D },
+{ "XF86NumericC", 0x1008120E },
+{ "XF86NumericD", 0x1008120F },
+{ "XF86CameraFocus", 0x10081210 },
+{ "XF86WPSButton", 0x10081211 },
+{ "XF86CameraZoomIn", 0x10081215 },
+{ "XF86CameraZoomOut", 0x10081216 },
+{ "XF86CameraUp", 0x10081217 },
+{ "XF86CameraDown", 0x10081218 },
+{ "XF86CameraLeft", 0x10081219 },
+{ "XF86CameraRight", 0x1008121A },
+{ "XF86AttendantOn", 0x1008121B },
+{ "XF86AttendantOff", 0x1008121C },
+{ "XF86AttendantToggle", 0x1008121D },
+{ "XF86LightsToggle", 0x1008121E },
+{ "XF86ALSToggle", 0x10081230 },
+{ "XF86Buttonconfig", 0x10081240 },
+{ "XF86Taskmanager", 0x10081241 },
+{ "XF86Journal", 0x10081242 },
+{ "XF86ControlPanel", 0x10081243 },
+{ "XF86AppSelect", 0x10081244 },
+{ "XF86Screensaver", 0x10081245 },
+{ "XF86VoiceCommand", 0x10081246 },
+{ "XF86Assistant", 0x10081247 },
+{ "XF86EmojiPicker", 0x10081249 },
+{ "XF86Dictate", 0x1008124A },
+{ "XF86BrightnessMin", 0x10081250 },
+{ "XF86BrightnessMax", 0x10081251 },
+{ "XF86KbdInputAssistPrev", 0x10081260 },
+{ "XF86KbdInputAssistNext", 0x10081261 },
+{ "XF86KbdInputAssistPrevgroup", 0x10081262 },
+{ "XF86KbdInputAssistNextgroup", 0x10081263 },
+{ "XF86KbdInputAssistAccept", 0x10081264 },
+{ "XF86KbdInputAssistCancel", 0x10081265 },
+{ "XF86RightUp", 0x10081266 },
+{ "XF86RightDown", 0x10081267 },
+{ "XF86LeftUp", 0x10081268 },
+{ "XF86LeftDown", 0x10081269 },
+{ "XF86RootMenu", 0x1008126A },
+{ "XF86MediaTopMenu", 0x1008126B },
+{ "XF86Numeric11", 0x1008126C },
+{ "XF86Numeric12", 0x1008126D },
+{ "XF86AudioDesc", 0x1008126E },
+{ "XF863DMode", 0x1008126F },
+{ "XF86NextFavorite", 0x10081270 },
+{ "XF86StopRecord", 0x10081271 },
+{ "XF86PauseRecord", 0x10081272 },
+{ "XF86VOD", 0x10081273 },
+{ "XF86Unmute", 0x10081274 },
+{ "XF86FastReverse", 0x10081275 },
+{ "XF86SlowReverse", 0x10081276 },
+{ "XF86Data", 0x10081277 },
+{ "XF86OnScreenKeyboard", 0x10081278 },
+{ "XF86PrivacyScreenToggle", 0x10081279 },
+{ "XF86SelectiveScreenshot", 0x1008127A },
+{ "XF86Macro1", 0x10081290 },
+{ "XF86Macro2", 0x10081291 },
+{ "XF86Macro3", 0x10081292 },
+{ "XF86Macro4", 0x10081293 },
+{ "XF86Macro5", 0x10081294 },
+{ "XF86Macro6", 0x10081295 },
+{ "XF86Macro7", 0x10081296 },
+{ "XF86Macro8", 0x10081297 },
+{ "XF86Macro9", 0x10081298 },
+{ "XF86Macro10", 0x10081299 },
+{ "XF86Macro11", 0x1008129A },
+{ "XF86Macro12", 0x1008129B },
+{ "XF86Macro13", 0x1008129C },
+{ "XF86Macro14", 0x1008129D },
+{ "XF86Macro15", 0x1008129E },
+{ "XF86Macro16", 0x1008129F },
+{ "XF86Macro17", 0x100812A0 },
+{ "XF86Macro18", 0x100812A1 },
+{ "XF86Macro19", 0x100812A2 },
+{ "XF86Macro20", 0x100812A3 },
+{ "XF86Macro21", 0x100812A4 },
+{ "XF86Macro22", 0x100812A5 },
+{ "XF86Macro23", 0x100812A6 },
+{ "XF86Macro24", 0x100812A7 },
+{ "XF86Macro25", 0x100812A8 },
+{ "XF86Macro26", 0x100812A9 },
+{ "XF86Macro27", 0x100812AA },
+{ "XF86Macro28", 0x100812AB },
+{ "XF86Macro29", 0x100812AC },
+{ "XF86Macro30", 0x100812AD },
+{ "XF86MacroRecordStart", 0x100812B0 },
+{ "XF86MacroRecordStop", 0x100812B1 },
+{ "XF86MacroPresetCycle", 0x100812B2 },
+{ "XF86MacroPreset1", 0x100812B3 },
+{ "XF86MacroPreset2", 0x100812B4 },
+{ "XF86MacroPreset3", 0x100812B5 },
+{ "XF86KbdLcdMenu1", 0x100812B8 },
+{ "XF86KbdLcdMenu2", 0x100812B9 },
+{ "XF86KbdLcdMenu3", 0x100812BA },
+{ "XF86KbdLcdMenu4", 0x100812BB },
+{ "XF86KbdLcdMenu5", 0x100812BC },
+{ "SunFA_Grave", 0x1005FF00 },
+{ "SunFA_Circum", 0x1005FF01 },
+{ "SunFA_Tilde", 0x1005FF02 },
+{ "SunFA_Acute", 0x1005FF03 },
+{ "SunFA_Diaeresis", 0x1005FF04 },
+{ "SunFA_Cedilla", 0x1005FF05 },
+{ "SunF36", 0x1005FF10 },
+{ "SunF37", 0x1005FF11 },
+{ "SunSys_Req", 0x1005FF60 },
+{ "SunProps", 0x1005FF70 },
+{ "SunFront", 0x1005FF71 },
+{ "SunCopy", 0x1005FF72 },
+{ "SunOpen", 0x1005FF73 },
+{ "SunPaste", 0x1005FF74 },
+{ "SunCut", 0x1005FF75 },
+{ "SunPowerSwitch", 0x1005FF76 },
+{ "SunAudioLowerVolume", 0x1005FF77 },
+{ "SunAudioMute", 0x1005FF78 },
+{ "SunAudioRaiseVolume", 0x1005FF79 },
+{ "SunVideoDegauss", 0x1005FF7A },
+{ "SunVideoLowerBrightness", 0x1005FF7B },
+{ "SunVideoRaiseBrightness", 0x1005FF7C },
+{ "SunPowerSwitchShift", 0x1005FF7D },
diff --git a/generic/tk.h b/generic/tk.h
index d3c2466..b95758e 100644
--- a/generic/tk.h
+++ b/generic/tk.h
@@ -1012,12 +1012,12 @@ typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas,
Tk_Item *itemPtr, int argc, char **argv);
#else
typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item *itemPtr, int argc, Tcl_Obj *const objv[]);
+ Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]);
typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item *itemPtr, int argc, Tcl_Obj *const objv[],
+ Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[],
int flags);
typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item *itemPtr, int argc, Tcl_Obj *const argv[]);
+ Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]);
#endif /* USE_OLD_CANVAS */
typedef void (Tk_ItemDeleteProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
Display *display);
diff --git a/generic/tkBind.c b/generic/tkBind.c
index e8db70b..830e429 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -143,7 +143,7 @@ struct PatSeq; /* forward declaration */
TK_ARRAY_DEFINE(PSModMaskArr, unsigned);
typedef struct PSEntry {
- TK_DLIST_LINKS(PSEntry); /* Makes this struct a double linked list; must be first entry. */
+ TK_DLIST_LINKS(PSEntry); /* Makes this struct a doubly linked list; must be first entry. */
Window window; /* Window of last match. */
struct PatSeq* psPtr; /* Pointer to pattern sequence. */
PSModMaskArr *lastModMaskArr;
@@ -188,7 +188,7 @@ typedef struct {
* in the canvas).
*/
-/* defining the whole Promotion_* stuff (array of PSList entries) */
+/* Defining the whole PromArr_* stuff (array of PSList entries) */
TK_ARRAY_DEFINE(PromArr, PSList);
typedef struct Tk_BindingTable_ {
@@ -419,7 +419,7 @@ typedef struct {
* DOUBLE - Non-zero means duplicate this event, e.g. for double-clicks.
* TRIPLE - Non-zero means triplicate this event, e.g. for triple-clicks.
* QUADRUPLE - Non-zero means quadruple this event, e.g. for 4-fold-clicks.
- * MULT_CLICKS - Combination of all of above.
+ * MULT_CLICKS - Combination of all the above.
*/
#define DOUBLE (1<<0)
@@ -556,7 +556,7 @@ static int eventArrayIndex[TK_LASTEVENT];
/*
* These structs agree with xkey for the fields type, serial, send_event, display,
- * window, root, subwindow, time, x, y, x_root, and y_root. So when accessing
+ * window, root, subwindow, time, x, y, x_root, and y_root. So when accessing
* these fields we may pretend that we are using a struct xkey.
*/
@@ -741,8 +741,8 @@ void TkpDumpPSList(const PSList *psList);
/*
* Some useful helper functions.
*/
-#ifdef SUPPORT_DEBUGGING
-static int BindCount = 0;
+#if SUPPORT_DEBUGGING
+static int BindCount = 0; /* Can be set or queried from Tcl through 'event debug' subcommand. Otherwise not used. */
#endif
static unsigned Max(unsigned a, unsigned b) { return a < b ? b : a; }
@@ -754,8 +754,8 @@ static int TestNearbyCoords(int lhs, int rhs) { return Abs(lhs - rhs) <= NEARBY_
static int
IsSubsetOf(
- unsigned lhsMask, /* this is a subset */
- unsigned rhsMask) /* of this bit field? */
+ unsigned lhsMask, /* Is this a subset... */
+ unsigned rhsMask) /* ...of this bit field? */
{
return (lhsMask & rhsMask) == lhsMask;
}
@@ -858,8 +858,8 @@ IsButtonEventType(
static int
MatchEventNearby(
- const XEvent *lhs, /* previous button event */
- const XEvent *rhs) /* current button event */
+ const XEvent *lhs, /* Previous button event */
+ const XEvent *rhs) /* Current button event */
{
assert(lhs);
assert(rhs);
@@ -875,8 +875,8 @@ MatchEventNearby(
static int
MatchEventRepeat(
- const XKeyEvent *lhs, /* previous key event */
- const XKeyEvent *rhs) /* current key event */
+ const XKeyEvent *lhs, /* Previous key event */
+ const XKeyEvent *rhs) /* Current key event */
{
assert(lhs);
assert(rhs);
@@ -1101,7 +1101,7 @@ GetLookupForEvent(
assert(lookupTables);
assert(eventPtr);
- /* otherwise on some systems the key contains uninitialized bytes */
+ /* Otherwise on some systems the key contains uninitialized bytes. */
memset(&key, 0, sizeof(PatternTableKey));
if (onlyConsiderDetailedEvents) {
@@ -1232,7 +1232,7 @@ ClearPromotionLists(
*/
/*
- * Windoze compiler does not allow the definition of these static variables inside a function,
+ * Windows compiler does not allow the definition of these static variables inside a function,
* otherwise this should belong to function TkBindInit().
*/
TCL_DECLARE_MUTEX(bindMutex);
@@ -1246,37 +1246,37 @@ TkBindInit(
assert(mainPtr);
- /* otherwise virtual events can't be supported */
+ /* Otherwise virtual events can't be supported. */
assert(sizeof(XEvent) >= sizeof(XVirtualEvent));
- /* type of TkPattern.info is well defined? */
+ /* Is type of TkPattern.info well defined? */
assert(sizeof(Info) >= sizeof(KeySym));
assert(sizeof(Info) >= sizeof(unsigned));
- /* ensure that our matching algorithm is working (when testing detail) */
+ /* Ensure that our matching algorithm is working (when testing detail). */
assert(sizeof(Detail) == sizeof(Tk_Uid));
- /* test expected indices of Button1..Button5, otherwise our button handling is not working */
+ /* Test expected indices of Button1..Button5, otherwise our button handling is not working. */
assert(Button1 == 1 && Button2 == 2 && Button3 == 3 && Button4 == 4 && Button5 == 5);
assert(Button2Mask == (Button1Mask << 1));
assert(Button3Mask == (Button1Mask << 2));
assert(Button4Mask == (Button1Mask << 3));
assert(Button5Mask == (Button1Mask << 4));
- /* test expected values of button motion masks, otherwise our button handling is not working */
+ /* Test expected values of button motion masks, otherwise our button handling is not working. */
assert(Button1MotionMask == Button1Mask);
assert(Button2MotionMask == Button2Mask);
assert(Button3MotionMask == Button3Mask);
assert(Button4MotionMask == Button4Mask);
assert(Button5MotionMask == Button5Mask);
- /* because we expect zero if keySym is empty */
+ /* Because we expect zero if keySym is empty. */
assert(NoSymbol == 0L);
- /* this must be a union, not a struct, otherwise comparison with NULL will not work */
+ /* This must be a union, not a struct, otherwise comparison with NULL will not work. */
assert(Tk_Offset(Detail, name) == Tk_Offset(Detail, info));
- /* we use some constraints about X*Event */
+ /* We use some constraints about X*Event. */
assert(Tk_Offset(XButtonEvent, time) == Tk_Offset(XMotionEvent, time));
assert(Tk_Offset(XButtonEvent, x_root) == Tk_Offset(XMotionEvent, x_root));
assert(Tk_Offset(XButtonEvent, y_root) == Tk_Offset(XMotionEvent, y_root));
@@ -2242,14 +2242,14 @@ Tk_BindEvent(
bindInfoPtr->lastCurrentTime = CurrentTimeInMilliSecs();
bindInfoPtr->lastEventTime = eventPtr->xkey.time;
}
- /* modifier keys should not influence button events */
+ /* Modifier keys should not influence button events. */
for (i = 0; i < (unsigned) dispPtr->numModKeyCodes; ++i) {
if (dispPtr->modKeyCodes[i] == eventPtr->xkey.keycode) {
reset = 0;
}
}
if (reset) {
- /* reset repetition count for button events */
+ /* Reset repetition count for button events. */
bindPtr->eventInfo[ButtonPress].countAny = 0;
bindPtr->eventInfo[ButtonPress].countDetailed = 0;
bindPtr->eventInfo[ButtonRelease].countAny = 0;
@@ -2259,7 +2259,7 @@ Tk_BindEvent(
}
case ButtonPress:
case ButtonRelease:
- /* reset repetition count for key events */
+ /* Reset repetition count for key events. */
bindPtr->eventInfo[KeyPress].countAny = 0;
bindPtr->eventInfo[KeyPress].countDetailed = 0;
bindPtr->eventInfo[KeyRelease].countAny = 0;
@@ -2363,7 +2363,7 @@ Tk_BindEvent(
Tcl_DStringInit(&scripts);
if ((size_t) numObjects > SIZE_OF_ARRAY(matchPtrBuf)) {
- /* it's unrealistic that the buffer size is too small, but who knows? */
+ /* It's unrealistic that the buffer size is too small, but who knows? */
matchPtrArr = (PatSeq **)ckalloc(numObjects*sizeof(matchPtrArr[0]));
}
memset(matchPtrArr, 0, numObjects*sizeof(matchPtrArr[0]));
@@ -2385,11 +2385,11 @@ Tk_BindEvent(
psPtr[0] = MatchPatterns(dispPtr, bindPtr, psl[0], psl[1], i, curEvent, objArr[k], NULL);
if (IsBetterMatch(matchPtrArr[k], psPtr[0])) {
- /* we will process it later, because we still may find a pattern with better match */
+ /* We will process it later, because we still may find a pattern with better match. */
matchPtrArr[k] = psPtr[0];
}
if (!PSList_IsEmpty(psl[1])) {
- /* we have promoted sequences, adjust array size */
+ /* We have promoted sequences, adjust array size. */
arraySize = Max(i + 1, arraySize);
}
}
@@ -2414,7 +2414,7 @@ Tk_BindEvent(
psPtr[1] = MatchPatterns(dispPtr, bindPtr, psl[1], psSuccList, 0, curEvent, objArr[k], NULL);
if (!PSList_IsEmpty(psSuccList)) {
- /* we have promoted sequences, adjust array size */
+ /* We have promoted sequences, adjust array size. */
arraySize = Max(1u, arraySize);
}
@@ -2467,7 +2467,7 @@ Tk_BindEvent(
if (matchPtrArr[k]) {
ExpandPercents(winPtr, matchPtrArr[k]->script, curEvent, scriptCount++, &scripts);
- /* nul is added to the scripts string to separate the various scripts */
+ /* Null is added to the scripts string to separate the various scripts. */
Tcl_DStringAppend(&scripts, "", 1);
}
}
@@ -2532,7 +2532,7 @@ Tk_BindEvent(
}
if (!PSList_IsEmpty(psList)) {
- /* we still have promoted sequences, adjust array size */
+ /* We still have promoted sequences, adjust array size. */
newArraySize = Max(i + 1, newArraySize);
}
}
@@ -2544,7 +2544,7 @@ Tk_BindEvent(
}
if (Tcl_DStringLength(&scripts) == 0) {
- return; /* nothing to do */
+ return; /* Nothing to do. */
}
/*
@@ -2675,12 +2675,12 @@ VirtPatIsBound(
if (physPatPtr->info || !virtPatPtr->info) {
if (IsSubsetOf(virtPatPtr->modMask, physPatPtr->modMask)) {
- return 0; /* we cannot surpass this match */
+ return 0; /* We cannot surpass this match. */
}
}
}
- /* otherwise on some systems the key contains uninitialized bytes */
+ /* Otherwise on some systems the key contains uninitialized bytes. */
memset(&key, 0, sizeof(key));
key.object = object;
@@ -2706,7 +2706,7 @@ VirtPatIsBound(
static int
Compare(
const PatSeq *fstMatchPtr,
- const PatSeq *sndMatchPtr) /* most recent match */
+ const PatSeq *sndMatchPtr) /* Most recent match. */
{
int diff;
@@ -2762,6 +2762,20 @@ CompareModMasks(
return fstCount - sndCount;
}
+/* helper function */
+static int
+IsPSInPSList(
+ const PatSeq *psPtr, /* Is this pattern sequence... */
+ const PSList *psList) /* ...an element of this list of patterns sequence? */
+{
+ PSEntry *psEntry;
+
+ TK_DLIST_FOREACH(psEntry, psList) {
+ if (psEntry->psPtr == psPtr) { return 1; }
+ }
+ return 0;
+}
+
static PatSeq *
MatchPatterns(
TkDisplay *dispPtr, /* Display from which the event came. */
@@ -2831,7 +2845,7 @@ MatchPatterns(
: VirtPatIsBound(bindPtr, psPtr, object, physPtrPtr)) {
TkPattern *patPtr = psPtr->pats + patIndex;
- /* ignore modifier key events, and KeyRelease events if the current event
+ /* Ignore modifier key events, and KeyRelease events if the current event
* is of a different type (e.g. a Button event)
*/
psEntry->keepIt = isModKeyOnly || \
@@ -2850,8 +2864,8 @@ MatchPatterns(
unsigned modMask = ResolveModifiers(dispPtr, patPtr->modMask);
unsigned curModMask = ResolveModifiers(dispPtr, bindPtr->curModMask);
- psEntry->expired = 1; /* remove it from promotion list */
- psEntry->keepIt = 0; /* don't keep matching patterns */
+ psEntry->expired = 1; /* Remove it from promotion list. */
+ psEntry->keepIt = 0; /* Don't keep matching patterns. */
if (IsSubsetOf(modMask, curModMask)) {
unsigned count = patPtr->info ? curEvent->countDetailed : curEvent->countAny;
@@ -2867,7 +2881,7 @@ MatchPatterns(
if (psPtr->numPats == patIndex + 1) {
if (patPtr->count <= count) {
/*
- * This is also a final pattern.
+ * This is also a final pattern (i.e. the pattern sequence is complete).
* We always prefer the pattern with better match.
* If completely equal than prefer most recently defined pattern.
*/
@@ -2889,31 +2903,41 @@ MatchPatterns(
}
} else {
DEBUG(psEntry->expired = 0;)
- psEntry->keepIt = 1; /* don't remove it from promotion list */
+ psEntry->keepIt = 1; /* Don't remove it from promotion list. */
}
} else if (psSuccList) {
/*
- * Not a final pattern, but matching, so promote it to next level.
+ * Not a final pattern, but matching (i.e. successive patterns match the pattern sequence so far),
+ * so promote the pattern sequence to next level if not already promoted in the success list.
* But do not promote if count of current pattern is not yet reached.
*/
- if (patPtr->count == psEntry->count) {
- PSEntry *psNewEntry;
-
- assert(!patPtr->name);
- psNewEntry = MakeListEntry(
- &bindPtr->lookupTables.entryPool, psPtr, psPtr->modMaskUsed);
- if (!PSModMaskArr_IsEmpty(psNewEntry->lastModMaskArr)) {
- PSModMaskArr_Set(psNewEntry->lastModMaskArr, patIndex, &modMask);
+ if (!IsPSInPSList(psPtr, psSuccList)) {
+ if (patPtr->count == psEntry->count) {
+ PSEntry *psNewEntry;
+
+ assert(!patPtr->name);
+ psNewEntry = MakeListEntry(
+ &bindPtr->lookupTables.entryPool, psPtr, psPtr->modMaskUsed);
+ if (!PSModMaskArr_IsEmpty(psNewEntry->lastModMaskArr)) {
+ PSModMaskArr_Set(psNewEntry->lastModMaskArr, patIndex, &modMask);
+ }
+ assert(psNewEntry->keepIt);
+ assert(psNewEntry->count == 1u);
+ PSList_Append(psSuccList, psNewEntry);
+ psNewEntry->window = window; /* Bind to current window. */
+ } else {
+ assert(psEntry->count < patPtr->count);
+ DEBUG(psEntry->expired = 0;)
+ psEntry->count += 1;
+ psEntry->keepIt = 1; /* Don't remove it from promotion list. */
}
- assert(psNewEntry->keepIt);
- assert(psNewEntry->count == 1u);
- PSList_Append(psSuccList, psNewEntry);
- psNewEntry->window = window; /* bind to current window */
} else {
- assert(psEntry->count < patPtr->count);
+ /*
+ * Pattern sequence is already present in the success list.
+ */
+
DEBUG(psEntry->expired = 0;)
- psEntry->count += 1;
- psEntry->keepIt = 1; /* don't remove it from promotion list */
+ psEntry->keepIt = 1; /* Don't remove it from promotion list. */
}
}
}
@@ -3331,8 +3355,18 @@ Tk_EventObjCmd(
TkBindInfo bindInfo;
VirtualEventTable *vetPtr;
- static const char *const optionStrings[] = { "add", "delete", "generate", "info", NULL };
- enum options { EVENT_ADD, EVENT_DELETE, EVENT_GENERATE, EVENT_INFO };
+ static const char *const optionStrings[] = { "add",
+#if SUPPORT_DEBUGGING
+ "debug",
+#endif
+ "delete", "generate", "info", NULL
+ };
+ enum options { EVENT_ADD,
+#if SUPPORT_DEBUGGING
+ EVENT_DEBUG,
+#endif
+ EVENT_DELETE, EVENT_GENERATE, EVENT_INFO
+ };
assert(clientData);
@@ -3342,16 +3376,6 @@ Tk_EventObjCmd(
}
if (Tcl_GetIndexFromObjStruct(
interp, objv[1], optionStrings, sizeof(char *), "option", 0, &index) != TCL_OK) {
-#ifdef SUPPORT_DEBUGGING
- if (strcmp(Tcl_GetString(objv[1]), "debug") == 0) {
- if (objc < 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "debug number");
- return TCL_ERROR;
- }
- Tcl_GetIntFromObj(interp, objv[2], &BindCount);
- return TCL_OK;
- }
-#endif
return TCL_ERROR;
}
@@ -3373,6 +3397,22 @@ Tk_EventObjCmd(
}
}
break;
+#if SUPPORT_DEBUGGING
+ case EVENT_DEBUG:
+ if (objc > 3) {
+ Tcl_WrongNumArgs(interp, 1, objv, "debug number");
+ return TCL_ERROR;
+ }
+ if (objc < 3) {
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj(BindCount));
+ return TCL_OK;
+ }
+ if (Tcl_GetIntFromObj(interp, objv[2], &BindCount) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+#endif
case EVENT_DELETE:
if (objc < 3) {
Tcl_WrongNumArgs(interp, 2, objv, "virtual ?sequence ...?");
@@ -3533,7 +3573,7 @@ CreateVirtualEvent(
}
/*
- * Find/create physical event
+ * Find/create physical event.
*/
if (!(psPtr = FindSequence(interp, &vetPtr->lookupTables, NULL, eventString, 1, 0, NULL))) {
@@ -3641,7 +3681,7 @@ DeleteVirtualEvent(
VirtOwners *owners = psPtr->ptr.owners;
int iVirt = VirtOwners_Find(owners, vhPtr);
- assert(iVirt != -1); /* otherwise we couldn't find owner, and this should not happen */
+ assert(iVirt != -1); /* Otherwise we couldn't find owner, and this should not happen. */
/*
* Remove association between this physical event and the given
@@ -3963,7 +4003,12 @@ HandleEventGenerate(
for (i = 2; i < (unsigned) objc; i += 2) {
Tcl_Obj *optionPtr, *valuePtr;
+#if defined(_MSC_VER)
+ /* Work around MSVC compiler optimization bug, see [d93c8175fd]. */
+ volatile int badOpt = 0;
+#else
int badOpt = 0;
+#endif
int index;
optionPtr = objv[i];
@@ -4816,7 +4861,7 @@ ParseEventDescription(
assert(eventMaskPtr);
p = *eventStringPtr;
- memset(patPtr, 0, sizeof(TkPattern)); /* otherwise memcmp doesn't work */
+ memset(patPtr, 0, sizeof(TkPattern)); /* Otherwise memcmp doesn't work. */
/*
* Handle simple ASCII characters.
@@ -4947,7 +4992,7 @@ ParseEventDescription(
if ((eventFlags & BUTTON)
|| (button && eventFlags == 0)
|| (SUPPORT_ADDITIONAL_MOTION_SYNTAX && (eventFlags & MOTION) && button == 0)) {
- /* This must be a button (or bad motion) event */
+ /* This must be a button (or bad motion) event. */
if (button == 0) {
return FinalizeParseEventDescription(
interp,
diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c
index ccc97a4..55317de 100644
--- a/generic/tkBitmap.c
+++ b/generic/tkBitmap.c
@@ -1014,7 +1014,7 @@ BitmapInit(
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
- * First initialize the data in the ThreadSpecificData strucuture, if
+ * First initialize the data in the ThreadSpecificData structure, if
* needed.
*/
@@ -1169,7 +1169,7 @@ TkDebugBitmap(
*
* TkGetBitmapPredefTable --
*
- * This function is used by tkMacBitmap.c to access the thread-specific
+ * This function is used by tkMacOSXBitmap.c to access the thread-specific
* predefBitmap table that maps from the names of the predefined bitmaps
* to data associated with those bitmaps. It is required because the
* table is allocated in thread-local storage and is not visible outside
diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c
index 70b9c79..19d1516 100644
--- a/generic/tkCanvImg.c
+++ b/generic/tkCanvImg.c
@@ -74,8 +74,8 @@ static void ImageChangedProc(ClientData clientData,
int x, int y, int width, int height, int imgWidth,
int imgHeight);
static int ImageCoords(Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *const argv[]);
+ Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
+ Tcl_Obj *const objv[]);
static int ImageToArea(Tk_Canvas canvas,
Tk_Item *itemPtr, double *rectPtr);
static double ImageToPoint(Tk_Canvas canvas,
@@ -84,11 +84,11 @@ static int ImageToPostscript(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int prepass);
static void ComputeImageBbox(Tk_Canvas canvas, ImageItem *imgPtr);
static int ConfigureImage(Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *const argv[], int flags);
+ Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
+ Tcl_Obj *const objv[], int flags);
static int CreateImage(Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int argc, Tcl_Obj *const argv[]);
+ int objc, Tcl_Obj *const objv[]);
static void DeleteImage(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display);
static void DisplayImage(Tk_Canvas canvas,
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c
index c0783ad..8536eab 100644
--- a/generic/tkCanvText.c
+++ b/generic/tkCanvText.c
@@ -140,7 +140,7 @@ static int ConfigureText(Tcl_Interp *interp,
Tcl_Obj *const objv[], int flags);
static int CreateText(Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int argc, Tcl_Obj *const objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void DeleteText(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display);
static void DisplayCanvText(Tk_Canvas canvas,
@@ -159,7 +159,7 @@ static void SetTextCursor(Tk_Canvas canvas,
Tk_Item *itemPtr, int index);
static int TextCoords(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr,
- int argc, Tcl_Obj *const objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void TextDeleteChars(Tk_Canvas canvas,
Tk_Item *itemPtr, int first, int last);
static void TextInsert(Tk_Canvas canvas,
diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c
index 65af3da..86439df 100644
--- a/generic/tkCanvUtil.c
+++ b/generic/tkCanvUtil.c
@@ -424,8 +424,8 @@ Tk_CanvasTagsParseProc(
*/
if (itemPtr->tagSpace < argc) {
- newPtr = ckalloc(argc * sizeof(Tk_Uid));
- for (i = itemPtr->numTags-1; i >= 0; i--) {
+ newPtr = (Tk_Uid *)ckalloc(argc * sizeof(Tk_Uid));
+ for (i = itemPtr->numTags - 1; i >= 0; i--) {
newPtr[i] = itemPtr->tagPtr[i];
}
if (itemPtr->tagPtr != itemPtr->staticTagSpace) {
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 9a7e938..b80c197 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -7,7 +7,7 @@
*
* Copyright (c) 1991-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
- * Copyright (c) 1998-1999 by Scriptics Corporation.
+ * Copyright (c) 1998-1999 Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -261,12 +261,12 @@ static void CanvasSetOrigin(TkCanvas *canvasPtr,
int xOrigin, int yOrigin);
static void CanvasUpdateScrollbars(TkCanvas *canvasPtr);
static int CanvasWidgetCmd(ClientData clientData,
- Tcl_Interp *interp, int argc,
- Tcl_Obj *const *argv);
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const *objv);
static void CanvasWorldChanged(ClientData instanceData);
static int ConfigureCanvas(Tcl_Interp *interp,
- TkCanvas *canvasPtr, int argc,
- Tcl_Obj *const *argv, int flags);
+ TkCanvas *canvasPtr, int objc,
+ Tcl_Obj *const *objv, int flags);
static void DestroyCanvas(void *memPtr);
static void DisplayCanvas(ClientData clientData);
static void DoItem(Tcl_Obj *accumObj,
@@ -279,14 +279,14 @@ static int FindItems(Tcl_Interp *interp, TkCanvas *canvasPtr,
Tcl_Obj *newTagObj, int first);
#else /* USE_OLD_TAG_SEARCH */
static int FindItems(Tcl_Interp *interp, TkCanvas *canvasPtr,
- int argc, Tcl_Obj *const *argv,
+ int objc, Tcl_Obj *const *objv,
Tcl_Obj *newTagObj, int first,
TagSearch **searchPtrPtr);
#endif /* USE_OLD_TAG_SEARCH */
static int FindArea(Tcl_Interp *interp, TkCanvas *canvasPtr,
- Tcl_Obj *const *argv, Tk_Uid uid, int enclosed);
+ Tcl_Obj *const *objv, Tk_Uid uid, int enclosed);
static double GridAlign(double coord, double spacing);
-static const char** TkGetStringsFromObjs(int argc, Tcl_Obj *const *objv);
+static const char** TkGetStringsFromObjs(int objc, Tcl_Obj *const *objv);
static void InitCanvas(void);
#ifdef USE_OLD_TAG_SEARCH
static Tk_Item * NextItem(TagSearch *searchPtr);
@@ -635,8 +635,8 @@ int
Tk_CanvasObjCmd(
ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
- int argc, /* Number of arguments. */
- Tcl_Obj *const argv[]) /* Argument objects. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_Window tkwin = (Tk_Window)clientData;
TkCanvas *canvasPtr;
@@ -646,12 +646,12 @@ Tk_CanvasObjCmd(
InitCanvas();
}
- if (argc < 2) {
- Tcl_WrongNumArgs(interp, 1, argv, "pathName ?-option value ...?");
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?");
return TCL_ERROR;
}
- newWin = Tk_CreateWindowFromPath(interp,tkwin,Tcl_GetString(argv[1]),NULL);
+ newWin = Tk_CreateWindowFromPath(interp,tkwin,Tcl_GetString(objv[1]),NULL);
if (newWin == NULL) {
return TCL_ERROR;
}
@@ -751,7 +751,7 @@ Tk_CanvasObjCmd(
CanvasBindProc, canvasPtr);
Tk_CreateSelHandler(canvasPtr->tkwin, XA_PRIMARY, XA_STRING,
CanvasFetchSelection, canvasPtr, XA_STRING);
- if (ConfigureCanvas(interp, canvasPtr, argc-2, argv+2, 0) != TCL_OK) {
+ if (ConfigureCanvas(interp, canvasPtr, objc-2, objv+2, 0) != TCL_OK) {
goto error;
}
@@ -2064,14 +2064,11 @@ CanvasWidgetCmd(
}
args = TkGetStringsFromObjs(objc, objv);
- type = Tk_GetScrollInfo(interp, objc, args, &fraction, &count);
+ type = Tk_GetScrollInfoObj(interp, objc, objv, &fraction, &count);
if (args != NULL) {
ckfree(args);
}
switch (type) {
- case TK_SCROLL_ERROR:
- result = TCL_ERROR;
- goto done;
case TK_SCROLL_MOVETO:
newX = canvasPtr->scrollX1 - canvasPtr->inset
+ (int) (fraction * (canvasPtr->scrollX2
@@ -2089,6 +2086,9 @@ CanvasWidgetCmd(
* (Tk_Width(canvasPtr->tkwin) - 2*canvasPtr->inset));
}
break;
+ default:
+ result = TCL_ERROR;
+ goto done;
}
CanvasSetOrigin(canvasPtr, newX, canvasPtr->yOrigin);
break;
@@ -2110,14 +2110,11 @@ CanvasWidgetCmd(
}
args = TkGetStringsFromObjs(objc, objv);
- type = Tk_GetScrollInfo(interp, objc, args, &fraction, &count);
+ type = Tk_GetScrollInfoObj(interp, objc, objv, &fraction, &count);
if (args != NULL) {
ckfree(args);
}
switch (type) {
- case TK_SCROLL_ERROR:
- result = TCL_ERROR;
- goto done;
case TK_SCROLL_MOVETO:
newY = canvasPtr->scrollY1 - canvasPtr->inset + (int) (
fraction*(canvasPtr->scrollY2-canvasPtr->scrollY1) + 0.5);
@@ -2134,6 +2131,9 @@ CanvasWidgetCmd(
* (Tk_Height(canvasPtr->tkwin) - 2*canvasPtr->inset));
}
break;
+ default:
+ result = TCL_ERROR;
+ goto done;
}
CanvasSetOrigin(canvasPtr, canvasPtr->xOrigin, newY);
break;
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index a6684c7..bf7626a 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -953,8 +953,6 @@ EntryWidgetObjCmd(
index = entryPtr->leftIndex;
switch (Tk_GetScrollInfoObj(interp, objc, objv, &fraction,
&count)) {
- case TK_SCROLL_ERROR:
- goto error;
case TK_SCROLL_MOVETO:
index = (int) ((fraction * entryPtr->numChars) + 0.5);
break;
@@ -972,6 +970,8 @@ EntryWidgetObjCmd(
case TK_SCROLL_UNITS:
index += count;
break;
+ default:
+ goto error;
}
}
if (index >= entryPtr->numChars) {
@@ -4181,8 +4181,6 @@ SpinboxWidgetObjCmd(
index = entryPtr->leftIndex;
switch (Tk_GetScrollInfoObj(interp, objc, objv, &fraction,
&count)) {
- case TK_SCROLL_ERROR:
- goto error;
case TK_SCROLL_MOVETO:
index = (int) ((fraction * entryPtr->numChars) + 0.5);
break;
@@ -4201,6 +4199,8 @@ SpinboxWidgetObjCmd(
case TK_SCROLL_UNITS:
index += count;
break;
+ default:
+ goto error;
}
}
if (index >= entryPtr->numChars) {
diff --git a/generic/tkEvent.c b/generic/tkEvent.c
index 456b86d..9c3b1b3 100644
--- a/generic/tkEvent.c
+++ b/generic/tkEvent.c
@@ -1992,7 +1992,7 @@ TkDeleteThreadExitHandler(
* TkFinalize --
*
* Runs our private exit handlers and removes itself from Tcl. This is
- * benificial should we want to protect from dangling pointers should the
+ * beneficial should we want to protect from dangling pointers should the
* Tk shared library be unloaded prior to Tcl which can happen on windows
* should the process be forcefully exiting from an exception handler.
*
diff --git a/generic/tkFont.c b/generic/tkFont.c
index 71008bc..8138c34 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.c
@@ -908,7 +908,7 @@ RecomputeWidgets(
*
* This could be done recursively or iteratively. The recursive version is
* easier to implement and understand, and typically, windows with a -font
- * option will be leaf nodes in the widget heirarchy (buttons, labels,
+ * option will be leaf nodes in the widget hierarchy (buttons, labels,
* etc.), so the recursion depth will be shallow.
*
* However, the additional overhead of the recursive calls may become a
diff --git a/generic/tkFrame.c b/generic/tkFrame.c
index b5c20e8..30602b2 100644
--- a/generic/tkFrame.c
+++ b/generic/tkFrame.c
@@ -306,7 +306,7 @@ static void ComputeFrameGeometry(Frame *framePtr);
static int ConfigureFrame(Tcl_Interp *interp, Frame *framePtr,
int objc, Tcl_Obj *const objv[]);
static int CreateFrame(ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *const argv[],
+ int objc, Tcl_Obj *const objv[],
enum FrameType type, const char *appName);
static void DestroyFrame(void *memPtr);
static void DestroyFramePartly(Frame *framePtr);
diff --git a/generic/tkGrab.c b/generic/tkGrab.c
index 787a2e2..2232ba5 100644
--- a/generic/tkGrab.c
+++ b/generic/tkGrab.c
@@ -26,7 +26,7 @@
* grab state information: the current grab window, the current restrict
* window, and whether the mouse is captured.
*
- * The current grab window specifies the point in the Tk window heirarchy
+ * The current grab window specifies the point in the Tk window hierarchy
* above which pointer events will not be reported. Any window within the
* subtree below the grab window will continue to receive events as normal.
* Events outside of the grab tree will be reported to the grab window.
diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c
index 04027b0..a7fd14e 100644
--- a/generic/tkImgBmap.c
+++ b/generic/tkImgBmap.c
@@ -5,7 +5,7 @@
*
* Copyright (c) 1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
- * Copyright (c) 1999 by Scriptics Corporation.
+ * Copyright (c) 1999 Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -75,7 +75,7 @@ typedef struct BitmapInstance {
static int GetByte(Tcl_Channel chan);
static int ImgBmapCreate(Tcl_Interp *interp,
- const char *name, int argc, Tcl_Obj *const objv[],
+ const char *name, int objc, Tcl_Obj *const objv[],
const Tk_ImageType *typePtr, Tk_ImageModel model,
ClientData *clientDataPtr);
static ClientData ImgBmapGet(Tk_Window tkwin, ClientData clientData);
@@ -146,11 +146,11 @@ typedef struct ParseInfo {
*/
static int ImgBmapCmd(ClientData clientData, Tcl_Interp *interp,
- int argc, Tcl_Obj *const objv[]);
+ int objc, Tcl_Obj *const objv[]);
static void ImgBmapCmdDeletedProc(ClientData clientData);
static void ImgBmapConfigureInstance(BitmapInstance *instancePtr);
static int ImgBmapConfigureModel(BitmapModel *modelPtr,
- int argc, Tcl_Obj *const objv[], int flags);
+ int objc, Tcl_Obj *const objv[], int flags);
static int NextBitmapWord(ParseInfo *parseInfoPtr);
/*
@@ -169,22 +169,21 @@ static int NextBitmapWord(ParseInfo *parseInfoPtr);
*----------------------------------------------------------------------
*/
- /* ARGSUSED */
static int
ImgBmapCreate(
Tcl_Interp *interp, /* Interpreter for application containing
* image. */
const char *name, /* Name to use for image. */
- int argc, /* Number of arguments. */
- Tcl_Obj *const argv[], /* Argument objects for options (doesn't
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[], /* Argument objects for options (doesn't
* include image name or type). */
- const Tk_ImageType *typePtr,/* Pointer to our type record (not used). */
- Tk_ImageModel model, /* Token for image, to be used by us in later
+ TCL_UNUSED(const Tk_ImageType *),/* Pointer to our type record (not used). */
+ Tk_ImageModel model, /* Token for image, to be used by us in later
* callbacks. */
ClientData *clientDataPtr) /* Store manager's token for image here; it
* will be returned in later callbacks. */
{
- BitmapModel *modelPtr = ckalloc(sizeof(BitmapModel));
+ BitmapModel *modelPtr = (BitmapModel *)ckalloc(sizeof(BitmapModel));
modelPtr->tkModel = model;
modelPtr->interp = interp;
@@ -200,7 +199,7 @@ ImgBmapCreate(
modelPtr->maskFileString = NULL;
modelPtr->maskDataString = NULL;
modelPtr->instancePtr = NULL;
- if (ImgBmapConfigureModel(modelPtr, argc, argv, 0) != TCL_OK) {
+ if (ImgBmapConfigureModel(modelPtr, objc, objv, 0) != TCL_OK) {
ImgBmapDelete(modelPtr);
return TCL_ERROR;
}
@@ -239,19 +238,11 @@ ImgBmapConfigureModel(
{
BitmapInstance *instancePtr;
int maskWidth, maskHeight, dummy1, dummy2;
- const char **argv = ckalloc((objc+1) * sizeof(char *));
-
- for (dummy1 = 0; dummy1 < objc; dummy1++) {
- argv[dummy1] = Tcl_GetString(objv[dummy1]);
- }
- argv[objc] = NULL;
if (Tk_ConfigureWidget(modelPtr->interp, Tk_MainWindow(modelPtr->interp),
- configSpecs, objc, argv, (char *) modelPtr, flags) != TCL_OK) {
- ckfree(argv);
+ configSpecs, objc, (const char **) objv, (char *) modelPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
return TCL_ERROR;
}
- ckfree(argv);
/*
* Parse the bitmap and/or mask to create binary data. Make sure that the
@@ -500,13 +491,15 @@ TkGetBitmapData(
Tcl_SetErrorCode(interp, "TK", "SAFE", "BITMAP_FILE", NULL);
return NULL;
}
- expandedFileName = Tcl_TranslateFileName(interp, fileName, &buffer);
+ expandedFileName = Tcl_TranslateFileName(NULL, fileName, &buffer);
if (expandedFileName == NULL) {
- return NULL;
+ Tcl_SetErrno(ENOENT);
+ goto cannotRead;
}
pi.chan = Tcl_OpenFileChannel(interp, expandedFileName, "r", 0);
Tcl_DStringFree(&buffer);
if (pi.chan == NULL) {
+ cannotRead:
if (interp != NULL) {
Tcl_ResetResult(interp);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
@@ -620,7 +613,7 @@ TkGetBitmapData(
goto error;
}
numBytes = ((width+7)/8) * height;
- data = ckalloc(numBytes);
+ data = (char *)ckalloc(numBytes);
for (p = data; numBytes > 0; p++, numBytes--) {
if (NextBitmapWord(&pi) != TCL_OK) {
goto error;
@@ -757,7 +750,7 @@ ImgBmapCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
static const char *const bmapOptions[] = {"cget", "configure", NULL};
- BitmapModel *modelPtr = clientData;
+ BitmapModel *modelPtr = (BitmapModel *)clientData;
int index;
if (objc < 2) {
@@ -819,7 +812,7 @@ ImgBmapGet(
ClientData modelData) /* Pointer to our model structure for the
* image. */
{
- BitmapModel *modelPtr = modelData;
+ BitmapModel *modelPtr = (BitmapModel *)modelData;
BitmapInstance *instancePtr;
/*
@@ -840,7 +833,7 @@ ImgBmapGet(
* the image.
*/
- instancePtr = ckalloc(sizeof(BitmapInstance));
+ instancePtr = (BitmapInstance *)ckalloc(sizeof(BitmapInstance));
instancePtr->refCount = 1;
instancePtr->modelPtr = modelPtr;
instancePtr->tkwin = tkwin;
@@ -894,7 +887,7 @@ ImgBmapDisplay(
/* Coordinates within drawable that correspond
* to imageX and imageY. */
{
- BitmapInstance *instancePtr = clientData;
+ BitmapInstance *instancePtr = (BitmapInstance *)clientData;
int masking;
/*
@@ -948,11 +941,10 @@ ImgBmapFree(
* instance to be displayed. */
Display *display) /* Display containing window that used image. */
{
- BitmapInstance *instancePtr = clientData;
+ BitmapInstance *instancePtr = (BitmapInstance *)clientData;
BitmapInstance *prevPtr;
- instancePtr->refCount--;
- if (instancePtr->refCount > 0) {
+ if (instancePtr->refCount-- > 1) {
return;
}
@@ -1010,7 +1002,7 @@ ImgBmapDelete(
ClientData modelData) /* Pointer to BitmapModel structure for
* image. Must not have any more instances. */
{
- BitmapModel *modelPtr = modelData;
+ BitmapModel *modelPtr = (BitmapModel *)modelData;
if (modelPtr->instancePtr != NULL) {
Tcl_Panic("tried to delete bitmap image when instances still exist");
@@ -1051,7 +1043,7 @@ ImgBmapCmdDeletedProc(
ClientData clientData) /* Pointer to BitmapModel structure for
* image. */
{
- BitmapModel *modelPtr = clientData;
+ BitmapModel *modelPtr = (BitmapModel *)clientData;
modelPtr->imageCmd = NULL;
if (modelPtr->tkModel != NULL) {
@@ -1080,10 +1072,8 @@ GetByte(
Tcl_Channel chan) /* The channel we read from. */
{
char buffer;
- int size;
- size = Tcl_Read(chan, &buffer, 1);
- if (size != 1) {
+ if (Tcl_Read(chan, &buffer, 1) != 1) {
return EOF;
} else {
return buffer;
@@ -1198,7 +1188,7 @@ ImgBmapPostscript(
int x, int y, int width, int height,
int prepass)
{
- BitmapModel *modelPtr = clientData;
+ BitmapModel *modelPtr = (BitmapModel *)clientData;
Tcl_InterpState interpState;
Tcl_Obj *psObj;
diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c
index ab4bc37..3467bd5 100644
--- a/generic/tkImgGIF.c
+++ b/generic/tkImgGIF.c
@@ -624,6 +624,13 @@ FileReadGIF(
imageHeight, colorMap, 0, 0, 0, -1) != TCL_OK) {
goto error;
}
+
+ /*
+ * This extension starts a new scope, so Graphic control Extension
+ * data should be cleared
+ */
+ transparent = -1;
+
continue;
}
break;
@@ -943,6 +950,11 @@ DoExtension(
switch (label) {
case 0x01: /* Plain Text Extension */
+ /*
+ * This extension starts a new scope, so Graphic control Extension
+ * data should be cleared
+ */
+ *transparent = -1;
break;
case 0xff: /* Application Extension */
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index d385a7c..3d22c63 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -3025,7 +3025,7 @@ Tk_PhotoPutBlock(
if (alphaOffset) {
/*
* This block is grossly inefficient. For each row in the image, it
- * finds each continguous string of nontransparent pixels, then marks
+ * finds each contiguous string of nontransparent pixels, then marks
* those areas as valid in the validRegion mask. This makes drawing
* very efficient, because of the way we use X: we just say, here's
* your mask, and here's your data. We need not worry about the
diff --git a/generic/tkInt.h b/generic/tkInt.h
index d3bf908..35b7e67 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -86,7 +86,9 @@
# endif
#endif
-#if defined(__GNUC__) && (__GNUC__ > 2)
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+# define TKFLEXARRAY
+#elif defined(__GNUC__) && (__GNUC__ > 2)
# define TKFLEXARRAY 0
#else
# define TKFLEXARRAY 1
@@ -1251,7 +1253,7 @@ MODULE_SCOPE void TkFreeGeometryContainer(Tk_Window tkwin,
MODULE_SCOPE void TkEventInit(void);
MODULE_SCOPE void TkRegisterObjTypes(void);
MODULE_SCOPE int TkDeadAppObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const argv[]);
+ Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int TkCanvasGetCoordObj(Tcl_Interp *interp,
Tk_Canvas canvas, Tcl_Obj *obj,
double *doublePtr);
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index 79c644a..7977d43 100644
--- a/generic/tkListbox.c
+++ b/generic/tkListbox.c
@@ -1280,8 +1280,6 @@ ListboxXviewSubCmd(
ChangeListboxOffset(listPtr, index*listPtr->xScrollUnit);
} else {
switch (Tk_GetScrollInfoObj(interp, objc, objv, &fraction, &count)) {
- case TK_SCROLL_ERROR:
- return TCL_ERROR;
case TK_SCROLL_MOVETO:
offset = (int) (fraction*listPtr->maxWidth + 0.5);
break;
@@ -1297,6 +1295,8 @@ ListboxXviewSubCmd(
case TK_SCROLL_UNITS:
offset = listPtr->xOffset + count*listPtr->xScrollUnit;
break;
+ default:
+ return TCL_ERROR;
}
ChangeListboxOffset(listPtr, offset);
}
@@ -1367,7 +1367,6 @@ ListboxYviewSubCmd(
case TK_SCROLL_UNITS:
index = listPtr->topIndex + count;
break;
- case TK_SCROLL_ERROR:
default:
return TCL_ERROR;
}
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 2c82f7d..b4c6473 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -1181,6 +1181,7 @@ DestroyMenuInstance(
}
if (menuPtr->entries != NULL) {
ckfree(menuPtr->entries);
+ menuPtr->entries = NULL;
}
TkMenuFreeDrawOptions(menuPtr);
Tk_FreeConfigOptions((char *) menuPtr,
diff --git a/generic/tkObj.c b/generic/tkObj.c
index 1552d11..0abf534 100644
--- a/generic/tkObj.c
+++ b/generic/tkObj.c
@@ -975,8 +975,8 @@ FreeWindowInternalRep(
*
* TkNewWindowObj --
*
- * This function allocates a new Tcl_Obj that refers to a particular to a
- * particular Tk window.
+ * This function allocates a new Tcl_Obj that refers to a particular
+ * Tk window.
*
* Results:
* A standard Tcl object reference, with refcount 0.
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index 44afb6e..5f542d0 100644
--- a/generic/tkPanedWindow.c
+++ b/generic/tkPanedWindow.c
@@ -410,7 +410,7 @@ Tk_PanedWindowObjCmd(
/*
* The first time this function is invoked, the option tables will be
* NULL. We then create the option tables from the templates and store
- * a pointer to the tables as the command's clinical so we'll have
+ * a pointer to the tables as the command's clientData so we'll have
* easy access to it in the future.
*/
diff --git a/generic/tkTest.c b/generic/tkTest.c
index 13d8392..b652068 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -80,7 +80,7 @@ typedef struct TImageInstance {
*/
static int ImageCreate(Tcl_Interp *interp,
- const char *name, int argc, Tcl_Obj *const objv[],
+ const char *name, int objc, Tcl_Obj *const objv[],
const Tk_ImageType *typePtr, Tk_ImageModel model,
ClientData *clientDataPtr);
static ClientData ImageGet(Tk_Window tkwin, ClientData clientData);
diff --git a/generic/tkText.c b/generic/tkText.c
index 86ea9f4..ea6c5fc 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -3926,7 +3926,7 @@ TextSearchCmd(
*
* Extract a row, text offset index position from an objPtr
*
- * This means we ignore any embedded windows/images and elidden text
+ * This means we ignore any embedded windows/images and elided text
* (unless we are searching that).
*
* Results:
@@ -3998,7 +3998,7 @@ TextSearchGetLineIndex(
* Find textual index of 'byteIndex' in the searchable characters of
* 'linePtr'.
*
- * This means we ignore any embedded windows/images and elidden text
+ * This means we ignore any embedded windows/images and elided text
* (unless we are searching that).
*
* Results:
@@ -4230,7 +4230,7 @@ TextSearchFoundMatch(
/*
* Calculate the character count, which may need augmenting if there are
- * embedded windows or elidden text.
+ * embedded windows or elided text.
*/
if (searchSpecPtr->exact) {
diff --git a/generic/tkText.h b/generic/tkText.h
index 9898462..d3c1cc9 100644
--- a/generic/tkText.h
+++ b/generic/tkText.h
@@ -168,7 +168,7 @@ typedef struct TkTextSegment {
int size; /* Size of this segment (# of bytes of index
* space it occupies). */
union {
- char chars[TKFLEXARRAY]; /* Characters that make up character info.
+ char chars[TCL_UTF_MAX]; /* Characters that make up character info.
* Actual length varies to hold as many
* characters as needed.*/
TkTextToggle toggle; /* Information about tag toggle. */
diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c
index 1b65cbc..533f1bf 100644
--- a/generic/tkTextBTree.c
+++ b/generic/tkTextBTree.c
@@ -1898,7 +1898,7 @@ TkBTreePreviousLine(
* height of the given line).
*
* Since the last line of text (the artificial one) has zero height by
- * defintion, calling this with the last line will return the total
+ * definition, calling this with the last line will return the total
* number of pixels in the widget.
*
* Results:
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 2dc7343..cf1cb1b 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -4742,11 +4742,16 @@ TkTextRedrawRegion(
TextInvalidateRegion(textPtr, damageRgn);
+ TkDestroyRegion(damageRgn);
+
+ /*
+ * Schedule the redisplay operation if there isn't one already scheduled.
+ */
+
if (!(dInfoPtr->flags & REDRAW_PENDING)) {
dInfoPtr->flags |= REDRAW_PENDING;
Tcl_DoWhenIdle(DisplayText, textPtr);
}
- TkDestroyRegion(damageRgn);
}
/*
@@ -4794,10 +4799,6 @@ TextInvalidateRegion(
dInfoPtr->topOfEof = maxY;
}
- /*
- * Schedule the redisplay operation if there isn't one already scheduled.
- */
-
inset = textPtr->borderWidth + textPtr->highlightWidth;
if ((rect.x < (inset + textPtr->padX))
|| (rect.y < (inset + textPtr->padY))
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 7506d2f..fa25553 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -1748,7 +1748,7 @@ Tk_MapWindow(
event.xmap.event = winPtr->window;
event.xmap.window = winPtr->window;
event.xmap.override_redirect = winPtr->atts.override_redirect;
- TkpHandleMapOrUnmap((Tk_Window)winPtr, &event);
+ Tk_HandleEvent(&event);
}
/*
@@ -1910,7 +1910,7 @@ Tk_UnmapWindow(
event.xunmap.event = winPtr->window;
event.xunmap.window = winPtr->window;
event.xunmap.from_configure = False;
- TkpHandleMapOrUnmap((Tk_Window)winPtr, &event);
+ Tk_HandleEvent(&event);
}
}
diff --git a/generic/ttk/ttkImage.c b/generic/ttk/ttkImage.c
index 002a753..e33a9de 100644
--- a/generic/ttk/ttkImage.c
+++ b/generic/ttk/ttkImage.c
@@ -249,7 +249,7 @@ static void Ttk_Tile(
typedef struct { /* ClientData for image elements */
Ttk_ImageSpec *imageSpec; /* Image(s) to use */
int minWidth; /* Minimum width; overrides image width */
- int minHeight; /* Minimum width; overrides image width */
+ int minHeight; /* Minimum height; overrides image height */
Ttk_Sticky sticky; /* -stickiness specification */
Ttk_Padding border; /* Fixed border region */
Ttk_Padding padding; /* Internal padding */
diff --git a/generic/ttk/ttkInit.c b/generic/ttk/ttkInit.c
index 9bc9d75..d4a1599 100644
--- a/generic/ttk/ttkInit.c
+++ b/generic/ttk/ttkInit.c
@@ -107,7 +107,7 @@ void TtkCheckStateOption(WidgetCore *corePtr, Tcl_Obj *objPtr)
/* TtkSendVirtualEvent --
* Send a virtual event notification to the specified target window.
- * Equivalent to "event generate $tgtWindow <<$eventName>>"
+ * Equivalent to "event generate $tgtWindow <<$eventName>> -when tail"
*
* Note that we use Tk_QueueWindowEvent, not Tk_HandleEvent,
* so this routine does not reenter the interpreter.
diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c
index c16aa75..71cbadd 100644
--- a/generic/ttk/ttkNotebook.c
+++ b/generic/ttk/ttkNotebook.c
@@ -1040,10 +1040,10 @@ static int NotebookHideCommand(
tab->state = TAB_STATE_HIDDEN;
if (index == nb->notebook.currentIndex) {
SelectNearestTab(nb);
+ } else {
+ TtkRedisplayWidget(&nb->core);
}
- TtkRedisplayWidget(&nb->core);
-
return TCL_OK;
}
diff --git a/generic/ttk/ttkScroll.c b/generic/ttk/ttkScroll.c
index 9cf8eae..c3b847a 100644
--- a/generic/ttk/ttkScroll.c
+++ b/generic/ttk/ttkScroll.c
@@ -229,8 +229,6 @@ int TtkScrollviewCommand(
int count;
switch (Tk_GetScrollInfoObj(interp, objc, objv, &fraction, &count)) {
- case TK_SCROLL_ERROR:
- return TCL_ERROR;
case TK_SCROLL_MOVETO:
newFirst = (int) ((fraction * s->total) + 0.5);
break;
@@ -242,6 +240,8 @@ int TtkScrollviewCommand(
newFirst = s->first + count * perPage;
break;
}
+ default:
+ return TCL_ERROR;
}
}
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index b37273b..7a5438a 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -241,8 +241,8 @@ typedef struct {
static void InitColumn(TreeColumn *column)
{
- column->width = 200;
- column->minWidth = 20;
+ column->width = atoi(DEF_COLWIDTH);
+ column->minWidth = atoi(DEF_MINWIDTH);
column->stretch = 1;
column->idObj = 0;
column->anchorObj = 0;
diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c
index 36b5097..9fa8ec0 100644
--- a/generic/ttk/ttkWidget.c
+++ b/generic/ttk/ttkWidget.c
@@ -115,6 +115,19 @@ void TtkRedisplayWidget(WidgetCore *corePtr)
}
}
+/*
+ * WidgetWorldChanged --
+ * Default Tk_ClassWorldChangedProc() for widgets.
+ * Invoked whenever fonts or other system resources are changed;
+ * recomputes geometry.
+ */
+static void WidgetWorldChanged(ClientData clientData)
+{
+ WidgetCore *corePtr = clientData;
+ SizeChanged(corePtr);
+ TtkRedisplayWidget(corePtr);
+}
+
/* TtkResizeWidget --
* Recompute widget size, schedule geometry propagation and redisplay.
*/
@@ -124,8 +137,7 @@ void TtkResizeWidget(WidgetCore *corePtr)
return;
}
- SizeChanged(corePtr);
- TtkRedisplayWidget(corePtr);
+ WidgetWorldChanged(corePtr);
}
/* TtkWidgetChangeState --
@@ -309,8 +321,7 @@ static void CoreEventProc(ClientData clientData, XEvent *eventPtr)
const char *name = ((XVirtualEvent *)eventPtr)->name;
if ((name != NULL) && !strcmp("ThemeChanged", name)) {
(void)UpdateLayout(corePtr->interp, corePtr);
- SizeChanged(corePtr);
- TtkRedisplayWidget(corePtr);
+ WidgetWorldChanged(corePtr);
}
break;
}
@@ -320,24 +331,11 @@ static void CoreEventProc(ClientData clientData, XEvent *eventPtr)
}
}
-/*
- * WidgetWorldChanged --
- * Default Tk_ClassWorldChangedProc() for widgets.
- * Invoked whenever fonts or other system resources are changed;
- * recomputes geometry.
- */
-static void WidgetWorldChanged(ClientData clientData)
-{
- WidgetCore *corePtr = clientData;
- SizeChanged(corePtr);
- TtkRedisplayWidget(corePtr);
-}
-
static Tk_ClassProcs widgetClassProcs = {
sizeof(Tk_ClassProcs), /* size */
- WidgetWorldChanged, /* worldChangedProc */
- NULL, /* createProc */
- NULL /* modalProc */
+ WidgetWorldChanged, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
};
/*
diff --git a/library/demos/cscroll.tcl b/library/demos/cscroll.tcl
index c88bfa9..98a4be2 100644
--- a/library/demos/cscroll.tcl
+++ b/library/demos/cscroll.tcl
@@ -25,7 +25,7 @@ set btns [addSeeDismiss $w.buttons $w]
pack $btns -side bottom -fill x
frame $w.grid
-scrollbar $w.hscroll -orient horiz -command "$c xview"
+scrollbar $w.hscroll -orient horizontal -command "$c xview"
scrollbar $w.vscroll -command "$c yview"
canvas $c -relief sunken -borderwidth 2 -scrollregion {-11c -11c 50c 20c} \
-xscrollcommand "$w.hscroll set" \
diff --git a/library/demos/entry2.tcl b/library/demos/entry2.tcl
index 6405d85..a4009a7 100644
--- a/library/demos/entry2.tcl
+++ b/library/demos/entry2.tcl
@@ -27,15 +27,15 @@ frame $w.frame -borderwidth 10
pack $w.frame -side top -fill x -expand 1
entry $w.frame.e1 -xscrollcommand "$w.frame.s1 set"
-ttk::scrollbar $w.frame.s1 -orient horiz -command \
+ttk::scrollbar $w.frame.s1 -orient horizontal -command \
"$w.frame.e1 xview"
frame $w.frame.spacer1 -width 20 -height 10
entry $w.frame.e2 -xscrollcommand "$w.frame.s2 set"
-ttk::scrollbar $w.frame.s2 -orient horiz -command \
+ttk::scrollbar $w.frame.s2 -orient horizontal -command \
"$w.frame.e2 xview"
frame $w.frame.spacer2 -width 20 -height 10
entry $w.frame.e3 -xscrollcommand "$w.frame.s3 set"
-ttk::scrollbar $w.frame.s3 -orient horiz -command \
+ttk::scrollbar $w.frame.s3 -orient horizontal -command \
"$w.frame.e3 xview"
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
diff --git a/library/demos/floor.tcl b/library/demos/floor.tcl
index eb2ea7f..7d0ad3b 100644
--- a/library/demos/floor.tcl
+++ b/library/demos/floor.tcl
@@ -333,195 +333,195 @@ proc bg3 {w fill outline} {
proc fg1 {w color} {
global floorLabels floorItems
- set i [$w create polygon 375 246 375 172 341 172 341 246 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 375 246 375 172 341 172 341 246 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 101
set {floorItems(101)} $i
$w create text 358 209 -text 101 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 307 240 339 240 339 206 307 206 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 307 240 339 240 339 206 307 206 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) {Pub Lift1}
set {floorItems(Pub Lift1)} $i
$w create text 323 223 -text {Pub Lift1} -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 339 205 307 205 307 171 339 171 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 339 205 307 205 307 171 339 171 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) {Priv Lift1}
set {floorItems(Priv Lift1)} $i
$w create text 323 188 -text {Priv Lift1} -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 42 389 42 337 1 337 1 389 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 42 389 42 337 1 337 1 389 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 110
set {floorItems(110)} $i
$w create text 21.5 363 -text 110 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 59 389 59 385 90 385 90 337 44 337 44 389 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 59 389 59 385 90 385 90 337 44 337 44 389 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 109
set {floorItems(109)} $i
$w create text 67 363 -text 109 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 51 300 51 253 6 253 6 300 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 51 300 51 253 6 253 6 300 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 111
set {floorItems(111)} $i
$w create text 28.5 276.5 -text 111 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 98 248 98 309 79 309 79 248 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 98 248 98 309 79 309 79 248 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 117B
set {floorItems(117B)} $i
$w create text 88.5 278.5 -text 117B -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 51 251 51 204 6 204 6 251 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 51 251 51 204 6 204 6 251 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 112
set {floorItems(112)} $i
$w create text 28.5 227.5 -text 112 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 6 156 51 156 51 203 6 203 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 6 156 51 156 51 203 6 203 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 113
set {floorItems(113)} $i
$w create text 28.5 179.5 -text 113 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 85 169 79 169 79 192 85 192 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 85 169 79 169 79 192 85 192 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 117A
set {floorItems(117A)} $i
$w create text 82 180.5 -text 117A -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 77 302 77 168 53 168 53 302 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 77 302 77 168 53 168 53 302 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 117
set {floorItems(117)} $i
$w create text 65 235 -text 117 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 51 155 51 115 6 115 6 155 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 51 155 51 115 6 115 6 155 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 114
set {floorItems(114)} $i
$w create text 28.5 135 -text 114 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 95 115 53 115 53 168 95 168 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 95 115 53 115 53 168 95 168 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 115
set {floorItems(115)} $i
$w create text 74 141.5 -text 115 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 87 113 87 27 10 27 10 113 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 87 113 87 27 10 27 10 113 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 116
set {floorItems(116)} $i
$w create text 48.5 70 -text 116 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 89 91 128 91 128 113 89 113 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 89 91 128 91 128 113 89 113 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 118
set {floorItems(118)} $i
$w create text 108.5 102 -text 118 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 178 128 178 132 216 132 216 91 163 91 163 112 149 112 149 128 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 178 128 178 132 216 132 216 91 163 91 163 112 149 112 149 128 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 120
set {floorItems(120)} $i
$w create text 189.5 111.5 -text 120 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 79 193 87 193 87 169 136 169 136 192 156 192 156 169 175 169 175 246 79 246 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 79 193 87 193 87 169 136 169 136 192 156 192 156 169 175 169 175 246 79 246 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 122
set {floorItems(122)} $i
$w create text 131 207.5 -text 122 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 138 169 154 169 154 191 138 191 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 138 169 154 169 154 191 138 191 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 121
set {floorItems(121)} $i
$w create text 146 180 -text 121 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 99 300 126 300 126 309 99 309 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 99 300 126 300 126 309 99 309 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 106A
set {floorItems(106A)} $i
$w create text 112.5 304.5 -text 106A -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 128 299 128 309 150 309 150 248 99 248 99 299 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 128 299 128 309 150 309 150 248 99 248 99 299 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 105
set {floorItems(105)} $i
$w create text 124.5 278.5 -text 105 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 174 309 174 300 152 300 152 309 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 174 309 174 300 152 300 152 309 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 106B
set {floorItems(106B)} $i
$w create text 163 304.5 -text 106B -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 176 299 176 309 216 309 216 248 152 248 152 299 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 176 299 176 309 216 309 216 248 152 248 152 299 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 104
set {floorItems(104)} $i
$w create text 184 278.5 -text 104 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 138 385 138 337 91 337 91 385 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 138 385 138 337 91 337 91 385 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 108
set {floorItems(108)} $i
$w create text 114.5 361 -text 108 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 256 337 140 337 140 385 256 385 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 256 337 140 337 140 385 256 385 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 107
set {floorItems(107)} $i
$w create text 198 361 -text 107 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 300 353 300 329 260 329 260 353 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 300 353 300 329 260 329 260 353 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) Smoking
set {floorItems(Smoking)} $i
$w create text 280 341 -text Smoking -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 314 135 314 170 306 170 306 246 177 246 177 135 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 314 135 314 170 306 170 306 246 177 246 177 135 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 123
set {floorItems(123)} $i
$w create text 245.5 190.5 -text 123 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 217 248 301 248 301 326 257 326 257 310 217 310 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 217 248 301 248 301 326 257 326 257 310 217 310 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 103
set {floorItems(103)} $i
$w create text 259 287 -text 103 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 396 188 377 188 377 169 316 169 316 131 396 131 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 396 188 377 188 377 169 316 169 316 131 396 131 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 124
set {floorItems(124)} $i
$w create text 356 150 -text 124 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 397 226 407 226 407 189 377 189 377 246 397 246 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 397 226 407 226 407 189 377 189 377 246 397 246 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 125
set {floorItems(125)} $i
$w create text 392 217.5 -text 125 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 399 187 409 187 409 207 474 207 474 164 399 164 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 399 187 409 187 409 207 474 207 474 164 399 164 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 126
set {floorItems(126)} $i
$w create text 436.5 185.5 -text 126 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 409 209 409 229 399 229 399 253 486 253 486 239 474 239 474 209 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 409 209 409 229 399 229 399 253 486 253 486 239 474 239 474 209 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 127
set {floorItems(127)} $i
$w create text 436.5 231 -text 127 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 501 164 501 174 495 174 495 188 490 188 490 204 476 204 476 164 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 501 164 501 174 495 174 495 188 490 188 490 204 476 204 476 164 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) MShower
set {floorItems(MShower)} $i
$w create text 488.5 184 -text MShower -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 497 176 513 176 513 204 492 204 492 190 497 190 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 497 176 513 176 513 204 492 204 492 190 497 190 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) Closet
set {floorItems(Closet)} $i
$w create text 502.5 190 -text Closet -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 476 237 476 206 513 206 513 254 488 254 488 237 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 476 237 476 206 513 206 513 254 488 254 488 237 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) WShower
set {floorItems(WShower)} $i
$w create text 494.5 230 -text WShower -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 486 131 558 131 558 135 724 135 724 166 697 166 697 275 553 275 531 254 515 254 515 174 503 174 503 161 486 161 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 486 131 558 131 558 135 724 135 724 166 697 166 697 275 553 275 531 254 515 254 515 174 503 174 503 161 486 161 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 130
set {floorItems(130)} $i
$w create text 638.5 205 -text 130 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 308 242 339 242 339 248 342 248 342 246 397 246 397 276 393 276 393 309 300 309 300 248 308 248 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 308 242 339 242 339 248 342 248 342 246 397 246 397 276 393 276 393 309 300 309 300 248 308 248 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 102
set {floorItems(102)} $i
$w create text 367.5 278.5 -text 102 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 397 255 486 255 486 276 397 276 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 397 255 486 255 486 276 397 276 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 128
set {floorItems(128)} $i
$w create text 441.5 265.5 -text 128 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 510 309 486 309 486 255 530 255 552 277 561 277 561 325 510 325 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 510 309 486 309 486 255 530 255 552 277 561 277 561 325 510 325 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 129
set {floorItems(129)} $i
$w create text 535.5 293 -text 129 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 696 281 740 281 740 387 642 387 642 389 561 389 561 277 696 277 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 696 281 740 281 740 387 642 387 642 389 561 389 561 277 696 277 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 133
set {floorItems(133)} $i
$w create text 628.5 335 -text 133 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 742 387 742 281 800 281 800 387 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 742 387 742 281 800 281 800 387 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 132
set {floorItems(132)} $i
$w create text 771 334 -text 132 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 800 168 800 280 699 280 699 168 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 800 168 800 280 699 280 699 168 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 134
set {floorItems(134)} $i
$w create text 749.5 224 -text 134 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 726 131 726 166 800 166 800 131 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 726 131 726 166 800 166 800 131 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 135
set {floorItems(135)} $i
$w create text 763 148.5 -text 135 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 340 360 335 363 331 365 326 366 304 366 304 312 396 312 396 288 400 288 404 288 409 290 413 292 418 297 421 302 422 309 421 318 417 325 411 330 405 332 397 333 344 333 340 334 336 336 335 338 332 342 331 347 332 351 334 354 336 357 341 359 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 340 360 335 363 331 365 326 366 304 366 304 312 396 312 396 288 400 288 404 288 409 290 413 292 418 297 421 302 422 309 421 318 417 325 411 330 405 332 397 333 344 333 340 334 336 336 335 338 332 342 331 347 332 351 334 354 336 357 341 359 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) {Ramona Stair}
set {floorItems(Ramona Stair)} $i
$w create text 368 323 -text {Ramona Stair} -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 30 23 30 5 93 5 98 5 104 7 110 10 116 16 119 20 122 28 123 32 123 68 220 68 220 87 90 87 90 23 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 30 23 30 5 93 5 98 5 104 7 110 10 116 16 119 20 122 28 123 32 123 68 220 68 220 87 90 87 90 23 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) {University Stair}
set {floorItems(University Stair)} $i
$w create text 155 77.5 -text {University Stair} -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 282 37 295 40 312 49 323 56 337 70 352 56 358 48 363 39 365 29 348 25 335 22 321 14 300 5 283 1 260 0 246 0 242 2 236 4 231 8 227 13 223 17 221 22 220 34 260 34 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 282 37 295 40 312 49 323 56 337 70 352 56 358 48 363 39 365 29 348 25 335 22 321 14 300 5 283 1 260 0 246 0 242 2 236 4 231 8 227 13 223 17 221 22 220 34 260 34 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) {Plaza Stair}
set {floorItems(Plaza Stair)} $i
$w create text 317.5 28.5 -text {Plaza Stair} -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 220 34 260 34 282 37 295 40 312 49 323 56 337 70 350 83 365 94 377 100 386 104 386 128 220 128 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 220 34 260 34 282 37 295 40 312 49 323 56 337 70 350 83 365 94 377 100 386 104 386 128 220 128 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) {Plaza Deck}
set {floorItems(Plaza Deck)} $i
$w create text 303 81 -text {Plaza Deck} -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 257 336 77 336 6 336 6 301 77 301 77 310 257 310 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 257 336 77 336 6 336 6 301 77 301 77 310 257 310 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 106
set {floorItems(106)} $i
$w create text 131.5 318.5 -text 106 -fill $color -anchor c -tags {floor1 label}
- set i [$w create polygon 146 110 162 110 162 91 130 91 130 115 95 115 95 128 114 128 114 151 157 151 157 153 112 153 112 130 97 130 97 168 175 168 175 131 146 131 -outline {} -tags {floor1 room}]
+ set i [$w create polygon 146 110 162 110 162 91 130 91 130 115 95 115 95 128 114 128 114 151 157 151 157 153 112 153 112 130 97 130 97 168 175 168 175 131 146 131 -fill {} -outline {} -tags {floor1 room}]
set floorLabels($i) 119
set {floorItems(119)} $i
$w create text 143.5 133 -text 119 -fill $color -anchor c -tags {floor1 label}
@@ -696,207 +696,207 @@ proc fg1 {w color} {
proc fg2 {w color} {
global floorLabels floorItems
- set i [$w create polygon 748 188 755 188 755 205 758 205 758 222 800 222 800 168 748 168 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 748 188 755 188 755 205 758 205 758 222 800 222 800 168 748 168 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 238
set {floorItems(238)} $i
$w create text 774 195 -text 238 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 726 188 746 188 746 166 800 166 800 131 726 131 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 726 188 746 188 746 166 800 166 800 131 726 131 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 237
set {floorItems(237)} $i
$w create text 763 148.5 -text 237 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 497 187 497 204 559 204 559 324 641 324 643 324 643 291 641 291 641 205 696 205 696 291 694 291 694 314 715 314 715 291 715 205 755 205 755 190 724 190 724 187 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 497 187 497 204 559 204 559 324 641 324 643 324 643 291 641 291 641 205 696 205 696 291 694 291 694 314 715 314 715 291 715 205 755 205 755 190 724 190 724 187 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 246
set {floorItems(246)} $i
$w create text 600 264 -text 246 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 694 279 643 279 643 314 694 314 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 694 279 643 279 643 314 694 314 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 247
set {floorItems(247)} $i
$w create text 668.5 296.5 -text 247 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 232 250 308 250 308 242 339 242 339 246 397 246 397 255 476 255 476 250 482 250 559 250 559 274 482 274 482 278 396 278 396 274 232 274 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 232 250 308 250 308 242 339 242 339 246 397 246 397 255 476 255 476 250 482 250 559 250 559 274 482 274 482 278 396 278 396 274 232 274 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 202
set {floorItems(202)} $i
$w create text 285.5 260 -text 202 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 53 228 53 338 176 338 233 338 233 196 306 196 306 180 175 180 175 169 156 169 156 196 176 196 176 228 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 53 228 53 338 176 338 233 338 233 196 306 196 306 180 175 180 175 169 156 169 156 196 176 196 176 228 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 206
set {floorItems(206)} $i
$w create text 143 267 -text 206 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 51 277 6 277 6 338 51 338 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 51 277 6 277 6 338 51 338 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 212
set {floorItems(212)} $i
$w create text 28.5 307.5 -text 212 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 557 276 486 276 486 309 510 309 510 325 557 325 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 557 276 486 276 486 309 510 309 510 325 557 325 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 245
set {floorItems(245)} $i
$w create text 521.5 300.5 -text 245 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 560 389 599 389 599 326 560 326 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 560 389 599 389 599 326 560 326 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 244
set {floorItems(244)} $i
$w create text 579.5 357.5 -text 244 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 601 389 601 326 643 326 643 389 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 601 389 601 326 643 326 643 389 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 243
set {floorItems(243)} $i
$w create text 622 357.5 -text 243 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 688 316 645 316 645 365 688 365 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 688 316 645 316 645 365 688 365 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 242
set {floorItems(242)} $i
$w create text 666.5 340.5 -text 242 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 802 367 759 367 759 226 802 226 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 802 367 759 367 759 226 802 226 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) {Barbecue Deck}
set {floorItems(Barbecue Deck)} $i
$w create text 780.5 296.5 -text {Barbecue Deck} -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 755 262 755 314 717 314 717 262 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 755 262 755 314 717 314 717 262 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 240
set {floorItems(240)} $i
$w create text 736 288 -text 240 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 755 316 689 316 689 365 755 365 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 755 316 689 316 689 365 755 365 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 241
set {floorItems(241)} $i
$w create text 722 340.5 -text 241 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 755 206 717 206 717 261 755 261 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 755 206 717 206 717 261 755 261 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 239
set {floorItems(239)} $i
$w create text 736 233.5 -text 239 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 695 277 643 277 643 206 695 206 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 695 277 643 277 643 206 695 206 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 248
set {floorItems(248)} $i
$w create text 669 241.5 -text 248 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 676 135 676 185 724 185 724 135 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 676 135 676 185 724 185 724 135 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 236
set {floorItems(236)} $i
$w create text 700 160 -text 236 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 675 135 635 135 635 145 628 145 628 185 675 185 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 675 135 635 135 635 145 628 145 628 185 675 185 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 235
set {floorItems(235)} $i
$w create text 651.5 160 -text 235 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 626 143 633 143 633 135 572 135 572 143 579 143 579 185 626 185 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 626 143 633 143 633 135 572 135 572 143 579 143 579 185 626 185 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 234
set {floorItems(234)} $i
$w create text 606 160 -text 234 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 557 135 571 135 571 145 578 145 578 185 527 185 527 131 557 131 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 557 135 571 135 571 145 578 145 578 185 527 185 527 131 557 131 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 233
set {floorItems(233)} $i
$w create text 552.5 158 -text 233 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 476 249 557 249 557 205 476 205 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 476 249 557 249 557 205 476 205 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 230
set {floorItems(230)} $i
$w create text 516.5 227 -text 230 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 476 164 486 164 486 131 525 131 525 185 476 185 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 476 164 486 164 486 131 525 131 525 185 476 185 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 232
set {floorItems(232)} $i
$w create text 500.5 158 -text 232 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 476 186 495 186 495 204 476 204 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 476 186 495 186 495 204 476 204 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 229
set {floorItems(229)} $i
$w create text 485.5 195 -text 229 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 474 207 409 207 409 187 399 187 399 164 474 164 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 474 207 409 207 409 187 399 187 399 164 474 164 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 227
set {floorItems(227)} $i
$w create text 436.5 185.5 -text 227 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 399 228 399 253 474 253 474 209 409 209 409 228 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 399 228 399 253 474 253 474 209 409 209 409 228 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 228
set {floorItems(228)} $i
$w create text 436.5 231 -text 228 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 397 246 397 226 407 226 407 189 377 189 377 246 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 397 246 397 226 407 226 407 189 377 189 377 246 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 226
set {floorItems(226)} $i
$w create text 392 217.5 -text 226 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 377 169 316 169 316 131 397 131 397 188 377 188 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 377 169 316 169 316 131 397 131 397 188 377 188 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 225
set {floorItems(225)} $i
$w create text 356.5 150 -text 225 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 234 198 306 198 306 249 234 249 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 234 198 306 198 306 249 234 249 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 224
set {floorItems(224)} $i
$w create text 270 223.5 -text 224 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 270 179 306 179 306 170 314 170 314 135 270 135 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 270 179 306 179 306 170 314 170 314 135 270 135 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 223
set {floorItems(223)} $i
$w create text 292 157 -text 223 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 268 179 221 179 221 135 268 135 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 268 179 221 179 221 135 268 135 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 222
set {floorItems(222)} $i
$w create text 244.5 157 -text 222 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 177 179 219 179 219 135 177 135 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 177 179 219 179 219 135 177 135 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 221
set {floorItems(221)} $i
$w create text 198 157 -text 221 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 299 327 349 327 349 284 341 284 341 276 299 276 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 299 327 349 327 349 284 341 284 341 276 299 276 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 204
set {floorItems(204)} $i
$w create text 324 301.5 -text 204 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 234 276 297 276 297 327 257 327 257 338 234 338 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 234 276 297 276 297 327 257 327 257 338 234 338 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 205
set {floorItems(205)} $i
$w create text 265.5 307 -text 205 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 256 385 256 340 212 340 212 385 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 256 385 256 340 212 340 212 385 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 207
set {floorItems(207)} $i
$w create text 234 362.5 -text 207 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 210 340 164 340 164 385 210 385 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 210 340 164 340 164 385 210 385 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 208
set {floorItems(208)} $i
$w create text 187 362.5 -text 208 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 115 340 162 340 162 385 115 385 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 115 340 162 340 162 385 115 385 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 209
set {floorItems(209)} $i
$w create text 138.5 362.5 -text 209 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 89 228 89 156 53 156 53 228 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 89 228 89 156 53 156 53 228 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 217
set {floorItems(217)} $i
$w create text 71 192 -text 217 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 89 169 97 169 97 190 89 190 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 89 169 97 169 97 190 89 190 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 217A
set {floorItems(217A)} $i
$w create text 93 179.5 -text 217A -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 89 156 89 168 95 168 95 135 53 135 53 156 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 89 156 89 168 95 168 95 135 53 135 53 156 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 216
set {floorItems(216)} $i
$w create text 71 145.5 -text 216 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 51 179 51 135 6 135 6 179 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 51 179 51 135 6 135 6 179 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 215
set {floorItems(215)} $i
$w create text 28.5 157 -text 215 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 51 227 6 227 6 180 51 180 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 51 227 6 227 6 180 51 180 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 214
set {floorItems(214)} $i
$w create text 28.5 203.5 -text 214 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 51 275 6 275 6 229 51 229 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 51 275 6 275 6 229 51 229 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 213
set {floorItems(213)} $i
$w create text 28.5 252 -text 213 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 114 340 67 340 67 385 114 385 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 114 340 67 340 67 385 114 385 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 210
set {floorItems(210)} $i
$w create text 90.5 362.5 -text 210 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 59 389 59 385 65 385 65 340 1 340 1 389 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 59 389 59 385 65 385 65 340 1 340 1 389 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 211
set {floorItems(211)} $i
$w create text 33 364.5 -text 211 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 393 309 350 309 350 282 342 282 342 276 393 276 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 393 309 350 309 350 282 342 282 342 276 393 276 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 203
set {floorItems(203)} $i
$w create text 367.5 292.5 -text 203 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 99 191 91 191 91 226 174 226 174 198 154 198 154 192 109 192 109 169 99 169 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 99 191 91 191 91 226 174 226 174 198 154 198 154 192 109 192 109 169 99 169 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 220
set {floorItems(220)} $i
$w create text 132.5 208.5 -text 220 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 339 205 307 205 307 171 339 171 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 339 205 307 205 307 171 339 171 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) {Priv Lift2}
set {floorItems(Priv Lift2)} $i
$w create text 323 188 -text {Priv Lift2} -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 307 240 339 240 339 206 307 206 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 307 240 339 240 339 206 307 206 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) {Pub Lift 2}
set {floorItems(Pub Lift 2)} $i
$w create text 323 223 -text {Pub Lift 2} -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 175 168 97 168 97 131 175 131 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 175 168 97 168 97 131 175 131 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 218
set {floorItems(218)} $i
$w create text 136 149.5 -text 218 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 154 191 111 191 111 169 154 169 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 154 191 111 191 111 169 154 169 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 219
set {floorItems(219)} $i
$w create text 132.5 180 -text 219 -fill $color -anchor c -tags {floor2 label}
- set i [$w create polygon 375 246 375 172 341 172 341 246 -outline {} -tags {floor2 room}]
+ set i [$w create polygon 375 246 375 172 341 172 341 246 -fill {} -outline {} -tags {floor2 room}]
set floorLabels($i) 201
set {floorItems(201)} $i
$w create text 358 209 -text 201 -fill $color -anchor c -tags {floor2 label}
@@ -1066,135 +1066,135 @@ proc fg2 {w color} {
proc fg3 {w color} {
global floorLabels floorItems
- set i [$w create polygon 89 228 89 180 70 180 70 228 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 89 228 89 180 70 180 70 228 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 316
set {floorItems(316)} $i
$w create text 79.5 204 -text 316 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 115 368 162 368 162 323 115 323 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 115 368 162 368 162 323 115 323 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 309
set {floorItems(309)} $i
$w create text 138.5 345.5 -text 309 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 164 323 164 368 211 368 211 323 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 164 323 164 368 211 368 211 323 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 308
set {floorItems(308)} $i
$w create text 187.5 345.5 -text 308 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 256 368 212 368 212 323 256 323 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 256 368 212 368 212 323 256 323 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 307
set {floorItems(307)} $i
$w create text 234 345.5 -text 307 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 244 276 297 276 297 327 260 327 260 321 244 321 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 244 276 297 276 297 327 260 327 260 321 244 321 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 305
set {floorItems(305)} $i
$w create text 270.5 301.5 -text 305 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 251 219 251 203 244 203 244 219 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 251 219 251 203 244 203 244 219 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 324B
set {floorItems(324B)} $i
$w create text 247.5 211 -text 324B -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 251 249 244 249 244 232 251 232 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 251 249 244 249 244 232 251 232 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 324A
set {floorItems(324A)} $i
$w create text 247.5 240.5 -text 324A -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 223 135 223 179 177 179 177 135 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 223 135 223 179 177 179 177 135 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 320
set {floorItems(320)} $i
$w create text 200 157 -text 320 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 114 368 114 323 67 323 67 368 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 114 368 114 323 67 323 67 368 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 310
set {floorItems(310)} $i
$w create text 90.5 345.5 -text 310 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 23 277 23 321 68 321 68 277 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 23 277 23 321 68 321 68 277 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 312
set {floorItems(312)} $i
$w create text 45.5 299 -text 312 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 23 229 68 229 68 275 23 275 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 23 229 68 229 68 275 23 275 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 313
set {floorItems(313)} $i
$w create text 45.5 252 -text 313 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 68 227 23 227 23 180 68 180 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 68 227 23 227 23 180 68 180 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 314
set {floorItems(314)} $i
$w create text 45.5 203.5 -text 314 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 95 179 95 135 23 135 23 179 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 95 179 95 135 23 135 23 179 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 315
set {floorItems(315)} $i
$w create text 59 157 -text 315 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 99 226 99 204 91 204 91 226 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 99 226 99 204 91 204 91 226 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 316B
set {floorItems(316B)} $i
$w create text 95 215 -text 316B -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 91 202 99 202 99 180 91 180 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 91 202 99 202 99 180 91 180 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 316A
set {floorItems(316A)} $i
$w create text 95 191 -text 316A -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 97 169 109 169 109 192 154 192 154 198 174 198 174 226 101 226 101 179 97 179 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 97 169 109 169 109 192 154 192 154 198 174 198 174 226 101 226 101 179 97 179 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 319
set {floorItems(319)} $i
$w create text 141.5 209 -text 319 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 65 368 58 368 58 389 1 389 1 333 23 333 23 323 65 323 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 65 368 58 368 58 389 1 389 1 333 23 333 23 323 65 323 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 311
set {floorItems(311)} $i
$w create text 29.5 361 -text 311 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 154 191 111 191 111 169 154 169 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 154 191 111 191 111 169 154 169 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 318
set {floorItems(318)} $i
$w create text 132.5 180 -text 318 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 175 168 97 168 97 131 175 131 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 175 168 97 168 97 131 175 131 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 317
set {floorItems(317)} $i
$w create text 136 149.5 -text 317 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 274 194 274 221 306 221 306 194 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 274 194 274 221 306 221 306 194 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 323
set {floorItems(323)} $i
$w create text 290 207.5 -text 323 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 306 222 274 222 274 249 306 249 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 306 222 274 222 274 249 306 249 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 325
set {floorItems(325)} $i
$w create text 290 235.5 -text 325 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 263 179 224 179 224 135 263 135 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 263 179 224 179 224 135 263 135 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 321
set {floorItems(321)} $i
$w create text 243.5 157 -text 321 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 314 169 306 169 306 192 273 192 264 181 264 135 314 135 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 314 169 306 169 306 192 273 192 264 181 264 135 314 135 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 322
set {floorItems(322)} $i
$w create text 293.5 163.5 -text 322 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 307 240 339 240 339 206 307 206 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 307 240 339 240 339 206 307 206 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) {Pub Lift3}
set {floorItems(Pub Lift3)} $i
$w create text 323 223 -text {Pub Lift3} -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 339 205 307 205 307 171 339 171 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 339 205 307 205 307 171 339 171 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) {Priv Lift3}
set {floorItems(Priv Lift3)} $i
$w create text 323 188 -text {Priv Lift3} -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 350 284 376 284 376 276 397 276 397 309 350 309 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 350 284 376 284 376 276 397 276 397 309 350 309 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 303
set {floorItems(303)} $i
$w create text 373.5 292.5 -text 303 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 272 203 272 249 252 249 252 230 244 230 244 221 252 221 252 203 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 272 203 272 249 252 249 252 230 244 230 244 221 252 221 252 203 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 324
set {floorItems(324)} $i
$w create text 262 226 -text 324 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 299 276 299 327 349 327 349 284 341 284 341 276 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 299 276 299 327 349 327 349 284 341 284 341 276 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 304
set {floorItems(304)} $i
$w create text 324 301.5 -text 304 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 375 246 375 172 341 172 341 246 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 375 246 375 172 341 172 341 246 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 301
set {floorItems(301)} $i
$w create text 358 209 -text 301 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 397 246 377 246 377 185 397 185 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 397 246 377 246 377 185 397 185 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 327
set {floorItems(327)} $i
$w create text 387 215.5 -text 327 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 316 131 316 169 377 169 377 185 397 185 397 131 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 316 131 316 169 377 169 377 185 397 185 397 131 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 326
set {floorItems(326)} $i
$w create text 356.5 150 -text 326 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 308 251 242 251 242 274 342 274 342 282 375 282 375 274 397 274 397 248 339 248 339 242 308 242 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 308 251 242 251 242 274 342 274 342 282 375 282 375 274 397 274 397 248 339 248 339 242 308 242 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 302
set {floorItems(302)} $i
$w create text 319.5 261 -text 302 -fill $color -anchor c -tags {floor3 label}
- set i [$w create polygon 70 321 242 321 242 200 259 200 259 203 272 203 272 193 263 180 242 180 175 180 175 169 156 169 156 196 177 196 177 228 107 228 70 228 70 275 107 275 107 248 160 248 160 301 107 301 107 275 70 275 -outline {} -tags {floor3 room}]
+ set i [$w create polygon 70 321 242 321 242 200 259 200 259 203 272 203 272 193 263 180 242 180 175 180 175 169 156 169 156 196 177 196 177 228 107 228 70 228 70 275 107 275 107 248 160 248 160 301 107 301 107 275 70 275 -fill {} -outline {} -tags {floor3 room}]
set floorLabels($i) 306
set {floorItems(306)} $i
$w create text 200.5 284.5 -text 306 -fill $color -anchor c -tags {floor3 label}
diff --git a/library/demos/goldberg.tcl b/library/demos/goldberg.tcl
index 1cc52c6..90815fb 100644
--- a/library/demos/goldberg.tcl
+++ b/library/demos/goldberg.tcl
@@ -77,7 +77,6 @@ set S(mode) $::MSTART
# Colors for everything
set C(fg) black
-set C(bg) gray75
set C(bg) cornflowerblue
set C(0) white; set C(1a) darkgreen; set C(1b) yellow
@@ -92,6 +91,7 @@ set C(17) \#A65353; set C(18) $C(fg); set C(19) gray50
set C(20) cyan; set C(21) gray65; set C(22) $C(20)
set C(23a) blue; set C(23b) red; set C(23c) yellow
set C(24a) red; set C(24b) white;
+set C(24c) black; set C(26) $C(0);
proc DoDisplay {w} {
global S C
@@ -136,7 +136,7 @@ proc DoCtrlFrame {w} {
ttk::labelframe $w.message -text "Message"
ttk::entry $w.message.e -textvariable S(message) -justify center
ttk::labelframe $w.speed -text "Speed: 0"
- ttk::scale $w.speed.scale -orient h -from 1 -to 10 -variable S(speed)
+ ttk::scale $w.speed.scale -orient horizontal -from 1 -to 10 -variable S(speed)
ttk::button $w.about -text About -command [list About $w]
grid $w.start -in $w.ctrl -row 0 -sticky ew
@@ -1586,6 +1586,7 @@ proc Move24 {w {step {}}} {
-width 10 -smooth 1
set msg [subst $S(message)]
$w.c create text [Centroid $w I24] -text $msg -tag {I24 I24t} \
+ -fill $::C(24c) \
-justify center -font {{Times Roman} 18 bold}
return 1
}
@@ -1619,6 +1620,7 @@ proc Move26 {w {step {}}} {
if {$step >= 3} {
$w.c delete I24 I26
$w.c create text 430 755 -anchor s -tag I26 \
+ -fill $::C(26) \
-text "click to continue" -font {{Times Roman} 24 bold}
bind $w.c <Button-1> [list Reset $w]
return 4
diff --git a/library/demos/items.tcl b/library/demos/items.tcl
index 1297046..19cd4f4 100644
--- a/library/demos/items.tcl
+++ b/library/demos/items.tcl
@@ -32,7 +32,7 @@ canvas $c -scrollregion {0c 0c 30c 24c} -width 15c -height 10c \
-xscrollcommand "$w.frame.hscroll set" \
-yscrollcommand "$w.frame.vscroll set"
ttk::scrollbar $w.frame.vscroll -command "$c yview"
-ttk::scrollbar $w.frame.hscroll -orient horiz -command "$c xview"
+ttk::scrollbar $w.frame.hscroll -orient horizontal -command "$c xview"
grid $c -in $w.frame \
-row 0 -column 0 -rowspan 1 -columnspan 1 -sticky news
diff --git a/library/demos/menu.tcl b/library/demos/menu.tcl
index 244361d..4f5d703 100644
--- a/library/demos/menu.tcl
+++ b/library/demos/menu.tcl
@@ -18,7 +18,6 @@ positionWindow $w
label $w.msg -font $font -wraplength 4i -justify left
if {[tk windowingsystem] eq "aqua"} {
- catch {set origUseCustomMDEF $::tk::mac::useCustomMDEF; set ::tk::mac::useCustomMDEF 1}
$w.msg configure -text "This window has a menubar with cascaded menus. You can invoke entries with an accelerator by typing Command+x, where \"x\" is the character next to the command key symbol. The rightmost menu can be torn off into a palette by selecting the first item in the menu."
} 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."
@@ -56,7 +55,7 @@ menu $m -tearoff 0
$m add command -label "Long entry that does nothing"
if {[tk windowingsystem] eq "aqua"} {
set modifier Command
-} elseif {[tk windowingsystem] == "win32"} {
+} elseif {[tk windowingsystem] eq "win32"} {
set modifier Control
} else {
set modifier Meta
@@ -176,5 +175,3 @@ bind Menu <<MenuSelect>> {
set menustatus $label
update idletasks
}
-
-if {[tk windowingsystem] eq "aqua"} {catch {set ::tk::mac::useCustomMDEF $origUseCustomMDEF}}
diff --git a/library/demos/menubu.tcl b/library/demos/menubu.tcl
index 96e3b15..453b05c 100644
--- a/library/demos/menubu.tcl
+++ b/library/demos/menubu.tcl
@@ -18,7 +18,6 @@ positionWindow $w
frame $w.body
pack $w.body -expand 1 -fill both
-if {[tk windowingsystem] eq "aqua"} {catch {set origUseCustomMDEF $::tk::mac::useCustomMDEF; set ::tk::mac::useCustomMDEF 1}}
menubutton $w.body.below -text "Below" -underline 0 -direction below -menu $w.body.below.m -relief raised
menu $w.body.below.m -tearoff 0
@@ -86,5 +85,3 @@ foreach i {Black gray75 gray50 White} {
}
pack $body.buttons.colors -side left -padx 25 -pady 25
-
-if {[tk windowingsystem] eq "aqua"} {catch {set ::tk::mac::useCustomMDEF $origUseCustomMDEF}}
diff --git a/library/demos/puzzle.tcl b/library/demos/puzzle.tcl
index eebe87a..f06de5d 100644
--- a/library/demos/puzzle.tcl
+++ b/library/demos/puzzle.tcl
@@ -11,7 +11,7 @@ package require Tk
# puzzleSwitch --
# This procedure is invoked when the user clicks on a particular button;
-# if the button is next to the empty space, it moves the button into th
+# if the button is next to the empty space, it moves the button into the
# empty space.
proc puzzleSwitch {w num} {
diff --git a/library/menu.tcl b/library/menu.tcl
index 4fce551..deca485 100644
--- a/library/menu.tcl
+++ b/library/menu.tcl
@@ -285,7 +285,7 @@ proc ::tk::MbPost {w {x {}} {y {}}} {
GenerateMenuSelect $menu
update idletasks
- if {[catch {PostMenubuttonMenu $w $menu} msg opt]} {
+ if {[catch {PostMenubuttonMenu $w $menu $x $y} msg opt]} {
# Error posting menu (e.g. bogus -postcommand). Unpost it and
# reflect the error.
MenuUnpost {}
@@ -1138,7 +1138,7 @@ proc ::tk::MenuFindName {menu s} {
# side. On other platforms the entry is centered over the button.
if {[tk windowingsystem] eq "aqua"} {
- proc ::tk::PostMenubuttonMenu {button menu} {
+ proc ::tk::PostMenubuttonMenu {button menu cx cy} {
set entry ""
if {[$button cget -indicatoron]} {
set entry [MenuFindName $menu [$button cget -text]]
@@ -1163,14 +1163,14 @@ if {[tk windowingsystem] eq "aqua"} {
right {
incr x [winfo width $button]
}
- default {
+ default { # flush
incr x [expr {[winfo width $button] - [winfo reqwidth $menu] - 5}]
}
}
PostOverPoint $menu $x $y $entry
}
} else {
- proc ::tk::PostMenubuttonMenu {button menu} {
+ proc ::tk::PostMenubuttonMenu {button menu cx cy} {
set entry ""
if {[$button cget -indicatoron]} {
set entry [MenuFindName $menu [$button cget -text]]
@@ -1201,22 +1201,24 @@ if {[tk windowingsystem] eq "aqua"} {
set entry {}
}
left {
- # It is not clear why this is needed.
- if {[tk windowingsystem] eq "win32"} {
- incr x [expr {-4 - [winfo reqwidth $button] / 2}]
- }
incr x [expr {- [winfo reqwidth $menu]}]
}
right {
incr x [expr {[winfo width $button]}]
}
- default {
- if {[$button cget -indicatoron]} {
- incr x [expr {([winfo width $button] - \
- [winfo reqwidth $menu])/ 2}]
- } else {
- incr y [winfo height $button]
- }
+ default { # flush
+ if {[$button cget -indicatoron]} {
+ if {$cx ne ""} {
+ set x [expr {$cx - [winfo reqwidth $menu] / 2}]
+ set l [font metrics [$menu cget -font] -linespace]
+ set y [expr {$cy - $l/2 - 2}]
+ } else {
+ incr x [expr {([winfo width $button] - \
+ [winfo reqwidth $menu])/ 2}]
+ }
+ } else {
+ incr y [winfo height $button]
+ }
}
}
PostOverPoint $menu $x $y $entry
diff --git a/library/msgs/eo.msg b/library/msgs/eo.msg
index 3645630..a096b62 100644
--- a/library/msgs/eo.msg
+++ b/library/msgs/eo.msg
@@ -1,20 +1,20 @@
namespace eval ::tk {
- ::msgcat::mcset eo "&Abort" "&\u0108esigo"
+ ::msgcat::mcset eo "&Abort" "&\u0108esigu"
::msgcat::mcset eo "&About..." "Pri..."
- ::msgcat::mcset eo "All Files" "\u0108ioj dosieroj"
- ::msgcat::mcset eo "Application Error" "Aplikoerraro"
+ ::msgcat::mcset eo "All Files" "\u0108iuj dosieroj"
+ ::msgcat::mcset eo "Application Error" "Aplikoeraro"
::msgcat::mcset eo "&Blue" "&Blua"
::msgcat::mcset eo "Cancel" "Rezignu"
::msgcat::mcset eo "&Cancel" "&Rezignu"
- ::msgcat::mcset eo "Cannot change to the directory \"%1\$s\".\nPermission denied." "Neeble \u0109angi al dosierulon \"%1\$s\".\nVi ne rajtas tion."
- ::msgcat::mcset eo "Choose Directory" "Elektu Dosierujo"
- ::msgcat::mcset eo "Cl&ear" "&Klaru"
- ::msgcat::mcset eo "&Clear Console" "&Klaru konzolon"
- ::msgcat::mcset eo "Color" "Farbo"
+ ::msgcat::mcset eo "Cannot change to the directory \"%1\$s\".\nPermission denied." "Neeble \u015dan\u011di al dosierujo \"%1\$s\".\nVi ne rajtas tion."
+ ::msgcat::mcset eo "Choose Directory" "Elektu Dosierujon"
+ ::msgcat::mcset eo "Cl&ear" "&Vakigu"
+ ::msgcat::mcset eo "&Clear Console" "&Vakigu konzolon"
+ ::msgcat::mcset eo "Color" "Koloro"
::msgcat::mcset eo "Console" "Konzolo"
::msgcat::mcset eo "&Copy" "&Kopiu"
- ::msgcat::mcset eo "Cu&t" "&Enpo\u015digu"
- ::msgcat::mcset eo "&Delete" "&Forprenu"
+ ::msgcat::mcset eo "Cu&t" "&Eltondu"
+ ::msgcat::mcset eo "&Delete" "&Forigu"
::msgcat::mcset eo "Details >>" "Detaloj >>"
::msgcat::mcset eo "Directory \"%1\$s\" does not exist." "La dosierujo \"%1\$s\" ne ekzistas."
::msgcat::mcset eo "&Directory:" "&Dosierujo:"
@@ -22,12 +22,12 @@ namespace eval ::tk {
::msgcat::mcset eo "Error: %1\$s" "Eraro: %1\$s"
::msgcat::mcset eo "E&xit" "&Eliru"
::msgcat::mcset eo "&File" "&Dosiero"
- ::msgcat::mcset eo "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "La dosiero \"%1\$s\" jam ekzistas.\n\u0108u vi volas anstata\u00fbigi la dosieron?"
- ::msgcat::mcset eo "File \"%1\$s\" already exists.\n\n" "La dosiero \"%1\$s\" jam egzistas. \n\n"
- ::msgcat::mcset eo "File \"%1\$s\" does not exist." "La dosierp \"%1\$s\" ne estas."
+ ::msgcat::mcset eo "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "La dosiero \"%1\$s\" jam ekzistas.\n\u0108u vi volas anstata\u016digi la dosieron?"
+ ::msgcat::mcset eo "File \"%1\$s\" already exists.\n\n" "La dosiero \"%1\$s\" jam ekzistas. \n\n"
+ ::msgcat::mcset eo "File \"%1\$s\" does not exist." "La dosiero \"%1\$s\" ne ekzistas."
::msgcat::mcset eo "File &name:" "Dosiero&nomo:"
::msgcat::mcset eo "File &names:" "Dosiero&nomoj:"
- ::msgcat::mcset eo "Files of &type:" "Dosieroj de &Typo:"
+ ::msgcat::mcset eo "Files of &type:" "Dosieroj de &Tipo:"
::msgcat::mcset eo "Fi&les:" "Do&sieroj:"
::msgcat::mcset eo "&Filter" "&Filtrilo"
::msgcat::mcset eo "Fil&ter:" "&Filtrilo:"
@@ -37,39 +37,39 @@ namespace eval ::tk {
::msgcat::mcset eo "&Hide Console" "&Ka\u015du konzolon"
::msgcat::mcset eo "&Ignore" "&Ignoru"
::msgcat::mcset eo "Invalid file name \"%1\$s\"." "Malvalida dosieronomo \"%1\$s\"."
- ::msgcat::mcset eo "Log Files" "Protokolo"
+ ::msgcat::mcset eo "Log Files" "Protokolaj dosieroj"
::msgcat::mcset eo "&No" "&Ne"
- ::msgcat::mcset eo "&OK"
- ::msgcat::mcset eo "OK"
- ::msgcat::mcset eo "Ok"
+ ::msgcat::mcset eo "&OK" "&Bone"
+ ::msgcat::mcset eo "OK" "Bone"
+ ::msgcat::mcset eo "Ok" "Bone"
::msgcat::mcset eo "Open" "Malfermu"
::msgcat::mcset eo "&Open" "&Malfermu"
- ::msgcat::mcset eo "Open Multiple Files" "Melfermu multan dosierojn"
- ::msgcat::mcset eo "P&aste" "&Elpo\u015digi"
- ::msgcat::mcset eo "&Quit" "&Finigu"
- ::msgcat::mcset eo "&Red" "&Rosa"
- ::msgcat::mcset eo "Replace existing file?" "\u0108u anstata\u00fbu ekzistantan dosieron?"
- ::msgcat::mcset eo "&Retry" "&Ripetu"
- ::msgcat::mcset eo "&Save" "&Savu"
- ::msgcat::mcset eo "Save As" "Savu kiel"
- ::msgcat::mcset eo "Save To Log" "Savu en protokolon"
+ ::msgcat::mcset eo "Open Multiple Files" "Malfermu plurajn dosierojn"
+ ::msgcat::mcset eo "P&aste" "&Algluu"
+ ::msgcat::mcset eo "&Quit" "&Forlasu"
+ ::msgcat::mcset eo "&Red" "&Ru\u011da"
+ ::msgcat::mcset eo "Replace existing file?" "\u0108u anstata\u016digi ekzistantan dosieron?"
+ ::msgcat::mcset eo "&Retry" "&Reprovu"
+ ::msgcat::mcset eo "&Save" "&Konservu"
+ ::msgcat::mcset eo "Save As" "Konservu kiel"
+ ::msgcat::mcset eo "Save To Log" "Konservu en protokolon"
::msgcat::mcset eo "Select Log File" "Elektu prokolodosieron"
::msgcat::mcset eo "Select a file to source" "Elektu dosieron por interpreti"
::msgcat::mcset eo "&Selection:" "&Elekto:"
- ::msgcat::mcset eo "Skip Messages" "transsaltu pluajn mesa\u011dojn"
+ ::msgcat::mcset eo "Skip Messages" "transsaltu mesa\u011dojn"
::msgcat::mcset eo "&Source..." "&Fontoprogramo..."
::msgcat::mcset eo "Tcl Scripts" "Tcl-skriptoj"
- ::msgcat::mcset eo "Tcl for Windows" "Tcl por vindoso"
- ::msgcat::mcset eo "Text Files" "Tekstodosierojn"
+ ::msgcat::mcset eo "Tcl for Windows" "Tcl por Vindozo"
+ ::msgcat::mcset eo "Text Files" "Tekstodosieroj"
::msgcat::mcset eo "&Yes" "&Jes"
- ::msgcat::mcset eo "abort" "\u0109esigo"
+ ::msgcat::mcset eo "abort" "\u0109esigu"
::msgcat::mcset eo "blue" "blua"
::msgcat::mcset eo "cancel" "rezignu"
- ::msgcat::mcset eo "extension" "ekspansio"
- ::msgcat::mcset eo "extensions" "ekspansioj"
+ ::msgcat::mcset eo "extension" "kromprogramo"
+ ::msgcat::mcset eo "extensions" "kromprogramoj"
::msgcat::mcset eo "green" "verda"
- ::msgcat::mcset eo "ignore" "ignorieren"
+ ::msgcat::mcset eo "ignore" "ignoru"
::msgcat::mcset eo "red" "ru\u011da"
- ::msgcat::mcset eo "retry" "ripetu"
+ ::msgcat::mcset eo "retry" "reprovu"
::msgcat::mcset eo "yes" "jes"
}
diff --git a/library/msgs/ru.msg b/library/msgs/ru.msg
index 2aac5bb..d7ad8b1 100644
--- a/library/msgs/ru.msg
+++ b/library/msgs/ru.msg
@@ -3,13 +3,17 @@ namespace eval ::tk {
::msgcat::mcset ru "&About..." "\u041f\u0440\u043e..."
::msgcat::mcset ru "All Files" "\u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u044b"
::msgcat::mcset ru "Application Error" "\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435"
+ ::msgcat::mcset ru "&Apply" "&\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c"
+ ::msgcat::mcset ru "Bold" "Bold"
+ ::msgcat::mcset ru "Bold Italic" "Bold Italic"
::msgcat::mcset ru "&Blue" " &\u0413\u043e\u043b\u0443\u0431\u043e\u0439"
- ::msgcat::mcset ru "Cancel" "\u041e\u0442&\u043c\u0435\u043d\u0430"
+ ::msgcat::mcset ru "Cancel" "\u041e\u0442\u043c\u0435\u043d\u0430"
::msgcat::mcset ru "&Cancel" "\u041e\u0442&\u043c\u0435\u043d\u0430"
::msgcat::mcset ru "Cannot change to the directory \"%1\$s\".\nPermission denied." \
"\u041d\u0435 \u043c\u043e\u0433\u0443 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \"%1\$s\".\n\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430"
::msgcat::mcset ru "Choose Directory" "\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433"
::msgcat::mcset ru "Cl&ear" "\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c"
+ ::msgcat::mcset ru "&Clear Console" "&Clear Console"
::msgcat::mcset ru "Color" "\u0426\u0432\u0435\u0442"
::msgcat::mcset ru "Console" "\u041a\u043e\u043d\u0441\u043e\u043b\u044c"
::msgcat::mcset ru "&Copy" "\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c"
@@ -18,8 +22,11 @@ namespace eval ::tk {
::msgcat::mcset ru "Details >>" "\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 >>"
::msgcat::mcset ru "Directory \"%1\$s\" does not exist." "\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \"%1\$s\" \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442."
::msgcat::mcset ru "&Directory:" "&\u041a\u0430\u0442\u0430\u043b\u043e\u0433:"
+ ::msgcat::mcset ru "&Edit" "&Edit"
+ ::msgcat::mcset ru "Effects" "\u042d\u0444\u0444\u0435\u043a\u0442\u044b"
::msgcat::mcset ru "Error: %1\$s" "\u041e\u0448\u0438\u0431\u043a\u0430: %1\$s"
::msgcat::mcset ru "E&xit" "\u0412\u044b\u0445\u043e\u0434"
+ ::msgcat::mcset ru "&File" "&File"
::msgcat::mcset ru "File \"%1\$s\" already exists.\nDo you want to overwrite it?" \
"\u0424\u0430\u0439\u043b \"%1\$s\" \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.\n\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e?"
::msgcat::mcset ru "File \"%1\$s\" already exists.\n\n" "\u0424\u0430\u0439\u043b \"%1\$s\" \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.\n\n"
@@ -30,11 +37,16 @@ namespace eval ::tk {
::msgcat::mcset ru "Fi&les:" "\u0424\u0430\u0439&\u043b\u044b:"
::msgcat::mcset ru "&Filter" "&\u0424\u0438\u043b\u044c\u0442\u0440"
::msgcat::mcset ru "Fil&ter:" "\u0424\u0438\u043b\u044c&\u0442\u0440:"
+ ::msgcat::mcset ru "Font" "\u0428\u0440\u0438\u0444\u0442"
+ ::msgcat::mcset ru "&Font:" "&\u0428\u0440\u0438\u0444\u0442"
+ ::msgcat::mcset ru "Font st&yle:" "&\u0421\u0442\u0438\u043b\u044c \u0448\u0440\u0438\u0444\u0442\u0430:"
::msgcat::mcset ru "&Green" " &\u0417\u0435\u043b\u0435\u043d\u044b\u0439"
+ ::msgcat::mcset ru "&Help" "&Help"
::msgcat::mcset ru "Hi" "\u041f\u0440\u0438\u0432\u0435\u0442"
::msgcat::mcset ru "&Hide Console" "\u0421\u043f\u0440\u044f\u0442\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c"
::msgcat::mcset ru "&Ignore" "&\u0418\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c"
::msgcat::mcset ru "Invalid file name \"%1\$s\"." "\u041d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \"%1\$s\"."
+ ::msgcat::mcset ru "Italic" "Italic"
::msgcat::mcset ru "Log Files" "\u0424\u0430\u0439\u043b\u044b \u0436\u0443\u0440\u043d\u0430\u043b\u0430"
::msgcat::mcset ru "&No" "&\u041d\u0435\u0442"
::msgcat::mcset ru "&OK" "&\u041e\u041a"
@@ -46,19 +58,26 @@ namespace eval ::tk {
::msgcat::mcset ru "P&aste" "\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c"
::msgcat::mcset ru "&Quit" "\u0412\u044b\u0445\u043e\u0434"
::msgcat::mcset ru "&Red" " &\u041a\u0440\u0430\u0441\u043d\u044b\u0439"
+ ::msgcat::mcset ru "Regular" "Regular"
::msgcat::mcset ru "Replace existing file?" "\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0444\u0430\u0439\u043b?"
::msgcat::mcset ru "&Retry" "&\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"
+ ::msgcat::mcset ru "Sample" "\u041f\u0440\u0438\u043c\u0435\u0440"
::msgcat::mcset ru "&Save" "&\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c"
::msgcat::mcset ru "Save As" "\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0430\u043a"
::msgcat::mcset ru "Save To Log" "\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0436\u0443\u0440\u043d\u0430\u043b"
::msgcat::mcset ru "Select Log File" "\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0436\u0443\u0440\u043d\u0430\u043b"
::msgcat::mcset ru "Select a file to source" "\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438"
- ::msgcat::mcset ru "&Selection:"
+ ::msgcat::mcset ru "&Selection:" "&Selection:"
+ ::msgcat::mcset ru "&Size:" "&\u0420\u0430\u0437\u043c\u0435\u0440:"
+ ::msgcat::mcset ru "Show &Hidden Directories" "Show &Hidden Directories"
+ ::msgcat::mcset ru "Show &Hidden Files and Directories" "Show &Hidden Files and Directories"
::msgcat::mcset ru "Skip Messages" "\u041f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f"
::msgcat::mcset ru "&Source..." "\u0418\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b..."
+ ::msgcat::mcset ru "Stri&keout" "\u041f&\u0435\u0440\u0435\u0447\u0451\u0440\u043a\u043d\u0443\u0442\u044b\u0439"
::msgcat::mcset ru "Tcl Scripts" "\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 TCL"
::msgcat::mcset ru "Tcl for Windows" "TCL \u0434\u043b\u044f Windows"
::msgcat::mcset ru "Text Files" "\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b"
+ ::msgcat::mcset ru "&Underline" "\u041f\u043e&\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044b\u0439"
::msgcat::mcset ru "&Yes" "&\u0414\u0430"
::msgcat::mcset ru "abort" "\u043e\u0442\u043c\u0435\u043d\u0430"
::msgcat::mcset ru "blue" " \u0433\u043e\u043b\u0443\u0431\u043e\u0439"
@@ -72,4 +91,3 @@ namespace eval ::tk {
::msgcat::mcset ru "retry" "\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"
::msgcat::mcset ru "yes" "\u0434\u0430"
}
-
diff --git a/library/tk.tcl b/library/tk.tcl
index 5bb3be7..3112da0 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -675,15 +675,6 @@ proc ::tk::mcmaxamp {args} {
return $maxlen
}
-# For now, turn off the custom mdef proc for the Mac:
-
-if {[tk windowingsystem] eq "aqua"} {
- namespace eval ::tk::mac {
- set useCustomMDEF 0
- }
-}
-
-
if {[tk windowingsystem] eq "aqua"} {
#stub procedures to respond to "do script" Apple Events
proc ::tk::mac::DoScriptFile {file} {
diff --git a/library/ttk/menubutton.tcl b/library/ttk/menubutton.tcl
index a0f70c9..fc0ea02 100644
--- a/library/ttk/menubutton.tcl
+++ b/library/ttk/menubutton.tcl
@@ -82,7 +82,6 @@ if {[tk windowingsystem] eq "aqua"} {
set bbh [expr {[winfo height $mb]} + $bevelPad]
set mw [winfo reqwidth $menu]
set bw [winfo width $mb]
- set dF [expr {[winfo width $mb] - [winfo reqwidth $menu] - $menuPad}]
set entry [::tk::MenuFindName $menu [$mb cget -text]]
if {$entry < 0} {
set entry 0
@@ -106,7 +105,7 @@ if {[tk windowingsystem] eq "aqua"} {
incr y $menuPad
incr x $bw
}
- default {
+ default { # flush
incr y $bbh
}
}
@@ -118,7 +117,6 @@ if {[tk windowingsystem] eq "aqua"} {
set bh [expr {[winfo height $mb]}]
set mw [expr {[winfo reqwidth $menu]}]
set bw [expr {[winfo width $mb]}]
- set dF [expr {[winfo width $mb] - [winfo reqwidth $menu]}]
if {[tk windowingsystem] eq "win32"} {
incr mh 6
incr mw 16
@@ -154,13 +152,8 @@ if {[tk windowingsystem] eq "aqua"} {
right {
incr x $bw
}
- default {
- if {[$mb cget -style] eq ""} {
- incr x [expr {([winfo width $mb] - \
- [winfo reqwidth $menu])/ 2}]
- } else {
- incr y $bh
- }
+ default { # flush
+ incr x [expr {([winfo width $mb] - [winfo reqwidth $menu])/ 2}]
}
}
return [list $x $y $entry]
diff --git a/library/ttk/panedwindow.tcl b/library/ttk/panedwindow.tcl
index 0fd9bd7..1989b89 100644
--- a/library/ttk/panedwindow.tcl
+++ b/library/ttk/panedwindow.tcl
@@ -45,9 +45,9 @@ proc ttk::panedwindow::Press {w x y} {
proc ttk::panedwindow::Drag {w x y} {
variable State
if {!$State(pressed)} { return }
- switch -- [$w cget -orient] {
- horizontal { set delta [expr {$x - $State(pressX)}] }
- vertical { set delta [expr {$y - $State(pressY)}] }
+ switch -glob -- [$w cget -orient] {
+ h* { set delta [expr {$x - $State(pressX)}] }
+ v* { set delta [expr {$y - $State(pressY)}] }
}
$w sashpos $State(sash) [expr {$State(sashPos) + $delta}]
}
@@ -80,9 +80,9 @@ proc ttk::panedwindow::SetCursor {w x y} {
set cursor $State(userConfCursor)
if {[llength [$w identify $x $y]]} {
# Assume we're over a sash.
- switch -- [$w cget -orient] {
- horizontal { set cursor hresize }
- vertical { set cursor vresize }
+ switch -glob -- [$w cget -orient] {
+ h* { set cursor hresize }
+ v* { set cursor vresize }
}
}
ttk::setCursor $w $cursor
diff --git a/macosx/README b/macosx/README
index 4ed334f..db51db2 100644
--- a/macosx/README
+++ b/macosx/README
@@ -548,7 +548,7 @@ appropriate place to drain the main NSAutoreleasePool and replace it
with a new pool. This is done by calling the method [NSApp
_resetAutoreleasePool], where _resetAutoreleasePool is a method which
we define for the subclass. Unfortunately, by itself this is not
-sufficient for safe memory managememt because, as was made painfully
+sufficient for safe memory management because, as was made painfully
evident with the release of OS X 10.13, it is possible for calls to
TclDoOneEvent, and hence to CheckProc, to be nested. Draining the
autorelease pool in a nested call leads to crashes as objects in use
diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c
index 4f51fc6..1951518 100644
--- a/macosx/tkMacOSXBitmap.c
+++ b/macosx/tkMacOSXBitmap.c
@@ -13,6 +13,7 @@
#include "tkMacOSXPrivate.h"
#include "tkMacOSXConstants.h"
+
/*
* This structure holds information about native bitmaps.
*/
@@ -49,8 +50,8 @@ static BuiltInIcon builtInIcons[] = {
#define builtInIconSize 32
-#define OSTYPE_TO_UTI(x) (NSString *)UTTypeCreatePreferredIdentifierForTag( \
- kUTTagClassOSType, UTCreateStringForOSType(x), nil)
+#define OSTYPE_TO_UTI(x) ((NSString *)UTTypeCreatePreferredIdentifierForTag( \
+ kUTTagClassOSType, UTCreateStringForOSType(x), nil))
static Tcl_HashTable iconBitmapTable = {};
typedef struct {
@@ -174,9 +175,8 @@ TkpCreateNativeBitmap(
Display *display,
const void *source) /* Info about the icon to build. */
{
- NSString *iconUTI = OSTYPE_TO_UTI(PTR2UINT(source));
- NSImage *iconImage = [[NSWorkspace sharedWorkspace]
- iconForFileType: iconUTI];
+ NSString *filetype = [NSString stringWithUTF8String:(char *)source];
+ NSImage *iconImage = TkMacOSXIconForFileType(filetype);
CGSize size = CGSizeMake(builtInIconSize, builtInIconSize);
Pixmap pixmap = PixmapFromImage(display, iconImage, size);
return pixmap;
@@ -253,7 +253,6 @@ TkpGetNativeAppBitmap(
NSString *string;
NSImage *image = nil;
NSSize size = { .width = builtInIconSize, .height = builtInIconSize };
-
if (iconBitmapTable.buckets &&
(hPtr = Tcl_FindHashEntry(&iconBitmapTable, name))) {
OSType type;
@@ -268,12 +267,12 @@ TkpGetNativeAppBitmap(
break;
case ICON_FILETYPE:
string = [NSString stringWithUTF8String:iconBitmap->value];
- image = [[NSWorkspace sharedWorkspace] iconForFileType:string];
+ image = TkMacOSXIconForFileType(string);
break;
case ICON_OSTYPE:
if (OSTypeFromString(iconBitmap->value, &type) == TCL_OK) {
- string = NSFileTypeForHFSTypeCode(type);
- image = [[NSWorkspace sharedWorkspace] iconForFileType:string];
+ string = [NSString stringWithUTF8String:iconBitmap->value];
+ image = TkMacOSXIconForFileType(string);
}
break;
case ICON_SYSTEMTYPE:
@@ -312,11 +311,15 @@ TkpGetNativeAppBitmap(
*height = size.height;
pixmap = PixmapFromImage(display, image, NSSizeToCGSize(size));
} else if (name) {
+ /*
+ * As a last resort, try to interpret the name as an OSType.
+ * It would probably be better to just return None at this
+ * point.
+ */
OSType iconType;
if (OSTypeFromString(name, &iconType) == TCL_OK) {
- NSString *iconUTI = OSTYPE_TO_UTI(iconType);
- NSImage *iconImage = [[NSWorkspace sharedWorkspace]
- iconForFileType: iconUTI];
+ NSString *iconUTI = TkMacOSXOSTypeToUTI(iconType);
+ NSImage *iconImage = TkMacOSXIconForFileType(iconUTI);
pixmap = PixmapFromImage(display, iconImage, NSSizeToCGSize(size));
}
}
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index 3951683..2037dfbd 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -7,7 +7,7 @@
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1996 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2001-2009 Apple Inc.
* Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
* Copyright (c) 2020 Marc Culler
*
@@ -31,6 +31,7 @@ static SystemColorDatum **systemColorIndex;
static NSAppearance *lightAqua = nil;
static NSAppearance *darkAqua = nil;
#endif
+
static NSColorSpace* sRGB = NULL;
static const CGFloat WINDOWBACKGROUND[4] =
{236.0 / 255, 236.0 / 255, 236.0 / 255, 1.0};
@@ -299,7 +300,7 @@ GetRGBA(
/*
* Prior to OSX 10.14, getComponents returns black when applied to
- * windowBackGroundColor.
+ * windowBackgroundColor.
*/
if ([NSApp macOSVersion] < 101400) {
@@ -417,6 +418,7 @@ SetCGColorComponents(
if (entry->type == HIBrush) {
OSStatus err = ChkErr(HIThemeBrushCreateCGColor, entry->value, c);
+ [pool drain];
return err == noErr;
}
GetRGBA(entry, pixel, rgba);
@@ -456,10 +458,12 @@ TkMacOSXInDarkMode(Tk_Window tkwin)
if (view) {
name = [[view effectiveAppearance] name];
} else {
- name = [[NSAppearance currentAppearance] name];
+ name = [[NSApp effectiveAppearance] name];
}
return (name == NSAppearanceNameDarkAqua);
}
+#else
+ (void) tkwin;
#endif
return false;
}
@@ -517,16 +521,19 @@ TkSetMacColor(
NSColor*
TkMacOSXGetNSColor(
- GC gc,
+ TCL_UNUSED(GC),
unsigned long pixel) /* Pixel value to convert. */
{
- CGColorRef cgColor;
+ CGColorRef cgColor = NULL;
NSColor *nsColor = nil;
TkSetMacColor(pixel, &cgColor);
- nsColor = [NSColor colorWithColorSpace:sRGB
- components:CGColorGetComponents(cgColor)
- count:CGColorGetNumberOfComponents(cgColor)];
+ if (cgColor) {
+ nsColor = [NSColor colorWithColorSpace:sRGB
+ components:CGColorGetComponents(cgColor)
+ count:CGColorGetNumberOfComponents(cgColor)];
+ CGColorRelease(cgColor);
+ }
return nsColor;
}
@@ -550,12 +557,12 @@ TkMacOSXGetNSColor(
void
TkMacOSXSetColorInContext(
- GC gc,
+ TCL_UNUSED(GC),
unsigned long pixel,
CGContextRef context)
{
OSStatus err = noErr;
- CGColorRef cgColor = nil;
+ CGColorRef cgColor = NULL;
SystemColorDatum *entry = GetEntryFromPixel(pixel);
CGRect rect;
HIThemeBackgroundDrawInfo info = {0, kThemeStateActive, 0};
@@ -630,11 +637,9 @@ TkpGetColor(
Colormap colormap = tkwin ? Tk_Colormap(tkwin) : noColormap;
NSView *view = nil;
static Bool initialized = NO;
- static NSColorSpace* sRGB = nil;
if (!initialized) {
initialized = YES;
- sRGB = [NSColorSpace sRGBColorSpace];
initColorTable();
}
if (tkwin) {
@@ -653,7 +658,7 @@ TkpGetColor(
if (hPtr != NULL) {
SystemColorDatum *entry = (SystemColorDatum *)Tcl_GetHashValue(hPtr);
- CGColorRef c;
+ CGColorRef c = NULL;
p.pixel.colortype = entry->type;
p.pixel.value = entry->index;
@@ -662,19 +667,32 @@ TkpGetColor(
CGFloat rgba[4];
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
if (@available(macOS 10.14, *)) {
- NSAppearance *savedAppearance = [NSAppearance currentAppearance];
- NSAppearance *windowAppearance = savedAppearance;
+ NSAppearance *windowAppearance;
if (view) {
windowAppearance = [view effectiveAppearance];
+ } else {
+ windowAppearance = [NSApp effectiveAppearance];
}
if ([windowAppearance name] == NSAppearanceNameDarkAqua) {
colormap = darkColormap;
} else {
colormap = lightColormap;
}
- [NSAppearance setCurrentAppearance:windowAppearance];
- GetRGBA(entry, p.ulong, rgba);
- [NSAppearance setCurrentAppearance:savedAppearance];
+ if (@available(macOS 11.0, *)) {
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
+ CGFloat *rgbaPtr = rgba;
+ [windowAppearance performAsCurrentDrawingAppearance:^{
+ GetRGBA(entry, p.ulong, rgbaPtr);
+ }];
+#endif
+ } else {
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 110000
+ NSAppearance *savedAppearance = [NSAppearance currentAppearance];
+ [NSAppearance setCurrentAppearance:windowAppearance];
+ GetRGBA(entry, p.ulong, rgba);
+ [NSAppearance setCurrentAppearance:savedAppearance];
+#endif
+ }
} else {
GetRGBA(entry, p.ulong, rgba);
}
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index f850fbb..5170545 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -6,7 +6,8 @@
* Copyright (c) 1996-1997 Sun Microsystems, Inc.
* Copyright (c) 2001-2009, Apple Inc.
* Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright (c) 2017 Christian Gollwitzer.
+ * Copyright (c) 2017 Christian Gollwitzer
+ * Copyright (c) 2022 Marc Culler
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -26,6 +27,30 @@
#define modalOther -1 // indicates that the -command option was used.
#define modalError -2
+static void setAllowedFileTypes(
+ NSSavePanel *panel,
+ NSMutableArray *extensions)
+{
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
+/* UTType exists in the SDK */
+ if (@available(macOS 11.0, *)) {
+ NSMutableArray<UTType *> *allowedTypes = [NSMutableArray array];
+ for (NSString *ext in extensions) {
+ UTType *uttype = [UTType typeWithFilenameExtension: ext];
+ [allowedTypes addObject:uttype];
+ }
+ [panel setAllowedContentTypes:allowedTypes];
+ } else {
+# if MAC_OS_X_VERSION_MIN_REQUIRED < 110000
+/* setAllowedFileTypes is not deprecated */
+ [panel setAllowedFileTypes:extensions];
+#endif
+ }
+#else
+ [panel setAllowedFileTypes:extensions];
+#endif
+}
+
/*
* Vars for filtering in "open file" and "save file" dialogs.
*/
@@ -93,7 +118,7 @@ static const char *const chooseOptionStrings[] = {
};
enum chooseOptions {
CHOOSE_INITDIR, CHOOSE_MESSAGE, CHOOSE_MUSTEXIST, CHOOSE_PARENT,
- CHOOSE_TITLE, CHOOSE_COMMAND,
+ CHOOSE_TITLE, CHOOSE_COMMAND
};
typedef struct {
Tcl_Interp *interp;
@@ -107,7 +132,7 @@ static const char *const alertOptionStrings[] = {
};
enum alertOptions {
ALERT_DEFAULT, ALERT_DETAIL, ALERT_ICON, ALERT_MESSAGE, ALERT_PARENT,
- ALERT_TITLE, ALERT_TYPE, ALERT_COMMAND,
+ ALERT_TITLE, ALERT_TYPE, ALERT_COMMAND
};
typedef struct {
Tcl_Interp *interp;
@@ -302,11 +327,11 @@ getFileURL(
* any file.
*/
- [openpanel setAllowedFileTypes:nil];
+ setAllowedFileTypes(openpanel, nil);
} else {
NSMutableArray *allowedtypes =
[filterInfo.fileTypeExtensions objectAtIndex:filterInfo.fileTypeIndex];
- [openpanel setAllowedFileTypes:allowedtypes];
+ setAllowedFileTypes(openpanel, allowedtypes);
[openpanel setAllowsOtherFileTypes:NO];
}
@@ -319,11 +344,11 @@ getFileURL(
if ([[filterInfo.fileTypeAllowsAll objectAtIndex:filterInfo.fileTypeIndex] boolValue]) {
[savepanel setAllowsOtherFileTypes:YES];
- [savepanel setAllowedFileTypes:nil];
+ setAllowedFileTypes(savepanel, nil);
} else {
NSMutableArray *allowedtypes =
[filterInfo.fileTypeExtensions objectAtIndex:filterInfo.fileTypeIndex];
- [savepanel setAllowedFileTypes:allowedtypes];
+ setAllowedFileTypes(savepanel, allowedtypes);
[savepanel setAllowsOtherFileTypes:NO];
}
@@ -461,7 +486,7 @@ Tk_ChooseColorObjCmd(
[colorPanel setShowsAlpha: NO];
[colorPanel _setUseModalAppearance:YES];
if (title) {
- NSString *s = [[NSString alloc] initWithUTF8String:title];
+ NSString *s = [[TKNSString alloc] initWithTclUtfBytes:title length:-1];
[colorPanel setTitle:s];
[s release];
@@ -533,7 +558,7 @@ parseFileFilters(
if (filterInfo.doFileTypes) {
for (FileFilter *filterPtr = fl.filters; filterPtr;
filterPtr = filterPtr->next) {
- NSString *name = [[NSString alloc] initWithUTF8String: filterPtr->name];
+ NSString *name = [[TKNSString alloc] initWithTclUtfBytes: filterPtr->name length:-1];
[filterInfo.fileTypeNames addObject:name];
[name release];
@@ -551,7 +576,7 @@ parseFileFilters(
str++;
}
if (*str) {
- NSString *extension = [[NSString alloc] initWithUTF8String:str];
+ NSString *extension = [[TKNSString alloc] initWithTclUtfBytes:str length:-1];
if (![filterInfo.allowedExtensions containsObject:extension]) {
[filterInfo.allowedExtensions addObject:extension];
}
@@ -604,7 +629,7 @@ parseFileFilters(
const char *selectedFileType =
Tcl_GetString(selectedFileTypeObj);
NSString *selectedFileTypeStr =
- [[NSString alloc] initWithUTF8String:selectedFileType];
+ [[TKNSString alloc] initWithTclUtfBytes:selectedFileType length:-1];
NSUInteger index =
[filterInfo.fileTypeNames indexOfObject:selectedFileTypeStr];
@@ -695,20 +720,21 @@ Tk_GetOpenFileObjCmd(
case OPEN_INITDIR:
str = Tcl_GetStringFromObj(objv[i + 1], &len);
if (len) {
- directory = [[[NSString alloc] initWithUTF8String:str]
+ directory = [[[TKNSString alloc] initWithTclUtfBytes:str length:len]
autorelease];
}
break;
case OPEN_INITFILE:
str = Tcl_GetStringFromObj(objv[i + 1], &len);
if (len) {
- filename = [[[NSString alloc] initWithUTF8String:str]
+ filename = [[[TKNSString alloc] initWithTclUtfBytes:str length:len]
autorelease];
}
break;
case OPEN_MESSAGE:
- message = [[NSString alloc] initWithUTF8String:
- Tcl_GetString(objv[i + 1])];
+ str = Tcl_GetStringFromObj(objv[i + 1], &len);
+ message = [[TKNSString alloc] initWithTclUtfBytes:
+ str length:len];
break;
case OPEN_MULTIPLE:
if (Tcl_GetBooleanFromObj(interp, objv[i + 1],
@@ -725,8 +751,9 @@ Tk_GetOpenFileObjCmd(
haveParentOption = 1;
break;
case OPEN_TITLE:
- title = [[NSString alloc] initWithUTF8String:
- Tcl_GetString(objv[i + 1])];
+ str = Tcl_GetStringFromObj(objv[i + 1], &len);
+ title = [[TKNSString alloc] initWithTclUtfBytes:
+ str length:len];
break;
case OPEN_TYPEVARIABLE:
typeVariablePtr = objv[i + 1];
@@ -801,9 +828,9 @@ Tk_GetOpenFileObjCmd(
[openpanel setAllowedFileTypes:filterInfo.fileTypeExtensions[filterInfo.fileTypeIndex]];
*/
- [openpanel setAllowedFileTypes:filterInfo.allowedExtensions];
+ setAllowedFileTypes(openpanel, filterInfo.allowedExtensions);
} else {
- [openpanel setAllowedFileTypes:filterInfo.allowedExtensions];
+ setAllowedFileTypes(openpanel, filterInfo.allowedExtensions);
}
if (filterInfo.allowedExtensionsAllowAll) {
[openpanel setAllowsOtherFileTypes:YES];
@@ -960,10 +987,10 @@ Tk_GetSaveFileObjCmd(
case SAVE_DEFAULT:
str = Tcl_GetStringFromObj(objv[i + 1], &len);
while (*str && (*str == '*' || *str == '.')) {
- str++;
+ str++; len--;
}
if (*str) {
- defaultType = [[[NSString alloc] initWithUTF8String:str]
+ defaultType = [[[TKNSString alloc] initWithTclUtfBytes:str length:len]
autorelease];
}
break;
@@ -973,21 +1000,22 @@ Tk_GetSaveFileObjCmd(
case SAVE_INITDIR:
str = Tcl_GetStringFromObj(objv[i + 1], &len);
if (len) {
- directory = [[[NSString alloc] initWithUTF8String:str]
+ directory = [[[TKNSString alloc] initWithTclUtfBytes:str length:len]
autorelease];
}
break;
case SAVE_INITFILE:
str = Tcl_GetStringFromObj(objv[i + 1], &len);
if (len) {
- filename = [[[NSString alloc] initWithUTF8String:str]
+ filename = [[[TKNSString alloc] initWithTclUtfBytes:str length:len]
autorelease];
[savepanel setNameFieldStringValue:filename];
}
break;
case SAVE_MESSAGE:
- message = [[NSString alloc] initWithUTF8String:
- Tcl_GetString(objv[i + 1])];
+ str = Tcl_GetStringFromObj(objv[i + 1], &len);
+ message = [[TKNSString alloc] initWithTclUtfBytes:
+ str length:len];
break;
case SAVE_PARENT:
str = Tcl_GetStringFromObj(objv[i + 1], &len);
@@ -998,8 +1026,9 @@ Tk_GetSaveFileObjCmd(
haveParentOption = 1;
break;
case SAVE_TITLE:
- title = [[NSString alloc] initWithUTF8String:
- Tcl_GetString(objv[i + 1])];
+ str = Tcl_GetStringFromObj(objv[i + 1], &len);
+ title = [[TKNSString alloc] initWithTclUtfBytes:
+ str length:len];
break;
case SAVE_TYPEVARIABLE:
typeVariablePtr = objv[i + 1];
@@ -1072,7 +1101,8 @@ Tk_GetSaveFileObjCmd(
[savepanel setAccessoryView:accessoryView];
- [savepanel setAllowedFileTypes:[filterInfo.fileTypeExtensions objectAtIndex:filterInfo.fileTypeIndex]];
+ setAllowedFileTypes(savepanel,
+ [filterInfo.fileTypeExtensions objectAtIndex:filterInfo.fileTypeIndex]);
[savepanel setAllowsOtherFileTypes:filterInfo.allowedExtensionsAllowAll];
} else if (defaultType) {
/*
@@ -1084,7 +1114,7 @@ Tk_GetSaveFileObjCmd(
NSMutableArray *AllowedFileTypes = [NSMutableArray array];
[AllowedFileTypes addObject:defaultType];
- [savepanel setAllowedFileTypes:AllowedFileTypes];
+ setAllowedFileTypes(savepanel, AllowedFileTypes);
[savepanel setAllowsOtherFileTypes:YES];
}
@@ -1198,13 +1228,14 @@ Tk_ChooseDirectoryObjCmd(
case CHOOSE_INITDIR:
str = Tcl_GetStringFromObj(objv[i + 1], &len);
if (len) {
- directory = [[[NSString alloc] initWithUTF8String:str]
+ directory = [[[TKNSString alloc] initWithTclUtfBytes:str length:len]
autorelease];
}
break;
case CHOOSE_MESSAGE:
- message = [[NSString alloc] initWithUTF8String:
- Tcl_GetString(objv[i + 1])];
+ str = Tcl_GetStringFromObj(objv[i + 1], &len);
+ message = [[TKNSString alloc] initWithTclUtfBytes:
+ str length:len];
[panel setMessage:message];
[message release];
break;
@@ -1223,8 +1254,9 @@ Tk_ChooseDirectoryObjCmd(
haveParentOption = 1;
break;
case CHOOSE_TITLE:
- title = [[NSString alloc] initWithUTF8String:
- Tcl_GetString(objv[i + 1])];
+ str = Tcl_GetStringFromObj(objv[i + 1], &len);
+ title = [[TKNSString alloc] initWithTclUtfBytes:
+ str length:len];
[panel setTitle:title];
[title release];
break;
@@ -1387,8 +1419,9 @@ Tk_MessageBoxObjCmd(
break;
case ALERT_DETAIL:
- message = [[NSString alloc] initWithUTF8String:
- Tcl_GetString(objv[i + 1])];
+ str = Tcl_GetString(objv[i + 1]);
+ message = [[TKNSString alloc] initWithTclUtfBytes:
+ str length:-1];
[alert setInformativeText:message];
[message release];
break;
@@ -1401,8 +1434,9 @@ Tk_MessageBoxObjCmd(
break;
case ALERT_MESSAGE:
- message = [[NSString alloc] initWithUTF8String:
- Tcl_GetString(objv[i + 1])];
+ str = Tcl_GetString(objv[i + 1]);
+ message = [[TKNSString alloc] initWithTclUtfBytes:
+ str length:-1];
[alert setMessageText:message];
[message release];
break;
@@ -1417,8 +1451,9 @@ Tk_MessageBoxObjCmd(
break;
case ALERT_TITLE:
- title = [[NSString alloc] initWithUTF8String:
- Tcl_GetString(objv[i + 1])];
+ str = Tcl_GetString(objv[i + 1]);
+ title = [[TKNSString alloc] initWithTclUtfBytes:
+ str length:-1];
[[alert window] setTitle:title];
[title release];
break;
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index d5396eb..874d3cc 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -514,7 +514,7 @@ XDrawSegments(
*
* XFillPolygon --
*
- * Draws a filled polygon using the even-odd fill algorithm,
+ * Draws a filled polygon.
*
* Results:
* None.
@@ -562,7 +562,9 @@ XFillPolygon(
CGContextAddLineToPoint(dc.context, prevx, prevy);
}
}
- CGContextEOFillPath(dc.context);
+ (gc->fill_rule == EvenOddRule)
+ ? CGContextEOFillPath(dc.context)
+ : CGContextFillPath(dc.context);
}
TkMacOSXRestoreDrawingContext(&dc);
return Success;
@@ -1142,72 +1144,52 @@ TkScrollWindow(
Drawable drawable = Tk_WindowId(tkwin);
MacDrawable *macDraw = (MacDrawable *)drawable;
TKContentView *view = (TKContentView *)TkMacOSXGetNSViewForDrawable(macDraw);
- CGRect srcRect, dstRect;
- HIShapeRef dmgRgn = NULL, extraRgn = NULL;
- NSRect bounds, visRect, scrollSrc, scrollDst;
+ HIShapeRef srcRgn, dstRgn;
+ HIMutableShapeRef dmgRgn = HIShapeCreateMutable();
+ NSRect bounds, viewSrcRect, srcRect, dstRect;
int result = 0;
if (view) {
+
/*
* Get the scroll area in NSView coordinates (origin at bottom left).
*/
bounds = [view bounds];
- scrollSrc = NSMakeRect(macDraw->xOff + x,
+ viewSrcRect = NSMakeRect(macDraw->xOff + x,
bounds.size.height - height - (macDraw->yOff + y),
width, height);
- scrollDst = NSOffsetRect(scrollSrc, dx, -dy);
- /*
- * Limit scrolling to the window content area.
+ /*
+ * Scroll the rectangle.
*/
- visRect = [view visibleRect];
- scrollSrc = NSIntersectionRect(scrollSrc, visRect);
- scrollDst = NSIntersectionRect(scrollDst, visRect);
- if (!NSIsEmptyRect(scrollSrc) && !NSIsEmptyRect(scrollDst)) {
- /*
- * Mark the difference between source and destination as damaged.
- * This region is described in NSView coordinates (y=0 at the
- * bottom) and converted to Tk coordinates later.
- */
-
- srcRect = CGRectMake(x, y, width, height);
- dstRect = CGRectOffset(srcRect, dx, dy);
+ [view scrollRect:viewSrcRect by:NSMakeSize(dx, -dy)];
- /*
- * Compute the damage.
- */
+ /*
+ * Compute the damage region, using Tk coordinates (origin at top left).
+ */
- dmgRgn = HIShapeCreateMutableWithRect(&srcRect);
- extraRgn = HIShapeCreateWithRect(&dstRect);
- ChkErr(HIShapeDifference, dmgRgn, extraRgn,
- (HIMutableShapeRef) dmgRgn);
- result = HIShapeIsEmpty(dmgRgn) ? 0 : 1;
+ srcRect = CGRectMake(x, y, width, height);
+ dstRect = CGRectOffset(srcRect, dx, dy);
+ srcRgn = HIShapeCreateWithRect(&srcRect);
+ dstRgn = HIShapeCreateWithRect(&dstRect);
+ ChkErr(HIShapeDifference, srcRgn, dstRgn, dmgRgn);
+ result = HIShapeIsEmpty(dmgRgn) ? 0 : 1;
- /*
- * Convert to Tk coordinates, offset by the window origin.
- */
+ }
- TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn);
- if (extraRgn) {
- CFRelease(extraRgn);
- }
+ /*
+ * Convert the HIShape dmgRgn into a TkRegion and store it.
+ */
- /*
- * Scroll the rectangle.
- */
+ TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn);
- [view scrollRect:scrollSrc by:NSMakeSize(dx, -dy)];
- }
- } else {
- dmgRgn = HIShapeCreateEmpty();
- TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn);
- }
+ /*
+ * Mutable shapes are not reference counted, and must be released.
+ */
- if (dmgRgn) {
- CFRelease(dmgRgn);
- }
+ CFRelease(dmgRgn);
return result;
}
diff --git a/macosx/tkMacOSXFileTypes.c b/macosx/tkMacOSXFileTypes.c
new file mode 100644
index 0000000..66e4fbb
--- /dev/null
+++ b/macosx/tkMacOSXFileTypes.c
@@ -0,0 +1,122 @@
+/*
+There are situations where a graphical user interface needs to know the file
+type (i.e. data format) of a file. The two main ones are when generating an
+icon to represent a file, and when filtering the choice of files in a file
+open or save dialog.
+
+Early Macintosh systems used OSTypes as identifiers for file types. An OSType
+is a FourCC datatype - four bytes which can be packed into a 32 bit integer. In
+the HFS filesystem they were included in the file metadata. The metadata also
+included another OSType (the Creator Code) which identified the application
+which created the file.
+
+In OSX 10.4 the Uniform Type Identifier was introduced as an alternative way to
+describe file types. These are strings (NSStrings, actually) in a reverse DNS
+format, such as "com.apple.application-bundle". Apple provided a tool for
+converting OSType codes to Uniform Type Identifiers, which they deprecated in
+macOS 12.0 after introducing the UTType class in macOS 11.0. An instance of the
+UTType class has properties which give the Uniform Type Identifier as well as
+the preferred file name extension for a given file type.
+
+This module provides tools for working with file types which are meant to abstract
+the many variants that Apple has used over the years, and which can be used
+without generating deprecation warnings.
+*/
+
+#include "tkMacOSXPrivate.h"
+#include "tkMacOSXFileTypes.h"
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
+#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
+#endif
+
+#define CHARS_TO_OSTYPE(string) (OSType) string[0] << 24 | \
+ (OSType) string[1] << 16 | \
+ (OSType) string[2] << 8 | \
+ (OSType) string[3]
+
+static BOOL initialized = false;
+static Tcl_HashTable ostype2identifier;
+static void initOSTypeTable(void) {
+ int newPtr;
+ Tcl_HashEntry *hPtr;
+ const IdentifierForOSType *entry;
+ Tcl_InitHashTable(&ostype2identifier, TCL_ONE_WORD_KEYS);
+ for (entry = OSTypeDB; entry->ostype != NULL; entry++) {
+ const char *key = INT2PTR(CHARS_TO_OSTYPE(entry->ostype));
+ hPtr = Tcl_CreateHashEntry(&ostype2identifier, key, &newPtr);
+ if (newPtr) {
+ Tcl_SetHashValue(hPtr, entry->identifier);
+ }
+ }
+ initialized = true;
+}
+
+MODULE_SCOPE NSString *TkMacOSXOSTypeToUTI(OSType ostype) {
+ if (!initialized) {
+ initOSTypeTable();
+ }
+ Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&ostype2identifier, INT2PTR(ostype));
+ if (hPtr) {
+ char *UTI = Tcl_GetHashValue(hPtr);
+ return [[NSString alloc] initWithCString:UTI
+ encoding:NSASCIIStringEncoding];
+ }
+ return nil;
+}
+
+/*
+ * The NSWorkspace method iconForFileType, which was deprecated in macOS 12.0, would
+ * accept an NSString which could be an encoding of an OSType, or a file extension,
+ * or a Uniform Type Idenfier. This function can serve as a replacement.
+ */
+MODULE_SCOPE NSImage *TkMacOSXIconForFileType(NSString *filetype) {
+ if (!initialized) {
+ initOSTypeTable();
+ }
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 110000
+// We don't have UTType but iconForFileType is not deprecated, so use it.
+ return [[NSWorkspace sharedWorkspace] iconForFileType:filetype];
+#else
+// We might have UTType but iconForFileType might be deprecated.
+ if (@available(macOS 11.0, *)) {
+ /* Yes, we do have UTType */
+ UTType *uttype = [UTType typeWithIdentifier: filetype];
+ if (uttype == nil || !uttype.isDeclared) {
+ uttype = [UTType typeWithFilenameExtension: filetype];
+ }
+ if (uttype == nil || (!uttype.isDeclared && filetype.length == 4)) {
+ OSType ostype = CHARS_TO_OSTYPE(filetype.UTF8String);
+ NSString *UTI = TkMacOSXOSTypeToUTI(ostype);
+ if (UTI) {
+ uttype = [UTType typeWithIdentifier:UTI];
+ }
+ }
+ if (uttype == nil || !uttype.isDeclared) {
+ return nil;
+ }
+ return [[NSWorkspace sharedWorkspace] iconForContentType:uttype];
+ } else {
+ /* No, we don't have UTType. */
+ #if MAC_OS_X_VERSION_MIN_REQUIRED < 110000
+ /* but iconForFileType is not deprecated, so we can use it. */
+ return [[NSWorkspace sharedWorkspace] iconForFileType:filetype];
+ #else
+ /*
+ * Cannot be reached: MIN_REQUIRED >= 110000 yet 11.0 is not available.
+ * But the compiler can't figure that out, so it will warn about an
+ * execution path with no return value unless we put a return here.
+ */
+ return nil;
+ #endif
+ }
+#endif
+}
+
+/*
+ * Local Variables:
+ * mode: objc
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXFileTypes.h b/macosx/tkMacOSXFileTypes.h
new file mode 100644
index 0000000..1c11d29
--- /dev/null
+++ b/macosx/tkMacOSXFileTypes.h
@@ -0,0 +1,144 @@
+/*
+Apple never published a database of OSType codes for File Types. However,
+a database of known OSType codes representing Creators and File Types used on
+Apple systems prior to 2003 is available at:
+
+ http://www.lacikam.co.il/tcdb/download/TCDBdata.zip
+
+Among the 12034 distinct OSType codes for File Types that are listed in the TCDB
+database, there are 121 for which the UTTypeCreatePreferredIdentifierForTag
+function (deprecated in macOS 12.0) was able to generate a Uniform Type
+Identifier on macOS 12.5.1. The mapping from those OSTypes to Uniform Type
+identifiers is given by the following array, in which OSTypes are represented as
+strings of length 4.
+*/
+
+typedef struct {
+ char *ostype;
+ char *identifier;
+} IdentifierForOSType;
+
+static const IdentifierForOSType OSTypeDB[] = {
+ {".SGI", "com.sgi.sgi-image"},
+ {".WAV", "com.microsoft.waveform-audio"},
+ {"8BPS", "com.adobe.photoshop-image"},
+ {"ABPR", "com.apple.addressbook.person"},
+ {"AIFC", "public.aifc-audio"},
+ {"AIFF", "public.aiff-audio"},
+ {"APPC", "com.apple.deprecated-application-file"},
+ {"APPD", "com.apple.deprecated-application-file"},
+ {"APPL", "com.apple.application-bundle"},
+ {"ASF_", "com.microsoft.advanced-systems-format"},
+ {"ASX_", "com.microsoft.advanced-stream-redirector"},
+ {"BMP ", "com.microsoft.bmp"},
+ {"BMPf", "com.microsoft.bmp"},
+ {"BNDL", "com.apple.generic-bundle"},
+ {"DDim", "com.apple.disk-image-raw"},
+ {"DICM", "org.nema.dicom"},
+ {"DOTM", "org.openxmlformats.wordprocessingml.template.macro-enabled"},
+ {"EM3F", "com.apple.logic-song"},
+ {"EPSF", "com.adobe.encapsulated-postscript"},
+ {"FFIL", "com.apple.font-suitcase"},
+ {"FLI ", "public.flc-animation"},
+ {"FNDR", "com.apple.legacy.finder-icon"},
+ {"GIFf", "com.compuserve.gif"},
+ {"HTML", "public.html"},
+ {"JPEG", "public.jpeg"},
+ {"LWFN", "com.adobe.postscript-lwfn-font"},
+ {"MP3 ", "public.mp3"},
+ {"MP3!", "public.mp3"},
+ {"MP3U", "com.apple.tv.m3u-playlist"},
+ {"MPEG", "public.mpeg"},
+ {"MPG ", "public.mpeg"},
+ {"MPG2", "com.apple.music.mp2"},
+ {"MPG3", "public.mp3"},
+ {"Midi", "public.midi-audio"},
+ {"MooV", "com.apple.quicktime-movie"},
+ {"Mp3 ", "public.mp3"},
+ {"PAT ", "org.gimp.pat"},
+ {"PDF ", "com.adobe.pdf"},
+ {"PICT", "com.apple.pict"},
+ {"PNGf", "public.png"},
+ {"PNRA", "com.real.realaudio"},
+ {"PNRM", "com.real.realmedia"},
+ {"PNTG", "com.apple.macpaint-image"},
+ {"PPOT", "com.microsoft.powerpoint.pot"},
+ {"PPSS", "com.microsoft.powerpoint.pps"},
+ {"RTF ", "public.rtf"},
+ {"SDP ", "public.sdp"},
+ {"SIT5", "com.stuffit.archive.sit"},
+ {"SLD8", "com.microsoft.powerpoint.ppt"},
+ {"Sd2f", "com.digidesign.sd2-audio"},
+ {"TEXT", "com.apple.traditional-mac-plain-text"},
+ {"TIFF", "public.tiff"},
+ {"TPIC", "com.truevision.tga-image"},
+ {"ULAW", "public.ulaw-audio"},
+ {"VfW ", "public.avi"},
+ {"W8BN", "com.microsoft.word.doc"},
+ {"W8TN", "com.microsoft.word.dot"},
+ {"WAVE", "com.microsoft.waveform-audio"},
+ {"XLA5", "com.microsoft.excel.xla"},
+ {"XLS8", "com.microsoft.excel.xls"},
+ {"XLW8", "com.microsoft.excel.xlw"},
+ {"alis", "com.apple.alias-record"},
+ {"appe", "com.apple.deprecated-application-file"},
+ {"cdev", "com.apple.deprecated-application-file"},
+ {"clpp", "com.apple.finder.pictclipping"},
+ {"clps", "com.apple.finder.sound-clipping"},
+ {"clpt", "com.apple.finder.textclipping"},
+ {"clpu", "com.apple.finder.clipping"},
+ {"ctrl", "com.apple.legacy.finder-icon"},
+ {"dfil", "com.apple.deprecated-application-file"},
+ {"dict", "com.apple.document-type.dictionary"},
+ {"disk", "public.volume"},
+ {"docs", "com.apple.documents-folder"},
+ {"dvc!", "public.dv-movie"},
+ {"ffil", "com.apple.font-suitcase"},
+ {"flpy", "com.apple.storage-removable"},
+ {"fold", "public.folder"},
+ {"font", "com.apple.legacy.finder-icon"},
+ {"grup", "com.apple.user-group"},
+ {"hdrv", "com.apple.disk-image-raw"},
+ {"hdsk", "com.apple.storage-internal"},
+ {"help", "com.apple.help-document"},
+ {"hkdb", "com.apple.itunes.db"},
+ {"hvpl", "com.apple.music.visual"},
+ {"ilaf", "com.apple.afp-internet-location"},
+ {"ilfi", "com.apple.file-internet-location"},
+ {"ilft", "com.apple.ftp-internet-location"},
+ {"ilge", "com.apple.generic-internet-location"},
+ {"ilht", "com.apple.web-internet-location"},
+ {"ilma", "com.apple.mail-internet-location"},
+ {"ilnw", "com.apple.news-internet-location"},
+ {"macD", "com.apple.legacy.finder-icon"},
+ {"mp3!", "public.mp3"},
+ {"mpg3", "public.mp3"},
+ {"note", "com.apple.alert-note"},
+ {"osas", "com.apple.applescript.script"},
+ {"plug", "com.apple.plugin"},
+ {"pref", "com.apple.legacy.finder-icon"},
+ {"prfb", "com.apple.icon-overlay.private-folder-badge"},
+ {"prof", "com.apple.colorsync-profile"},
+ {"qtif", "com.apple.quicktime-image"},
+ {"sLS8", "com.microsoft.excel.xlt"},
+ {"sM3F", "com.apple.logic-song"},
+ {"sbBF", "com.apple.finder.burn-folder"},
+ {"scrp", "com.apple.legacy.finder-icon"},
+ {"sdoc", "com.apple.generic-stationery"},
+ {"sfnt", "com.apple.font-suitcase"},
+ {"shlb", "com.apple.legacy.finder-icon"},
+ {"srvr", "com.apple.file-server"},
+ {"svg ", "public.svg-image"},
+ {"svgz", "public.svg-image"},
+ {"tDoc", "com.apple.documents-folder"},
+ {"tfil", "com.apple.font-suitcase"},
+ {"trsh", "com.apple.trash-empty"},
+ {"ttcf", "public.truetype-collection-font"},
+ {"ttro", "com.apple.traditional-mac-plain-text"},
+ {"txtn", "com.apple.txn.text-multimedia-data"},
+ {"url ", "public.url"},
+ {"user", "com.apple.user"},
+ {"utxt", "public.utf16-plain-text"},
+ {"vCrd", "public.vcard"},
+ {NULL, NULL}
+};
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index d9c1c01..628782f 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -4,9 +4,9 @@
* Contains the Macintosh implementation of the platform-independent font
* package interface.
*
- * Copyright 2002-2004 Benjamin Riefenstahl, Benjamin.Riefenstahl@epost.de
+ * Copyright (c) 2002-2004 Benjamin Riefenstahl, Benjamin.Riefenstahl@epost.de
* Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
- * Copyright 2008-2009, Apple Inc.
+ * Copyright (c) 2008-2009 Apple Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -244,7 +244,7 @@ FindNSFont(
NSString *family;
if (familyName) {
- family = [[[NSString alloc] initWithUTF8String:familyName] autorelease];
+ family = [[[TKNSString alloc] initWithTclUtfBytes:familyName length:-1] autorelease];
} else {
family = [defaultFont familyName];
}
@@ -1189,7 +1189,7 @@ TkpDrawAngledCharsInContext(
MacDrawable *macWin = (MacDrawable *)drawable;
TkMacOSXDrawingContext drawingContext;
CGContextRef context;
- CGColorRef fg;
+ CGColorRef fg = NULL;
NSFont *nsFont;
CGAffineTransform t;
CGFloat width, height, textX = (CGFloat) x, textY = (CGFloat) y;
@@ -1207,8 +1207,10 @@ TkpDrawAngledCharsInContext(
context = drawingContext.context;
TkSetMacColor(gc->foreground, &fg);
attributes = [fontPtr->nsAttributes mutableCopy];
- [attributes setObject:(id)fg forKey:(id)kCTForegroundColorAttributeName];
- CFRelease(fg);
+ if (fg) {
+ [attributes setObject:(id)fg forKey:(id)kCTForegroundColorAttributeName];
+ CGColorRelease(fg);
+ }
nsFont = [attributes objectForKey:NSFontAttributeName];
[nsFont setInContext:GET_NSCONTEXT(context, NO)];
CGContextSetTextMatrix(context, CGAffineTransformIdentity);
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index d9f3d12..a9b459a 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -45,8 +45,41 @@ static int TkMacOSXGetAppPathCmd(ClientData cd, Tcl_Interp *ip,
@synthesize needsToDraw = _needsToDraw;
@synthesize tkLiveResizeEnded = _tkLiveResizeEnded;
@synthesize tkPointerWindow = _tkPointerWindow;
+- (void) setTkPointerWindow: (TkWindow *)winPtr
+{
+ if (_tkPointerWindow) {
+ Tcl_Release(_tkPointerWindow);
+ }
+ if (winPtr) {
+ Tcl_Preserve(winPtr);
+ }
+ _tkPointerWindow = winPtr;
+ return;
+}
@synthesize tkEventTarget = _tkEventTarget;
+- (void) setTkEventTarget: (TkWindow *)winPtr
+{
+ if (_tkEventTarget) {
+ Tcl_Release(_tkEventTarget);
+ }
+ if (winPtr) {
+ Tcl_Preserve(winPtr);
+ }
+ _tkEventTarget = winPtr;
+ return;
+}
@synthesize tkDragTarget = _tkDragTarget;
+- (void) setTkDragTarget: (TkWindow *)winPtr
+{
+ if (_tkDragTarget) {
+ Tcl_Release(_tkDragTarget);
+ }
+ if (winPtr) {
+ Tcl_Preserve(winPtr);
+ }
+ _tkDragTarget = winPtr;
+ return;
+}
@synthesize tkButtonState = _tkButtonState;
@end
@@ -415,7 +448,7 @@ TkpInit(
/*
* TkpInit can be called multiple times with different interpreters. But
- * The application initialization should only be done onece.
+ * The application initialization should only be done once.
*/
if (!initialized) {
@@ -476,7 +509,7 @@ TkpInit(
* the application icon, will be delivered before the procedure meant
* to to handle the AppleEvent has been defined. This is handled in
* tkMacOSXHLEvents.c by scheduling a timer event to handle the
- * ApplEvent later, after the required procedure has been defined.
+ * AppleEvent later, after the required procedure has been defined.
*/
[NSApp _setup:interp];
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index cc3ab7f..c10944a 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -3,8 +3,8 @@
*
* This module implements the Mac-platform specific features of menus.
*
- * Copyright (c) 1996-1997 by Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 1996-1997 Sun Microsystems, Inc.
+ * Copyright (c) 2001-2009 Apple Inc.
* Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net>
* Copyright (c) 2012 Adrian Robert.
*
@@ -94,7 +94,7 @@ static const struct {
static int gNoTkMenus = 0; /* This is used by Tk_MacOSXTurnOffMenus as
* the flag that Tk is not to draw any
* menus. */
-static int inPostMenu = 0;
+static Bool inPostMenu = false;
static SInt32 menuMarkColumnWidth = 0, menuIconTrailingEdgeMargin = 0;
static SInt32 menuTextLeadingEdgeMargin = 0, menuTextTrailingEdgeMargin = 0;
static SInt16 menuItemExtraHeight = 0, menuItemExtraWidth = 0;
@@ -124,7 +124,7 @@ static int ModifierCharWidth(Tk_Font tkfont);
* demo would cause the animation to stop. This was also the case for
* menubuttons.
*
- * The TKBackground object below works around this problem, and allows a Tk
+ * The TKBackgroundLoop object below works around this problem, and allows a Tk
* event loop to run while a menu is open. It is a subclass of NSThread which
* inserts requests to call [NSApp _runBackgroundLoop] onto the queue
* associated with the NSEventTrackingRunLoopMode. One of these threads gets
@@ -200,25 +200,36 @@ TKBackgroundLoop *backgroundLoop = nil;
* Spanish keyboard both the ' and the ` keys are dead keys used to place
* accents over letters. But ⌘` is a standard KeyEquivalent which cycles
* through the open windows of an application, changing the focus to the next
- * window.
- *
- * The performKeyEquivalent callback method is being overridden here to work
- * around a bug reported in [1626ed65b8]. When a dead key that is also as a
- * KeyEquivalent is pressed, a KeyDown event with no characters is passed to
- * performKeyEquivalent. The default implementation provided by Apple will
- * cause that event to be routed to some private methods of NSMenu which raise
- * NSInvalidArgumentException, causing an abort. Returning NO in such a case
- * prevents the abort, but does not prevent the KeyEquivalent action from being
- * invoked, presumably because the event does get correctly handled higher in
- * the responder chain.
+ * window. This caused a bug reported in [1626ed65b8]. When a dead key that is
+ * also as a KeyEquivalent is pressed, a KeyDown event with no characters would
+ * be passed to performKeyEquivalent. The default implementation provided by
+ * Apple would cause that event to be routed to some private methods of NSMenu
+ * which raise NSInvalidArgumentException, causing an abort. Returning NO in
+ * such a case prevents the abort. So the override below returns NO when the
+ * event has no characters.
+ *
+ * In fact, however, we never want to handle accelerators because they are
+ * handled by Tk. Hence this method could always return NO. But if we did
+ * that then we would not see the menu flash when an accelerator is pressed.
+ * The flash is a useful visual indicator. It turns out that the flash is an
+ * undocumented side effect of calling the super method for
+ * performKeyEquivalent. The super method also calls the NSMenuItem's action
+ * method - tkMenuItemInvoke in our case. This is also not documented.
+ *
+ * To enable the flash we set up a flag that tells the action method to do
+ * nothing, because it is being called by an accelerator. The override below
+ * sets the flag and then calls super. See ticket [ead70921a9].
*/
+static Bool runMenuCommand = true;
- (BOOL)performKeyEquivalent:(NSEvent *)event
{
- if (event.characters.length == 0) {
+ if ([[event characters] length] == 0) {
return NO;
}
- return [super performKeyEquivalent:event];
+ runMenuCommand = false;
+ /* Make the menu flash and call tkMenuItemInvoke. */
+ return [super performKeyEquivalent: event];
}
@end
@@ -239,8 +250,8 @@ TKBackgroundLoop *backgroundLoop = nil;
- (id) initWithTkMenu: (TkMenu *) tkMenu
{
- NSString *title = [[NSString alloc] initWithUTF8String:
- Tk_PathName(tkMenu->tkwin)];
+ NSString *title = [[TKNSString alloc] initWithTclUtfBytes:
+ Tk_PathName(tkMenu->tkwin) length:-1];
self = [self initWithTitle:title];
[title release];
@@ -332,11 +343,19 @@ TKBackgroundLoop *backgroundLoop = nil;
- (void) tkMenuItemInvoke: (id) sender
{
+ if (!runMenuCommand) {
+
+ /*
+ * We are being called for a menu accelerator. Tk will handle it.
+ * Just update the runMenuCommand flag.
+ */
+
+ runMenuCommand = true;
+ return;
+ }
+
/*
- * With the delegate matching key equivalents, when a menu action is sent
- * in response to a key equivalent, the sender is the whole menu and not the
- * specific menu item. We use this to ignore key equivalents for Tk
- * menus (as Tk handles them directly via bindings).
+ * We are being called for an actual menu item selection; run the command.
*/
if ([sender isKindOfClass:[NSMenuItem class]]) {
@@ -346,12 +365,9 @@ TKBackgroundLoop *backgroundLoop = nil;
if (menuPtr && mePtr) {
Tcl_Interp *interp = menuPtr->interp;
-
Tcl_Preserve(interp);
Tcl_Preserve(menuPtr);
-
int result = TkInvokeMenu(interp, menuPtr, mePtr->index);
-
if (result != TCL_OK && result != TCL_CONTINUE &&
result != TCL_BREAK) {
Tcl_AddErrorInfo(interp, "\n (menu invoke)");
@@ -493,8 +509,13 @@ TKBackgroundLoop *backgroundLoop = nil;
}
backgroundLoop = [[TKBackgroundLoop alloc] init];
[backgroundLoop start];
- //TkMacOSXClearMenubarActive();
- //TkMacOSXPreprocessMenu();
+
+ /*
+ * Make sure that we can run commands when actually using a menu.
+ * See [412b80fcaf].
+ */
+
+ runMenuCommand = true;
}
- (void) menuEndTracking: (NSNotification *) notification
@@ -736,14 +757,9 @@ TkpConfigureMenuEntry(
[menuItem setImage:image];
if ((!image || mePtr->compound != COMPOUND_NONE) && mePtr->labelPtr &&
mePtr->labelLength) {
- Tcl_DString ds;
- Tcl_DStringInit(&ds);
- Tcl_UtfToUniCharDString(Tcl_GetString(mePtr->labelPtr),
- mePtr->labelLength, &ds);
- title = [[NSString alloc]
- initWithCharacters:(unichar *)Tcl_DStringValue(&ds)
- length:Tcl_DStringLength(&ds)>>1];
- Tcl_DStringFree(&ds);
+ title = [[TKNSString alloc]
+ initWithTclUtfBytes:Tcl_GetString(mePtr->labelPtr)
+ length:mePtr->labelLength];
if ([title hasSuffix:@"..."]) {
title = [NSString stringWithFormat:@"%@%C",
[title substringToIndex:[title length] - 3], 0x2026];
@@ -814,7 +830,7 @@ TkpConfigureMenuEntry(
if ([submenu supermenu] && [menuItem submenu] != submenu) {
/*
* This happens during a clone, where the parent menu is
- * cloned before its children, so just ignore this temprary
+ * cloned before its children, so just ignore this temporary
* setting, it will be changed shortly (c.f. tkMenu.c
* CloneMenu())
*/
@@ -943,10 +959,10 @@ TkpPostMenu(
NSMenuItem *item = nil;
NSPoint location = NSMakePoint(x, TkMacOSXZeroScreenHeight() - y);
- inPostMenu = 1;
+ inPostMenu = true;
result = TkPreprocessMenu(menuPtr);
if (result != TCL_OK) {
- inPostMenu = 0;
+ inPostMenu = false;
return result;
}
if (itemIndex >= numItems) {
@@ -968,7 +984,7 @@ TkpPostMenu(
[menu popUpMenuPositioningItem:item
atLocation:[win tkConvertPointFromScreen:location]
inView:view];
- inPostMenu = 0;
+ inPostMenu = false;
return TCL_OK;
}
@@ -1314,7 +1330,7 @@ ParseAccelerator(
if (ch) {
return [[[NSString alloc] initWithCharacters:&ch length:1] autorelease];
} else {
- return [[[[NSString alloc] initWithUTF8String:accel] autorelease]
+ return [[[[TKNSString alloc] initWithTclUtfBytes:accel length:-1] autorelease]
lowercaseString];
}
}
@@ -1324,7 +1340,7 @@ ParseAccelerator(
*
* ModifierCharWidth --
*
- * Helper mesuring width of command char in given font.
+ * Helper measuring width of command char in given font.
*
* Results:
* Width of command char.
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index fd9bbc1..e33f787 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -133,6 +133,7 @@ enum {
buttonState &= ~TkGetButtonMask(button);
break;
case NSLeftMouseDragged:
+ buttonState |= TkGetButtonMask(button);
if (![NSApp tkDragTarget]) {
if (isOutside) {
ignoreDrags = YES;
@@ -248,7 +249,7 @@ enum {
}
/*
- * If this click will change the focus, the Tk event event should
+ * If this click will change the focus, the Tk event should
* be sent to the toplevel which will be receiving focus rather than to
* the current focus window. So reset tkEventTarget.
*/
@@ -404,7 +405,6 @@ enum {
* not in the grabber's subtree.
*/
-
if (grabWinPtr && /* There is a grab in effect ... */
!winPtr->dispPtr->grabFlags && /* and it is a local grab ... */
grabWinPtr->mainPtr == winPtr->mainPtr){ /* in the same application. */
@@ -500,7 +500,7 @@ enum {
Tk_UpdatePointer((Tk_Window) [NSApp tkDragTarget],
global.x, global.y, state);
} else {
- Tk_UpdatePointer(NULL, global.x, global.y, state);
+ Tk_UpdatePointer(NULL, global.x, global.y, state);
}
} else if (eventType == NSMouseMoved ||
eventType == NSLeftMouseDragged) {
@@ -818,7 +818,6 @@ GenerateButtonEvent(
tkwin = Tk_TopCoordsToWindow(tkwin, medPtr->local.h, medPtr->local.v,
&dummy, &dummy);
}
-
Tk_UpdatePointer(tkwin, medPtr->global.h, medPtr->global.v, medPtr->state);
return true;
}
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c
index 208d846..3cb6c48 100644
--- a/macosx/tkMacOSXNotify.c
+++ b/macosx/tkMacOSXNotify.c
@@ -341,7 +341,7 @@ TkMacOSXNotifyExitHandler(
* deQueue=NO so that it will not change anything on the AppKit event
* queue, because we only want the side effect that it runs drawRect. The
* only times when any NSViews have the needsDisplay property set to YES
- * are during execution of this function or in the addDirtyRect method
+ * are during execution of this function or in the addTkDirtyRect method
* of TKContentView.
*
* The reason for running this function as an idle task is to try to
diff --git a/macosx/tkMacOSXPort.h b/macosx/tkMacOSXPort.h
index 2208b76..dbc9e2b 100644
--- a/macosx/tkMacOSXPort.h
+++ b/macosx/tkMacOSXPort.h
@@ -193,14 +193,6 @@ MODULE_SCOPE unsigned long TkMacOSXRGBPixel(unsigned long red, unsigned long gre
#define TkpGetPixel(p) (TkMacOSXRGBPixel(p->red >> 8, p->green >> 8, p->blue >> 8))
/*
- * Used by tkWindow.c
- */
-
-MODULE_SCOPE void TkMacOSXHandleMapOrUnmap(Tk_Window tkwin, XEvent *event);
-
-#define TkpHandleMapOrUnmap(tkwin, event) TkMacOSXHandleMapOrUnmap(tkwin, event)
-
-/*
* Used by tkAppInit
*/
diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h
index 3b03139..a505552 100644
--- a/macosx/tkMacOSXPrivate.h
+++ b/macosx/tkMacOSXPrivate.h
@@ -28,6 +28,9 @@
#import <ApplicationServices/ApplicationServices.h>
#import <Cocoa/Cocoa.h>
#import <QuartzCore/QuartzCore.h>
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
+#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
+#endif
#ifndef NO_CARBON_H
#import <Carbon/Carbon.h>
#endif
@@ -121,9 +124,10 @@
* Macro abstracting use of TkMacOSXGetNamedSymbol to init named symbols.
*/
+#define UNINITIALISED_SYMBOL ((void*)(-1L))
#define TkMacOSXInitNamedSymbol(module, ret, symbol, ...) \
- static ret (* symbol)(__VA_ARGS__) = (void*)(-1L); \
- if (symbol == (void*)(-1L)) { \
+ static ret (* symbol)(__VA_ARGS__) = UNINITIALISED_SYMBOL; \
+ if (symbol == UNINITIALISED_SYMBOL) { \
symbol = TkMacOSXGetNamedSymbol(STRINGIFY(module), \
STRINGIFY(symbol)); \
}
@@ -207,12 +211,6 @@ typedef struct TkMacOSXDrawingContext {
} TkMacOSXDrawingContext;
/*
- * Variables internal to TkAqua.
- */
-
-MODULE_SCOPE long tkMacOSXMacOSXVersion;
-
-/*
* Prototypes for TkMacOSXRegion.c.
*/
@@ -258,14 +256,14 @@ MODULE_SCOPE void TkMacOSXRestoreDrawingContext(
TkMacOSXDrawingContext *dcPtr);
MODULE_SCOPE void TkMacOSXSetColorInContext(GC gc, unsigned long pixel,
CGContextRef context);
-#define TkMacOSXGetTkWindow(window) (TkWindow *)Tk_MacOSXGetTkWindow(window)
-#define TkMacOSXGetNSWindowForDrawable(drawable) ((NSWindow*)TkMacOSXDrawable(drawable))
-#define TkMacOSXGetNSViewForDrawable(macWin) (NSView *)Tk_MacOSXGetNSViewForDrawable((Drawable)(macWin))
+#define TkMacOSXGetTkWindow(window) ((TkWindow *)Tk_MacOSXGetTkWindow(window))
+#define TkMacOSXGetNSWindowForDrawable(drawable) ((NSWindow *)TkMacOSXDrawable(drawable))
+#define TkMacOSXGetNSViewForDrawable(macWin) ((NSView *)Tk_MacOSXGetNSViewForDrawable((Drawable)(macWin)))
+MODULE_SCOPE CGContextRef TkMacOSXGetCGContextForDrawable(Drawable drawable);
MODULE_SCOPE void TkMacOSXWinCGBounds(TkWindow *winPtr, CGRect *bounds);
MODULE_SCOPE HIShapeRef TkMacOSXGetClipRgn(Drawable drawable);
MODULE_SCOPE void TkMacOSXInvalidateViewRegion(NSView *view,
HIShapeRef rgn);
-MODULE_SCOPE CGContextRef TkMacOSXGetCGContextForDrawable(Drawable drawable);
MODULE_SCOPE NSImage* TkMacOSXGetNSImageFromTkImage(Display *display,
Tk_Image image, int width, int height);
MODULE_SCOPE NSImage* TkMacOSXGetNSImageFromBitmap(Display *display,
@@ -277,23 +275,20 @@ MODULE_SCOPE NSModalSession TkMacOSXGetModalSession(void);
MODULE_SCOPE void TkMacOSXSelDeadWindow(TkWindow *winPtr);
MODULE_SCOPE void TkMacOSXApplyWindowAttributes(TkWindow *winPtr,
NSWindow *macWindow);
-MODULE_SCOPE int TkMacOSXStandardAboutPanelObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *const objv[]);
-MODULE_SCOPE int TkMacOSXIconBitmapObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *const objv[]);
+MODULE_SCOPE Tcl_ObjCmdProc TkMacOSXStandardAboutPanelObjCmd;
+MODULE_SCOPE Tcl_ObjCmdProc TkMacOSXIconBitmapObjCmd;
MODULE_SCOPE void TkMacOSXDrawSolidBorder(Tk_Window tkwin, GC gc,
int inset, int thickness);
MODULE_SCOPE int TkMacOSXServices_Init(Tcl_Interp *interp);
-MODULE_SCOPE int TkMacOSXRegisterServiceWidgetObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
+MODULE_SCOPE Tcl_ObjCmdProc TkMacOSXRegisterServiceWidgetObjCmd;
MODULE_SCOPE unsigned TkMacOSXAddVirtual(unsigned int keycode);
MODULE_SCOPE void TkMacOSXWinNSBounds(TkWindow *winPtr, NSView *view,
NSRect *bounds);
MODULE_SCOPE Bool TkMacOSXInDarkMode(Tk_Window tkwin);
-MODULE_SCOPE void TkMacOSXDrawAllViews(ClientData clientData);
+MODULE_SCOPE void TkMacOSXDrawAllViews(void *clientData);
MODULE_SCOPE unsigned long TkMacOSXClearPixel(void);
+MODULE_SCOPE NSString* TkMacOSXOSTypeToUTI(OSType ostype);
+MODULE_SCOPE NSImage* TkMacOSXIconForFileType(NSString *filetype);
#pragma mark Private Objective-C Classes
@@ -325,7 +320,6 @@ VISIBILITY_HIDDEN
NSArray *_defaultHelpMenuItems, *_defaultFileMenuItems;
NSAutoreleasePool *_mainPool;
NSThread *_backgoundLoop;
- Bool _tkLiveResizeEnded;
#ifdef __i386__
/* The Objective C runtime used on i386 requires this. */
@@ -351,9 +345,9 @@ VISIBILITY_HIDDEN
* Persistent state variables used by processMouseEvent.
*/
-@property TkWindow *tkPointerWindow;
-@property TkWindow *tkEventTarget;
-@property TkWindow *tkDragTarget;
+@property(nonatomic) TkWindow *tkPointerWindow;
+@property(nonatomic) TkWindow *tkEventTarget;
+@property(nonatomic) TkWindow *tkDragTarget;
@property unsigned int tkButtonState;
@end
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index dbae21e..5d61981 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -308,9 +308,6 @@ XUnmapWindow(
TkWindow *winPtr = macWin->winPtr;
TkWindow *parentPtr = winPtr->parentPtr;
NSWindow *win = TkMacOSXGetNSWindowForDrawable(window);
- NSPoint mouse = [NSEvent mouseLocation];
- int x = mouse.x, y = TkMacOSXZeroScreenHeight() - mouse.y;
- int state = TkMacOSXButtonKeyState();
if (!window) {
return BadWindow;
@@ -371,7 +368,6 @@ XUnmapWindow(
if (view != [NSView focusView]) {
[view addTkDirtyRect:[view bounds]];
}
- Tk_UpdatePointer(NULL, x, y, state);
return Success;
}
diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c
index ec19ec5..3f178c3 100644
--- a/macosx/tkMacOSXTest.c
+++ b/macosx/tkMacOSXTest.c
@@ -22,15 +22,11 @@
*/
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1080
-static int DebuggerObjCmd (ClientData dummy, Tcl_Interp *interp,
- int objc, Tcl_Obj *const objv[]);
+static Tcl_ObjCmdProc DebuggerObjCmd;
#endif
-static int PressButtonObjCmd (ClientData dummy, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-static int InjectKeyEventObjCmd (ClientData dummy, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
-static int MenuBarHeightObjCmd (ClientData dummy, Tcl_Interp *interp,
- int objc, Tcl_Obj *const *objv);
+static Tcl_ObjCmdProc PressButtonObjCmd;
+static Tcl_ObjCmdProc InjectKeyEventObjCmd;
+static Tcl_ObjCmdProc MenuBarHeightObjCmd;
/*
@@ -87,10 +83,10 @@ TkplatformtestInit(
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1080
static int
DebuggerObjCmd(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Not used. */
- int objc, /* Not used. */
- Tcl_Obj *const objv[]) /* Not used. */
+ TCL_UNUSED(void *), /* Not used. */
+ TCL_UNUSED(Tcl_Interp *), /* Not used. */
+ TCL_UNUSED(int), /* Not used. */
+ TCL_UNUSED(Tcl_Obj *const *) /* Not used. */
{
Debugger();
return TCL_OK;
@@ -178,7 +174,7 @@ TkTestLogDisplay(
* location. It injects NSEvents into the NSApplication event queue, as
* opposed to adding events to the Tcl queue as event generate would do.
* One application is for testing the grab command. These events have
- * their unused context property set to 1 as a signal indicating that they
+ * their timestamp property set to 0 as a signal indicating that they
* should not be ignored by [NSApp tkProcessMouseEvent].
*
* Results:
@@ -233,7 +229,7 @@ PressButtonObjCmd(
loc.y = ScreenHeight - y;
/*
- * We set the timestamp to 0 as a signal to processMouseEvent.
+ * We set the timestamp to 0 as a signal to tkProcessMouseEvent.
*/
CGWarpMouseCursorPosition(pt);
@@ -295,8 +291,8 @@ InjectKeyEventObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "option keysym ?arg?");
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[1], optionStrings,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
type = types[index];
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index 5769369..a806729 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -457,7 +457,7 @@ static void RefocusGrabWindow(void *data) {
* being run inside of the drawRect method. If not, it may be desirable
* for the display procedure to simply clear the REDRAW_PENDING flag
* and return. The widget can be recorded in order to schedule a
- * redraw, via and Expose event, from within drawRect.
+ * redraw, via an Expose event, from within drawRect.
*
* This is also needed for some tests, especially of the Text widget,
* which record data in a global Tcl variable and assume that display
@@ -1014,7 +1014,7 @@ ConfigureRestrictProc(
/*
* Make sure that the layer uses a contentScale that matches the
- * backing scale factor of the screen. This avoids blurry text whe
+ * backing scale factor of the screen. This avoids blurry text when
* the view is on a Retina display, as well as incorrect size when
* the view is on a normal display.
*/
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 1bf62d9..b72c5a7 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -6,7 +6,7 @@
* the "wm" command and passes geometry information to the window manager.
*
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
- * Copyright 2001-2009, Apple Inc.
+ * Copyright (c) 2001-2009, Apple Inc.
* Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
* Copyright (c) 2010 Kevin Walzer/WordTech Communications LLC.
* Copyright (c) 2017-2019 Marc Culler.
@@ -745,74 +745,6 @@ TkWmNewWindow(
/*
*----------------------------------------------------------------------
*
- * TkMacOSXHandleMapOrUnmap --
- *
- * The mechanism used by a geometry manager to propogate the information
- * about which of its content widgets are mapped is to call Tk_MapWindow
- * or Tk_UnmapNotify. Those functions generate MapNotify or UnmapNotify
- * events and then handle them immediately. Other platforms use
- * Tk_HandleEvent to do this. But that does not work correctly on macOS
- * due to the fact that the calls to Tk_MapNotify or Tk_UnmapNotify can
- * occur in display procedures which are being run in the drawRect method
- * of a TKContentView. The events will be processed after drawRect
- * returns, but they need to be processed immediately in some cases.
-
- * This function operates as a macOS alternative to Tk_HandleEvent, for
- * processing MapNotify or UnmapNotify events only. It is called by
- * Tk_MapWindow, Tk_UnmapWindow, TkWmMapWindow and TkWmUnmapWindow.
- * Rather than using Tk_HandleEvent it installs a filter which restricts
- * to the MapNotify or UnmapNotify events, it queues the event and then
- * processes window events with the filter installed. This allows the
- * event to be handled immediately even from within the drawRect method.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Handles a MapNotify or UnMapNotify event.
- *
- *----------------------------------------------------------------------
- */
-static Tk_RestrictAction
-MapUnmapRestrictProc(
- ClientData arg,
- XEvent *eventPtr)
-{
- return (eventPtr->type==MapNotify || eventPtr->type==UnmapNotify ?
- TK_PROCESS_EVENT : TK_DEFER_EVENT);
-}
-
-MODULE_SCOPE
-void TkMacOSXHandleMapOrUnmap(
- Tk_Window tkwin,
- XEvent *event)
-{
- ClientData oldArg;
- Tk_RestrictProc *oldProc;
- TkWindow *winPtr = (TkWindow *) tkwin;
- const Tk_GeomMgr *geomMgrPtr = winPtr->geomMgrPtr;
-
- /*
- * Sadly, this approach does not work with the "text" geometry manager.
- * The mysterious unexplained crash elicited by textDisp-5.2 occurs. So we
- * have to check for the "text" manager and revert to using Tk_HandleEvent
- * in that case. Hopefully this can be removed when the revised text
- * widget is in place.
- */
-
- if (geomMgrPtr && strcmp(geomMgrPtr->name, "text") == 0) {
- Tk_HandleEvent(event);
- return;
- }
- oldProc = Tk_RestrictEvents(MapUnmapRestrictProc, NULL, &oldArg);
- Tk_QueueWindowEvent(event, TCL_QUEUE_TAIL);
- while (Tcl_DoOneEvent(TCL_WINDOW_EVENTS|TCL_DONT_WAIT)) {}
- Tk_RestrictEvents(oldProc, oldArg, &oldArg);
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TkWmMapWindow --
*
* This procedure is invoked to map a top-level window. This module gets
@@ -916,7 +848,7 @@ TkWmMapWindow(
event.xmap.type = MapNotify;
event.xmap.event = winPtr->window;
event.xmap.override_redirect = winPtr->atts.override_redirect;
- TkpHandleMapOrUnmap((Tk_Window)winPtr, &event);
+ Tk_HandleEvent(&event);
}
/*
@@ -952,7 +884,7 @@ TkWmUnmapWindow(
event.xunmap.from_configure = false;
winPtr->flags &= ~TK_MAPPED;
XUnmapWindow(winPtr->display, winPtr->window);
- TkpHandleMapOrUnmap((Tk_Window)winPtr, &event);
+ Tk_HandleEvent(&event);
}
/*
@@ -2664,7 +2596,7 @@ WmIconphotoCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_Image tk_icon;
- int width, height, isDefault = 0;
+ int width, height;
NSImage *newIcon = NULL;
if (objc < 4) {
@@ -2678,7 +2610,6 @@ WmIconphotoCmd(
*/
if (strcmp(Tcl_GetString(objv[3]), "-default") == 0) {
- isDefault = 1;
if (objc == 4) {
Tcl_WrongNumArgs(interp, 2, objv,
"window ?-default? image1 ?image2 ...?");
@@ -5488,7 +5419,7 @@ TkSetWMName(
return;
}
- NSString *title = [[NSString alloc] initWithUTF8String:titleUid];
+ NSString *title = [[TKNSString alloc] initWithTclUtfBytes:titleUid length:-1];
[TkMacOSXGetNSWindowForDrawable(winPtr->window) setTitle:title];
[title release];
}
@@ -6036,7 +5967,7 @@ WmWinTabbingId(
* allows you to get or set the appearance for the NSWindow associated
* with a Tk Window. The syntax is:
*
- * tk::unsupported::MacWindowStyle tabbingid window ?newAppearance?
+ * tk::unsupported::MacWindowStyle appearance window ?newAppearance?
*
* Allowed appearance names are "aqua", "darkaqua", and "auto".
*
@@ -6102,9 +6033,9 @@ WmWinAppearance(
if (objc == 4) {
int index;
if (Tcl_GetIndexFromObjStruct(interp, objv[3], appearanceStrings,
- sizeof(char *), "appearancename", 0, &index) != TCL_OK) {
- return TCL_ERROR;
- }
+ sizeof(char *), "appearancename", 0, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
switch ((enum appearances) index) {
case APPEARANCE_AQUA:
win.appearance = [NSAppearance appearanceNamed:
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index aa1108e..a860bda 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -705,15 +705,17 @@ XSync(
/*
* The main use of XSync is by the update command, which alternates
* between running an event loop to process all events without waiting and
- * calling XSync on all displays until no events are left. There is
- * nothing for the mac to do with respect to syncing its one display but
- * it can (and, during regression testing, frequently does) happen that
- * timer events fire during the event loop. Processing those here seems
- * to make the update command work in a way that is more consistent with
- * its behavior on other platforms.
+ * calling XSync on all displays until no events are left. On X11 the
+ * call to XSync might cause the window manager to generate more events
+ * which would then get processed. Apparently this process stabilizes on
+ * X11, leaving the window manager in a state where all events have been
+ * generated and no additional events can be genereated by updating widgets.
+ *
+ * It is not clear what the Aqua port should do when XSync is called, but
+ * currently the best option seems to be to do nothing. (See ticket
+ * [da5f2266df].)
*/
- while (Tcl_DoOneEvent(TCL_TIMER_EVENTS|TCL_DONT_WAIT)){}
display->request++;
return 0;
}
@@ -726,7 +728,7 @@ XSetClipRectangles(
int clip_y_origin,
XRectangle* rectangles,
int n,
- int ordering)
+ TCL_UNUSED(int))
{
TkRegion clipRgn = TkCreateRegion();
diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c
index ddaa226..f2ad636 100644
--- a/macosx/ttkMacOSXTheme.c
+++ b/macosx/ttkMacOSXTheme.c
@@ -131,9 +131,9 @@ static CGFloat pressedPushButtonGradient[8] = {
*/
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
-#define CGCOLOR(nscolor) nscolor.CGColor
+#define CGCOLOR(nscolor) (nscolor).CGColor
#else
-#define CGCOLOR(nscolor) (0 ? (CGColorRef) nscolor : NULL)
+#define CGCOLOR(nscolor) (0 ? (CGColorRef) (nscolor) : NULL)
#define CGPathCreateWithRoundedRect(w, x, y, z) NULL
#endif
@@ -146,7 +146,7 @@ static CGFloat pressedPushButtonGradient[8] = {
*/
#define CHECK_RADIUS(radius, bounds) \
- if (radius > bounds.size.width / 2 || radius > bounds.size.height / 2) { \
+ if ((radius) > (bounds).size.width / 2 || (radius) > (bounds).size.height / 2) { \
return; \
}
@@ -236,7 +236,7 @@ static CGRect NormalizeButtonBounds(
*/
/*
- * For systems older than 10.14, [NSColor windowBackGroundColor] generates
+ * For systems older than 10.14, [NSColor windowBackgroundColor] generates
* garbage when called from this function. In 10.14 it works correctly, and
* must be used in order to have a background color which responds to Dark
* Mode. So we use this hard-wired RGBA color on the older systems which don't
diff --git a/tests/bind.test b/tests/bind.test
index e1af2ea..7b7fb62 100644
--- a/tests/bind.test
+++ b/tests/bind.test
@@ -6987,6 +6987,27 @@ test bind-36.1 {pointer warp with grab on toplevel, bug [e3888d5820]} -setup {
unset x1 y1 x2 y2
} -result 1
+test bind-37.1 {Promotion tables do not contain duplicate sequences, bug [43573999ca]} -body {
+ proc A {} {
+ bind .c <B1-Motion><Enter> {}
+ set myv(a) 1
+ set b [array get myv]
+ bind .c <B1-Motion><Enter> "puts Trigger"
+ }
+ pack [canvas .c]
+ bind .c <ButtonRelease-1> "A"
+ A
+ update
+ event generate .c <Button-1>
+ event generate .c <B1-Motion>
+ event generate .c <B1-Motion>
+ event generate .c <B1-Motion>
+ event generate .c <ButtonRelease-1>
+ event generate .c <B1-Motion>
+} -cleanup {
+ destroy .c
+} -returnCodes ok -result {} ; # shall not crash (assertion failed)
+
# cleanup
cleanupTests
return
diff --git a/tests/canvImg.test b/tests/canvImg.test
index 4c71a9a..e2e9e58 100644
--- a/tests/canvImg.test
+++ b/tests/canvImg.test
@@ -166,7 +166,7 @@ test canvImg-4.2 {ConfigureImage procedure} -constraints testImageType -setup {
update
set x {}
set y {}
- set timer [after 300 {lappend y "timed out"}]
+ set timer [after 500 {lappend y "timed out"}]
.c itemconfigure i1 -image foo2
update idletasks
update
diff --git a/tests/canvPs.test b/tests/canvPs.test
index 6e24661..126abe2 100644
--- a/tests/canvPs.test
+++ b/tests/canvPs.test
@@ -133,9 +133,7 @@ test canvPs-2.4 {test writing to channel and file, same output} -constraints {
destroy .c
-test canvPs-3.1 {test ps generation with an embedded window} -constraints {
- notAqua
-} -setup {
+test canvPs-3.1 {test ps generation with an embedded window} -setup {
set bar [makeFile {} bar.ps]
file delete $bar
} -body {
diff --git a/tests/constraints.tcl b/tests/constraints.tcl
index 65609d6..e1e0dd4 100644
--- a/tests/constraints.tcl
+++ b/tests/constraints.tcl
@@ -122,6 +122,11 @@ namespace eval tk {
namespace export deleteWindows
proc deleteWindows {} {
eval destroy [winfo children .]
+ # This update is needed to avoid intermittent failures on macOS in unixEmbed.test
+ # Reason for the failures is unclear but could have to do with window ids being deleted
+ # after the destroy command returns. The detailed mechanism of such delayed deletions
+ # is not understood, but it appears that this update prevents the test failures.
+ update
}
namespace export fixfocus
@@ -137,7 +142,6 @@ namespace eval tk {
destroy .focus
}
-
namespace export imageInit imageFinish imageCleanup imageNames
variable ImageNames
proc imageInit {} {
@@ -175,15 +179,19 @@ namespace eval tk {
#
# CONTROL TIMING ASPECTS OF POINTER WARPING
#
- # The proc [controlPointerWarpTiming] takes care of the following timing
- # details of pointer warping:
+ # The proc [controlPointerWarpTiming] is intended to ensure that the (mouse)
+ # pointer has actually been moved to its new position after a Tk test issued:
+ #
+ # [event generate $w $event -warp 1 ...]
+ #
+ # It takes care of the following timing details of pointer warping:
#
# a. Allow pointer warping to happen if it was scheduled for execution at
# idle time.
# - In Tk releases 8.6 and older, pointer warping is scheduled for
# execution at idle time
- # - In release 8.7 and newer this happens synchronously and no extra
- # control is needed.
+ # - In release 8.7 and newer this happens synchronously if $w refers to the
+ # whole screen or if the -when option to [event generate] is "now".
# The namespace variable idle_pointer_warping records which of these is
# the case.
#
@@ -199,8 +207,8 @@ namespace eval tk {
# the OS to call in order to notify Tk when a mouse move is completed.
# - Tk doesn't wait for the callback function to receive the notification
# from the OS, but continues processing. This suits most use cases
- # because (usually) the notification comes quickly enough
- # (range: a few ms?). However ...
+ # because usually the notification arrives fast enough (within a few tens
+ # of microseconds). However ...
# - A problem arises if Tk performs some processing, immediately following
# up on [event generate $w $event -warp 1 ...], and that processing
# relies on the mouse pointer having actually moved. If such processing
@@ -221,6 +229,13 @@ namespace eval tk {
# For the history of this issue please refer to Tk ticket [69b48f427e],
# specifically the comment on 2019-10-27 14:24:26.
#
+ #
+ # Beware: there are cases, not (yet) exercised by the Tk test suite, where
+ # [controlPointerWarpTiming] doesn't ensure the new position of the pointer.
+ # For example, when issued under Tk8.7+, if the value for the -when option
+ # to [event generate $w] is not "now", and $w refers to a Tk window, i.e. not
+ # the whole screen.
+ #
variable idle_pointer_warping [expr {![package vsatisfies [package provide Tk] 8.7-]}]
proc controlPointerWarpTiming {{duration 50}} {
variable idle_pointer_warping
@@ -256,6 +271,9 @@ testConstraint altDisplay [info exists env(TK_ALT_DISPLAY)]
testConstraint noExceed [expr {
![testConstraint unix] || [catch {font actual "\{xyz"}]
}]
+# constraint for running a test on all windowing system except aqua
+# where the test fails due to a known bug
+testConstraint aquaKnownBug [expr {[testConstraint notAqua] || [testConstraint knownBug]}]
# constraints for testing facilities defined in the tktest executable...
testConstraint testImageType [expr {"test" in [image types]}]
@@ -296,9 +314,6 @@ destroy .t
if {![string match {{22 3 6 15} {31 18 [34] 15}} $x]} {
testConstraint fonts 0
}
-testConstraint textfonts [expr {
- [testConstraint fonts] || [tk windowingsystem] eq "win32"
-}]
# constraints for the visuals available..
testConstraint pseudocolor8 [expr {
diff --git a/tests/entry.test b/tests/entry.test
index d67980a..6c2291c 100644
--- a/tests/entry.test
+++ b/tests/entry.test
@@ -1676,15 +1676,14 @@ test entry-5.7 {ConfigureEntry procedure} -setup {
} -body {
.e configure -font {Courier -12} -width 4 -xscrollcommand scroll
.e insert end "01234567890"
- update idletasks
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ update
+ set scrollInfo wrong
.e configure -width 5
- vwait scrollInfo
+ update
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
- after cancel $timeout
-} -result {0.000000 0.363636}
+} -result {0.000000 0.454545}
test entry-5.8 {ConfigureEntry procedure} -constraints {
@@ -1922,14 +1921,14 @@ test entry-7.1 {InsertChars procedure} -setup {
focus .e
} -body {
.e configure -textvariable contents -xscrollcommand scroll
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ update
+ set scrollInfo wrong
.e insert 0 abcde
.e insert 2 XXX
- vwait scrollInfo
+ update
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 {
@@ -1939,14 +1938,14 @@ test entry-7.2 {InsertChars procedure} -setup {
focus .e
} -body {
.e configure -textvariable contents -xscrollcommand scroll
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ update
+ set scrollInfo wrong
.e insert 0 abcde
.e insert 500 XXX
- vwait scrollInfo
+ update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
- after cancel $timeout
} -result {abcdeXXX abcdeXXX {0.000000 1.000000}}
test entry-7.3 {InsertChars procedure} -setup {
entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
@@ -2073,14 +2072,14 @@ test entry-8.1 {DeleteChars procedure} -setup {
focus .e
} -body {
.e configure -textvariable contents -xscrollcommand scroll
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ update
+ set scrollInfo wrong
.e insert 0 abcde
.e delete 2 4
- vwait scrollInfo
+ update
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
@@ -2089,14 +2088,14 @@ test entry-8.2 {DeleteChars procedure} -setup {
focus .e
} -body {
.e configure -textvariable contents -xscrollcommand scroll
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ update
+ set scrollInfo wrong
.e insert 0 abcde
.e delete -1 2
- vwait scrollInfo
+ update
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
@@ -2105,14 +2104,14 @@ test entry-8.3 {DeleteChars procedure} -setup {
focus .e
} -body {
.e configure -textvariable contents -xscrollcommand scroll
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ update
+ set scrollInfo wrong
.e insert 0 abcde
.e delete 3 1000
- vwait scrollInfo
+ update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
- after cancel $timeout
} -result {abc abc {0.000000 1.000000}}
test entry-8.4 {DeleteChars procedure} -setup {
entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
@@ -2942,41 +2941,39 @@ test entry-16.4 {EntryVisibleRange procedure} -body {
test entry-17.1 {EntryUpdateScrollbar procedure} -body {
entry .e -width 10 -xscrollcommand scroll -font {Courier -12}
- pack .e ; update idletasks
- update idletasks
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ pack .e
+ update
+ set scrollInfo wrong
.e delete 0 end
.e insert 0 123
- vwait scrollInfo
+ update
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
- after cancel $timeout
} -result {0.000000 1.000000}
test entry-17.2 {EntryUpdateScrollbar procedure} -body {
entry .e -width 10 -xscrollcommand scroll -font {Courier -12}
- pack .e ; update idletasks
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ pack .e
+ update
+ set scrollInfo wrong
.e insert 0 0123456789abcdef
.e xview 3
- vwait scrollInfo
+ update
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
- after cancel $timeout
} -result {0.187500 0.812500}
test entry-17.3 {EntryUpdateScrollbar procedure} -body {
entry .e -width 10 -xscrollcommand scroll -font {Courier -12}
- pack .e ; update idletasks
- update idletasks
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ pack .e
+ update
+ set scrollInfo wrong
.e insert 0 abcdefghijklmnopqrs
.e xview 6
- vwait scrollInfo
+ update
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
- after cancel $timeout
} -result {0.315789 0.842105}
test entry-17.4 {EntryUpdateScrollbar procedure} -setup {
proc bgerror msg {
@@ -2985,10 +2982,11 @@ test entry-17.4 {EntryUpdateScrollbar procedure} -setup {
}
} -body {
entry .e -width 5
- pack .e ; update idletasks
- update idletasks
+ pack .e
+ update
+ set scrollInfo wrong
.e configure -xscrollcommand thisisnotacommand
- vwait x
+ update
list $x $errorInfo
} -cleanup {
destroy .e
diff --git a/tests/font.test b/tests/font.test
index 24816e3..b3e286a 100644
--- a/tests/font.test
+++ b/tests/font.test
@@ -2425,7 +2425,7 @@ test font-47.2 {Bug 3049518,TIP 608 - Canvas} -body {
15 [expr {15 + $theight}] \
-width 1 -joinstyle round -smooth true -fill {} -outline blue]
pack $c -fill both -expand 1 -side top
- tkwait visibility $c
+ update
# Lamda test functions
set circle_text {{w user_data text circ} {
@@ -2440,33 +2440,34 @@ test font-47.2 {Bug 3049518,TIP 608 - Canvas} -body {
lassign [$w bbox $text] x0 y0 x1 y1
set offset 5
set coord [lmap expr {
- $x0-5 $y0-5 $x1+5 $y0-5
- $x1+5 $y1+5 $x0-5 $y1+5
+ $x0-$offset $y0-$offset $x1+$offset $y0-$offset
+ $x1+$offset $y1+$offset $x0-$offset $y1+$offset
} {expr $expr}]
if {[catch {$w coord $circ $coord} err]} {
puts Error:$err
}
}}
- set waitfor {{tag {time 333}} {after $time incr ::wait4; vwait ::wait4}}
set enclosed {{can id} {$can find enclosed {*}[$can bbox $id]}}
set results {}
apply $circle_text $c FontChanged $textid $circid
+ update
bind $c <<TkWorldChanged>> [list apply $circle_text %W %d $textid $circid]
- apply $waitfor 1
# Begin test:
set results {}
lappend results [apply $enclosed $c $circid]
font configure MyFont -size 26
- apply $waitfor 2
+ update ; # services the "TheWorldHasChanged" event, queues "TkWorldChanged" events
+ update ; # services the queued "TkWorldChanged" events
lappend results [apply $enclosed $c $circid]
font configure MyFont -size 9
- apply $waitfor 3
+ update idletasks
+ update
lappend results [apply $enclosed $c $circid]
- apply $waitfor 4
font configure MyFont -size 12
- apply $waitfor 5
+ update idletasks
+ update
lappend results [apply $enclosed $c $circid]
} -cleanup {
destroy $c
@@ -2510,11 +2511,6 @@ test font-47.3 {Bug 3049518, TIP 608 - Label} -body {
$w configure -image $img
}}
- set waitfor {{tag {time 500}} {
- after $time incr ::wait4
- vwait ::wait4
- }}
-
set check {{w} {
global results
set f [$w cget -font]
@@ -2529,19 +2525,22 @@ test font-47.3 {Bug 3049518, TIP 608 - Label} -body {
set img [apply ${make-img} $size]
set l [label .t.l -compound left -image $img -text $text -font MyFont]
pack $l -side top -fill both -expand 1
+ update
bind $l <<TkWorldChanged>> [list apply $testWorldChanged %W %d]
set ::results {}
- apply $waitfor 0
apply $check $l
font configure MyFont -size 26
- apply $waitfor 1
+ update ; # services the "TheWorldHasChanged" event, queues "TkWorldChanged" events
+ update ; # services the queued "TkWorldChanged" events
apply $check $l
font configure MyFont -size 9
- apply $waitfor 2
+ update idletasks
+ update
apply $check $l
font configure MyFont -size 13
- apply $waitfor 3
+ update idletasks
+ update
apply $check $l
set results
} -cleanup {
diff --git a/tests/frame.test b/tests/frame.test
index 63bb187..f3fb1e1 100644
--- a/tests/frame.test
+++ b/tests/frame.test
@@ -54,7 +54,7 @@ proc colorsFree {w {red 31} {green 245} {blue 192}} {
test frame-1.1 {frame configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f -class NewFrame
.f configure -class
@@ -71,7 +71,7 @@ test frame-1.2 {frame configuration options} -setup {
} -returnCodes error -result {can't modify -class option after widget is created}
test frame-1.3 {frame configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f -colormap new
.f configure -colormap
@@ -88,7 +88,7 @@ test frame-1.4 {frame configuration options} -setup {
} -returnCodes error -result {can't modify -colormap option after widget is created}
test frame-1.5 {frame configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f -visual default
.f configure -visual
@@ -105,14 +105,14 @@ test frame-1.6 {frame configuration options} -setup {
} -returnCodes error -result {can't modify -visual option after widget is created}
test frame-1.7 {frame configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f -screen bogus
} -cleanup {
deleteWindows
} -returnCodes error -result {unknown option "-screen"}
test frame-1.8 {frame configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f -container true
} -cleanup {
@@ -127,14 +127,14 @@ test frame-1.9 {frame configuration options} -setup {
deleteWindows
} -result {-container container Container 0 1}
test frame-1.10 {frame configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f -container bogus
} -cleanup {
deleteWindows
} -returnCodes error -result {expected boolean value but got "bogus"}
test frame-1.11 {frame configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f
.f configure -container 1
@@ -142,7 +142,7 @@ test frame-1.11 {frame configuration options} -setup {
deleteWindows
} -returnCodes error -result {can't modify -container option after widget is created}
test frame-1.12 {frame configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
# Make sure all options can be set to the default value
frame .f
@@ -287,7 +287,7 @@ destroy .f
test frame-2.1 {toplevel configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -width 200 -height 100 -class NewClass
wm geometry .t +0+0
@@ -306,7 +306,7 @@ test frame-2.2 {toplevel configuration options} -setup {
} -returnCodes error -result {can't modify -class option after widget is created}
test frame-2.3 {toplevel configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -width 200 -height 100 -colormap new
wm geometry .t +0+0
@@ -325,7 +325,7 @@ test frame-2.4 {toplevel configuration options} -setup {
} -returnCodes error -result {can't modify -colormap option after widget is created}
test frame-2.5 {toplevel configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -width 200 -height 100
wm geometry .t +0+0
@@ -346,7 +346,7 @@ test frame-2.6 {toplevel configuration options} -setup {
} -result {-container container Container 0 0}
test frame-2.7 {toplevel configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -width 200 -height 100 -colormap bogus
} -cleanup {
@@ -357,7 +357,7 @@ test frame-2.7 {toplevel configuration options} -setup {
test frame-2.8 {toplevel configuration options} -constraints {
win
} -setup {
- deleteWindows
+ deleteWindows
} -body {
catch {destroy .t}
toplevel .t -width 200 -height 100
@@ -395,7 +395,7 @@ test frame-2.10 {toplevel configuration options} -constraints {
test frame-2.11 {toplevel configuration options} -constraints {
nonwin
} -setup {
- deleteWindows
+ deleteWindows
} -body {
catch {destroy .t}
toplevel .t -width 200 -height 100
@@ -407,7 +407,7 @@ test frame-2.11 {toplevel configuration options} -constraints {
} -result {-use use Use {} {}}
test frame-2.12 {toplevel configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
catch {destroy .t}
toplevel .t -width 200 -height 100 -visual default
@@ -428,14 +428,14 @@ test frame-2.13 {toplevel configuration options} -setup {
} -returnCodes error -result {can't modify -visual option after widget is created}
test frame-2.14 {toplevel configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -width 200 -height 100 -visual who_knows?
} -cleanup {
deleteWindows
} -returnCodes error -result {unknown or ambiguous visual name "who_knows?": class must be best, directcolor, grayscale, greyscale, pseudocolor, staticcolor, staticgray, staticgrey, truecolor, or default}
test frame-2.15 {toplevel configuration options} -constraints haveDISPLAY -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -width 200 -height 100 -screen $env(DISPLAY)
wm geometry .t +0+0
@@ -454,14 +454,14 @@ test frame-2.16 {toplevel configuration options} -constraints haveDISPLAY -setup
} -returnCodes error -result {can't modify -screen option after widget is created}
test frame-2.17 {toplevel configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -width 200 -height 100 -screen bogus
} -cleanup {
deleteWindows
} -returnCodes error -result {couldn't connect to display "bogus"}
test frame-2.18 {toplevel configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -container 1 -width 300 -height 120
wm geometry .t +0+0
@@ -470,7 +470,7 @@ test frame-2.18 {toplevel configuration options} -setup {
deleteWindows
} -returnCodes error -result {windows cannot have both the -use and the -container option set}
test frame-2.19 {toplevel configuration options} -setup {
- deleteWindows
+ deleteWindows
set opts {}
} -body {
# Make sure all options can be set to the default value
@@ -582,7 +582,7 @@ test frame-3.1 {TkCreateFrame procedure} -body {
frame
} -returnCodes error -result {wrong # args: should be "frame pathName ?-option value ...?"}
test frame-3.2 {TkCreateFrame procedure} -setup {
- deleteWindows
+ deleteWindows
frame .f
} -body {
.f configure -class
@@ -590,7 +590,7 @@ test frame-3.2 {TkCreateFrame procedure} -setup {
deleteWindows
} -result {-class class Class Frame Frame}
test frame-3.3 {TkCreateFrame procedure} -setup {
- deleteWindows
+ deleteWindows
toplevel .t
wm geometry .t +0+0
} -body {
@@ -599,7 +599,7 @@ test frame-3.3 {TkCreateFrame procedure} -setup {
deleteWindows
} -result {-class class Class Toplevel Toplevel}
test frame-3.4 {TkCreateFrame procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -width 350 -class NewClass -bg black -visual default -height 90
wm geometry .t +0+0
@@ -614,7 +614,7 @@ test frame-3.4 {TkCreateFrame procedure} -setup {
# Be sure that the -class, -colormap, and -visual options are processed
# before configuring the widget.
test frame-3.5 {TkCreateFrame procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
option add *NewFrame.background #123456
frame .f -class NewFrame
@@ -624,7 +624,7 @@ test frame-3.5 {TkCreateFrame procedure} -setup {
option clear
} -result {#123456}
test frame-3.7 {TkCreateFrame procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
option add *NewFrame.background #332211
option add *f.class NewFrame
@@ -635,7 +635,7 @@ test frame-3.7 {TkCreateFrame procedure} -setup {
option clear
} -result {NewFrame #332211}
test frame-3.8 {TkCreateFrame procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
option add *Silly.background #122334
option add *f.Class Silly
@@ -648,7 +648,7 @@ test frame-3.8 {TkCreateFrame procedure} -setup {
test frame-3.9 {TkCreateFrame procedure, -use option} -constraints {
unix
} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -container 1 -width 300 -height 120
wm geometry .t +0+0
@@ -658,12 +658,6 @@ test frame-3.9 {TkCreateFrame procedure, -use option} -constraints {
[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
-# Development version to make debugging symbols available, adding a print
-# statement, or calling update idletasks here, would make the test pass
-# with no segfault.
- update idletasks
deleteWindows
} -result {0 0 140 300}
test frame-3.10 {TkCreateFrame procedure, -use option} -constraints {
@@ -704,7 +698,7 @@ if {[testConstraint defaultPseudocolor8]} {
test frame-3.11 {TkCreateFrame procedure} -constraints {
defaultPseudocolor8 nonPortable
} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -width 300 -height 200 -bg #475601
wm geometry .t +0+0
@@ -716,7 +710,7 @@ test frame-3.11 {TkCreateFrame procedure} -constraints {
test frame-3.12 {TkCreateFrame procedure} -constraints {
defaultPseudocolor8 nonPortable
} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -width 300 -height 200 -bg #475601 -colormap new
wm geometry .t +0+0
@@ -728,7 +722,7 @@ test frame-3.12 {TkCreateFrame procedure} -constraints {
test frame-3.13 {TkCreateFrame procedure} -constraints {
defaultPseudocolor8 nonPortable
} -setup {
- deleteWindows
+ deleteWindows
} -body {
option add *t.class Toplevel2
option add *Toplevel2.colormap new
@@ -743,7 +737,7 @@ test frame-3.13 {TkCreateFrame procedure} -constraints {
test frame-3.14 {TkCreateFrame procedure} -constraints {
defaultPseudocolor8 nonPortable
} -setup {
- deleteWindows
+ deleteWindows
} -body {
option add *t.class Toplevel3
option add *Toplevel3.Colormap new
@@ -771,7 +765,7 @@ test frame-3.15 {TkCreateFrame procedure, -use and -colormap} -constraints {
test frame-3.16 {TkCreateFrame procedure} -constraints {
defaultPseudocolor8 nonPortable
} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -width 300 -height 200 -bg #475601 -visual default
wm geometry .t +0+0
@@ -783,7 +777,7 @@ test frame-3.16 {TkCreateFrame procedure} -constraints {
test frame-3.17 {TkCreateFrame procedure} -constraints {
defaultPseudocolor8 nonPortable
} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -width 300 -height 200 -bg #475601 -visual default \
-colormap new
@@ -796,7 +790,7 @@ test frame-3.17 {TkCreateFrame procedure} -constraints {
test frame-3.18 {TkCreateFrame procedure} -constraints {
defaultPseudocolor8 haveGrayscale8 nonPortable
} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -visual {grayscale 8} -width 300 -height 200 -bg #434343
wm geometry .t +0+0
@@ -808,7 +802,7 @@ test frame-3.18 {TkCreateFrame procedure} -constraints {
test frame-3.19 {TkCreateFrame procedure} -constraints {
defaultPseudocolor8 haveGrayscale8 nonPortable
} -setup {
- deleteWindows
+ deleteWindows
} -body {
option add *t.class T4
option add *T4.visual {grayscale 8}
@@ -823,7 +817,7 @@ test frame-3.19 {TkCreateFrame procedure} -constraints {
test frame-3.20 {TkCreateFrame procedure} -constraints {
defaultPseudocolor8 haveGrayscale8 nonPortable
} -setup {
- deleteWindows
+ deleteWindows
} -body {
set x ok
option add *t.class T5
@@ -839,7 +833,7 @@ test frame-3.20 {TkCreateFrame procedure} -constraints {
test frame-3.21 {TkCreateFrame procedure} -constraints {
defaultPseudocolor8 haveGrayscale8 nonPortable
} -setup {
- deleteWindows
+ deleteWindows
} -body {
set x ok
toplevel .t -visual {grayscale 8} -width 300 -height 200 -bg #434343
@@ -854,7 +848,7 @@ if {[testConstraint defaultPseudocolor8]} {
}
test frame-3.22 {TkCreateFrame procedure, default dimensions} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t
wm geometry .t +0+0
@@ -881,13 +875,13 @@ test frame-3.24 {TkCreateFrame procedure} -setup {
test frame-4.1 {TkCreateFrame procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
catch {frame .f -gorp glob}
winfo exists .f
} -result 0
test frame-4.2 {TkCreateFrame procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
list [frame .f -width 200 -height 100] [winfo exists .f]
} -cleanup {
@@ -944,7 +938,7 @@ test frame-5.13 {FrameWidgetCommand procedure, configure option} -body {
destroy .f
test frame-6.1 {ConfigureFrame procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f -width 150
list [winfo reqwidth .f] [winfo reqheight .f]
@@ -952,7 +946,7 @@ test frame-6.1 {ConfigureFrame procedure} -setup {
deleteWindows
} -result {150 1}
test frame-6.2 {ConfigureFrame procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f -height 97
list [winfo reqwidth .f] [winfo reqheight .f]
@@ -960,7 +954,7 @@ test frame-6.2 {ConfigureFrame procedure} -setup {
deleteWindows
} -result {1 97}
test frame-6.3 {ConfigureFrame procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f
set result {}
@@ -974,7 +968,7 @@ test frame-6.3 {ConfigureFrame procedure} -setup {
} -result {1 1 100 180 100 180}
test frame-7.1 {FrameEventProc procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .frame2
set result [info commands .frame2]
@@ -982,7 +976,7 @@ test frame-7.1 {FrameEventProc procedure} -setup {
lappend result [info commands .frame2]
} -result {.frame2 {}}
test frame-7.2 {FrameEventProc procedure} -setup {
- deleteWindows
+ deleteWindows
set x {}
} -body {
frame .f1 -bg #543210
@@ -996,7 +990,7 @@ test frame-7.2 {FrameEventProc procedure} -setup {
} -result {.f1 #543210 {} {}}
test frame-8.1 {FrameCmdDeletedProc procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1
rename .f1 {}
@@ -1005,7 +999,7 @@ test frame-8.1 {FrameCmdDeletedProc procedure} -setup {
deleteWindows
} -result {{} {}}
test frame-8.2 {FrameCmdDeletedProc procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .f1 -menu .m
wm geometry .f1 +0+0
@@ -1036,18 +1030,18 @@ test frame-8.2 {FrameCmdDeletedProc procedure} -setup {
#} -result {{} .m}
test frame-9.1 {MapFrame procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -width 100 -height 400
wm geometry .t +0+0
set result [winfo ismapped .t]
- update idletasks
+ update
lappend result [winfo ismapped .t]
} -cleanup {
deleteWindows
} -result {0 1}
test frame-9.2 {MapFrame procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -width 100 -height 400
wm geometry .t +0+0
@@ -1056,7 +1050,7 @@ test frame-9.2 {MapFrame procedure} -setup {
winfo exists .t
} -result {0}
test frame-9.3 {MapFrame procedure, window deleted while mapping} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t2 -width 200 -height 200
wm geometry .t2 +0+0
@@ -1066,7 +1060,7 @@ test frame-9.3 {MapFrame procedure, window deleted while mapping} -setup {
frame .t2.f -width 50 -height 50
bind .t2.f <Configure> {destroy .t}
pack .t2.f -side top
- update idletasks
+ update
winfo exists .t
} -cleanup {
deleteWindows
@@ -1074,7 +1068,7 @@ test frame-9.3 {MapFrame procedure, window deleted while mapping} -setup {
test frame-10.1 {frame widget vs hidden commands} -setup {
- deleteWindows
+ deleteWindows
} -body {
set l [interp hidden]
frame .t
@@ -1087,7 +1081,7 @@ test frame-10.1 {frame widget vs hidden commands} -setup {
test frame-11.1 {TkInstallFrameMenu} -setup {
- deleteWindows
+ deleteWindows
} -body {
menu .m1
.m1 add cascade -menu .m1.system
@@ -1098,7 +1092,7 @@ test frame-11.1 {TkInstallFrameMenu} -setup {
deleteWindows
} -result {.t}
test frame-11.2 {TkInstallFrameMenu - frame renamed} -setup {
- deleteWindows
+ deleteWindows
} -body {
catch {rename foo {}}
menu .m1
@@ -1113,7 +1107,7 @@ test frame-11.2 {TkInstallFrameMenu - frame renamed} -setup {
test frame-12.1 {FrameWorldChanged procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
# Test -bd -padx and -pady
frame .f -borderwidth 2 -padx 3 -pady 4
@@ -1125,7 +1119,7 @@ test frame-12.1 {FrameWorldChanged procedure} -setup {
deleteWindows
} -result {5 6 30 28}
test frame-12.2 {FrameWorldChanged procedure} -setup {
- deleteWindows
+ deleteWindows
} -body {
# Test all -labelanchor positions
set font {helvetica 12}
@@ -1161,27 +1155,19 @@ test frame-12.2 {FrameWorldChanged procedure} -setup {
deleteWindows
} -result {1 1 1 1 1 1 1 1 1 1 1 1}
test frame-12.3 {FrameWorldChanged procedure} -setup {
- deleteWindows
- update idletasks
+ deleteWindows
} -body {
# Check reaction on font change
font create myfont -family courier -size 10
labelframe .f -font myfont -text Mupp
place .f -x 0 -y 0 -width 40 -height 40
pack [frame .f.f] -fill both -expand 1
- if {[tk windowingsystem] eq "aqua"} {
- update idletasks
- } else {
- update
- }
+ update
set h1 [font metrics myfont -linespace]
set y1 [winfo y .f.f]
font configure myfont -size 20
- if {[tk windowingsystem] eq "aqua"} {
- update idletasks
- } else {
- update
- }
+ update ; # services the "TheWorldHasChanged" event, queues "TkWorldChanged" events
+ update ; # services the queued "TkWorldChanged" events
set h2 [font metrics myfont -linespace]
set y2 [winfo y .f.f]
expr {($h2 - $h1) - ($y2 - $y1)}
@@ -1208,28 +1194,28 @@ test frame-13.2 {labelframe configuration options} -setup {
deleteWindows
} -returnCodes error -result {can't modify -class option after widget is created}
test frame-13.3 {labelframe configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
labelframe .f -colormap new
} -cleanup {
deleteWindows
} -result {.f}
test frame-13.4 {labelframe configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
labelframe .f -visual default
} -cleanup {
deleteWindows
} -result {.f}
test frame-13.5 {labelframe configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
labelframe .f -screen bogus
} -cleanup {
deleteWindows
} -returnCodes error -result {unknown option "-screen"}
test frame-13.6 {labelframe configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
labelframe .f -container true
} -cleanup {
@@ -1244,14 +1230,14 @@ test frame-13.7 {labelframe configuration options} -setup {
deleteWindows
} -result {-container container Container 0 1}
test frame-13.8 {labelframe configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
labelframe .f -container bogus
} -cleanup {
deleteWindows
} -returnCodes error -result {expected boolean value but got "bogus"}
test frame-13.9 {labelframe configuration options} -setup {
- deleteWindows
+ deleteWindows
} -body {
labelframe .f
.f configure -container 1
@@ -1427,7 +1413,7 @@ destroy .f
test frame-14.1 {labelframe labelwidget option} -setup {
- deleteWindows
+ deleteWindows
} -body {
# Test that label is moved in stacking order
label .l -text Mupp -font {helvetica 8}
@@ -1442,7 +1428,7 @@ test frame-14.1 {labelframe labelwidget option} -setup {
deleteWindows
} -result {{.f .l} 54 52}
test frame-14.2 {labelframe labelwidget option} -setup {
- deleteWindows
+ deleteWindows
} -body {
# Test the labelframe's reaction if the label is destroyed
label .l -text Aratherlonglabel
@@ -1461,7 +1447,7 @@ test frame-14.2 {labelframe labelwidget option} -setup {
deleteWindows
} -result {.l 12 {} 4}
test frame-14.3 {labelframe labelwidget option} -setup {
- deleteWindows
+ deleteWindows
} -body {
# Test the labelframe's reaction if the label is stolen
label .l -text Aratherlonglabel
@@ -1480,7 +1466,7 @@ test frame-14.3 {labelframe labelwidget option} -setup {
deleteWindows
} -result {.l 12 {} 4}
test frame-14.4 {labelframe labelwidget option} -setup {
- deleteWindows
+ deleteWindows
} -body {
# Test the label's reaction if the labelframe is destroyed
label .l -text Mupp
@@ -1494,7 +1480,7 @@ test frame-14.4 {labelframe labelwidget option} -setup {
deleteWindows
} -result {labelframe {}}
test frame-14.5 {labelframe labelwidget option} -setup {
- deleteWindows
+ deleteWindows
} -body {
# Test that the labelframe reacts on changes in label
label .l -text Aratherlonglabel
@@ -1517,7 +1503,7 @@ test frame-14.5 {labelframe labelwidget option} -setup {
deleteWindows
} -result {12 12 1 12 1}
test frame-14.6 {labelframe labelwidget option} -setup {
- deleteWindows
+ deleteWindows
} -body {
# Destroying a labelframe with a child label caused a crash
# when not handling mapping of the label correctly.
diff --git a/tests/imgBmap.test b/tests/imgBmap.test
index 56484a6..bb54012 100644
--- a/tests/imgBmap.test
+++ b/tests/imgBmap.test
@@ -221,7 +221,7 @@ test imageBmap-4.1 {ImgBmapConfigureInstance procedure: check error handling} -s
test imageBmap-5.1 {GetBitmapData procedure} -body {
list [catch {image create bitmap -file ~bad_user/a/b} msg] \
[string tolower $msg]
-} -result {1 {user "bad_user" doesn't exist}}
+} -result {1 {couldn't read bitmap file "~bad_user/a/b": no such file or directory}}
test imageBmap-5.2 {GetBitmapData procedure} -body {
list [catch {image create bitmap -file bad_name} msg] [string tolower $msg]
} -result {1 {couldn't read bitmap file "bad_name": no such file or directory}}
diff --git a/tests/menubut.test b/tests/menubut.test
index b8a52a9..81794f7 100644
--- a/tests/menubut.test
+++ b/tests/menubut.test
@@ -542,7 +542,7 @@ test menubutton-6.1 {MenuButtonCmdDeletedProc procedure} -setup {
deleteWindows
} -result {{} {}}
-if {[tk windowingsystem] == "aqua"} {
+if {[tk windowingsystem] eq "aqua"} {
set extraWidth 36
} else {
set extraWidth 0
diff --git a/tests/option.test b/tests/option.test
index 5e1568e..2292996 100644
--- a/tests/option.test
+++ b/tests/option.test
@@ -421,7 +421,7 @@ set opt162val {label {
}
set opt162list [split $opt162val \n]
-test option-16.2 {ticket 766ef52f3} {
+test option-16.2 {ticket 766ef52f3} -body {
set option5 [makeFile {} option.file4]
set file [open $option5 w]
fconfigure $file -translation crlf
@@ -429,7 +429,9 @@ test option-16.2 {ticket 766ef52f3} {
close $file
option read $option5 userDefault
option get . notok notok
-} $opt162list
+} -cleanup {
+ removeFile $option5
+} -result $opt162list
deleteWindows
diff --git a/tests/panedwindow.test b/tests/panedwindow.test
index bb3a7fd..29e0ced 100644
--- a/tests/panedwindow.test
+++ b/tests/panedwindow.test
@@ -293,17 +293,17 @@ deleteWindows
test panedwindow-2.1 {panedwindow widget command} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p foo
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {bad command "foo": must be add, cget, configure, forget, identify, panecget, paneconfigure, panes, proxy, or sash}
test panedwindow-3.1 {panedwindow panes subcommand} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b]
@@ -312,20 +312,20 @@ test panedwindow-3.1 {panedwindow panes subcommand} -setup {
.p forget .b
lappend result [.p panes]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list [list .b .c] [list .c]]
test panedwindow-4.1 {forget subcommand} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p forget
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {wrong # args: should be ".p forget widget ?widget ...?"}
test panedwindow-4.2 {forget subcommand, forget one from start} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b]
@@ -334,10 +334,10 @@ test panedwindow-4.2 {forget subcommand, forget one from start} -setup {
.p forget .b
lappend result [.p panes]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list {.b .c} .c]
test panedwindow-4.3 {forget subcommand, forget one from end} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b]
@@ -348,10 +348,10 @@ test panedwindow-4.3 {forget subcommand, forget one from end} -setup {
update
lappend result [.p panes]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list {.b .c .d} {.b .c}]
test panedwindow-4.4 {forget subcommand, forget multiple} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b]
@@ -362,10 +362,10 @@ test panedwindow-4.4 {forget subcommand, forget multiple} -setup {
update
lappend result [.p panes]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list {.b .c .d} .d]
test panedwindow-4.5 {forget subcommand, panes are unmapped} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b]
@@ -377,10 +377,10 @@ test panedwindow-4.5 {forget subcommand, panes are unmapped} -setup {
update
lappend result [winfo ismapped .b] [winfo ismapped .c]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 1 1 0 1]
test panedwindow-4.6 {forget subcommand, changes reqsize of panedwindow} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
.p add [frame .f -width 20 -height 20] [frame .g -width 20 -height 20]
@@ -388,244 +388,244 @@ test panedwindow-4.6 {forget subcommand, changes reqsize of panedwindow} -setup
.p forget .f
lappend result [winfo reqwidth .p]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 44 20]
test panedwindow-5.1 {sash subcommand} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p sash
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {wrong # args: should be ".p sash option ?arg ...?"}
test panedwindow-5.2 {sash subcommand} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p sash foo
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {bad option "foo": must be coord, dragto, mark, or place}
test panedwindow-6.1 {sash coord subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p sash coord
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {wrong # args: should be ".p sash coord index"}
test panedwindow-6.2 {sash coord subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {invalid sash index}
test panedwindow-6.3 {sash coord subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p sash coord foo
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-6.4 {sash coord subcommand sashes correctly placed} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -showhandle false
.p add [frame .p.f -width 20 -height 20] \
- [frame .p.f2 -width 20 -height 20] \
- [frame .p.f3 -width 20 -height 20]
+ [frame .p.f2 -width 20 -height 20] \
+ [frame .p.f3 -width 20 -height 20]
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 22 0]
test panedwindow-6.5 {sash coord subcommand sashes correctly placed} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -showhandle false
.p add [frame .p.f -width 20 -height 20] \
- [frame .p.f2 -width 20 -height 20] \
- [frame .p.f3 -width 20 -height 20]
+ [frame .p.f2 -width 20 -height 20] \
+ [frame .p.f3 -width 20 -height 20]
.p sash coord 1
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 50 0]
test panedwindow-6.6 {sash coord subcommand, sashes correctly placed} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -orient vertical \
-showhandle false
.p add [frame .p.f -width 20 -height 20] \
- [frame .p.f2 -width 20 -height 20] \
- [frame .p.f3 -width 20 -height 20]
+ [frame .p.f2 -width 20 -height 20] \
+ [frame .p.f3 -width 20 -height 20]
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 22]
test panedwindow-6.7 {sash coord subcommand, sashes correctly placed} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -orient vertical \
-showhandle false
.p add [frame .p.f -width 20 -height 20] \
- [frame .p.f2 -width 20 -height 20] \
- [frame .p.f3 -width 20 -height 20]
+ [frame .p.f2 -width 20 -height 20] \
+ [frame .p.f3 -width 20 -height 20]
.p sash coord 1
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 50]
test panedwindow-6.8 {sash coord subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
list [catch {.p sash coord -1} msg] $msg \
[catch {.p sash coord 0} msg] $msg \
[catch {.p sash coord 1} msg] $msg
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"]
test panedwindow-6.9 {sash coord subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
# There are no sashes until you have 2 panes
panedwindow .p
.p add [frame .p.f]
list [catch {.p sash coord -1} msg] $msg \
- [catch {.p sash coord 0} msg] $msg \
- [catch {.p sash coord 1} msg] $msg
+ [catch {.p sash coord 0} msg] $msg \
+ [catch {.p sash coord 1} msg] $msg
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"]
test panedwindow-6.10 {sash coord subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
# There are no sashes until you have 2 panes
panedwindow .p
.p add [frame .p.f] [frame .p.f2]
list [catch {.p sash coord -1} msg] $msg \
- [catch {.p sash coord 0} msg] \
- [catch {.p sash coord 1} msg] $msg \
- [catch {.p sash coord 2} msg] $msg
+ [catch {.p sash coord 0} msg] \
+ [catch {.p sash coord 1} msg] $msg \
+ [catch {.p sash coord 2} msg] $msg
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 1 "invalid sash index" 0 1 "invalid sash index" 1 "invalid sash index"]
test panedwindow-7.1 {sash mark subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p sash mark
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {wrong # args: should be ".p sash mark index ?x y?"}
test panedwindow-7.2 {sash mark subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p sash mark foo
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-7.3 {sash mark subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p sash mark 0 foo bar
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {invalid sash index}
test panedwindow-7.4 {sash mark subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b] [button .c]
.p sash mark 0 foo bar
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-7.5 {sash mark subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b] [button .c]
.p sash mark 0 0 bar
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {expected integer but got "bar"}
test panedwindow-7.6 {sash mark subcommand, mark defaults to 0 0} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b] [button .c]
.p sash mark 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 0]
test panedwindow-7.7 {sash mark subcommand, set mark} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b] [button .c]
.p sash mark 0 10 10
.p sash mark 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 10 10]
test panedwindow-8.1 {sash dragto subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p sash dragto
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {wrong # args: should be ".p sash dragto index x y"}
test panedwindow-8.2 {sash dragto subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p sash dragto foo bar baz
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-8.3 {sash dragto subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p sash dragto 0 foo bar
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {invalid sash index}
test panedwindow-8.4 {sash dragto subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b] [button .c]
.p sash dragto 0 foo bar
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-8.5 {sash dragto subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b] [button .c]
.p sash dragto 0 0 bar
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {expected integer but got "bar"}
test panedwindow-9.1 {sash mark/sash dragto interaction} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
.p add [frame .f -width 20 -height 20] [button .c -text foobar]
@@ -633,10 +633,10 @@ test panedwindow-9.1 {sash mark/sash dragto interaction} -setup {
.p sash dragto 0 20 10
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 30 0]
test panedwindow-9.2 {sash mark/sash dragto interaction} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -orient vertical \
-showhandle false
@@ -645,10 +645,10 @@ test panedwindow-9.2 {sash mark/sash dragto interaction} -setup {
.p sash dragto 0 10 20
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 30]
test panedwindow-9.3 {sash mark/sash dragto, respects minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
.p add [frame .f -width 20 -height 20] [button .c] -minsize 15
@@ -656,95 +656,95 @@ test panedwindow-9.3 {sash mark/sash dragto, respects minsize} -setup {
.p sash dragto 0 10 10
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 15 0]
test panedwindow-10.1 {sash place subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p sash place
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {wrong # args: should be ".p sash place index x y"}
test panedwindow-10.2 {sash place subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p sash place foo bar baz
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-10.3 {sash place subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p sash place 0 foo bar
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {invalid sash index}
test panedwindow-10.4 {sash place subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b] [button .c]
.p sash place 0 foo bar
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-10.5 {sash place subcommand, errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b] [button .c]
.p sash place 0 0 bar
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {expected integer but got "bar"}
test panedwindow-10.6 {sash place subcommand, moves sash} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4
.p add [frame .f -width 20 -height 20] [button .c]
.p sash place 0 10 0
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 10 0]
test panedwindow-10.7 {sash place subcommand, moves sash} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -orient vertical
.p add [frame .f -width 20 -height 20] [button .c]
.p sash place 0 0 10
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 10]
test panedwindow-10.8 {sash place subcommand, respects minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
.p add [frame .f -width 20 -height 20] [button .c] -minsize 15
.p sash place 0 10 0
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 15 0]
test panedwindow-10.9 {sash place subcommand, respects minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [frame .f -width 20 -height 20 -bg pink]
.p sash place 0 2 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {invalid sash index}
test panedwindow-11.1 {moving sash changes size of pane to left} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
.p add [frame .f -width 20 -height 20] [button .c -text foobar] -sticky nsew
@@ -754,7 +754,7 @@ test panedwindow-11.1 {moving sash changes size of pane to left} -setup {
winfo width .f
} -result 30
test panedwindow-11.2 {moving sash changes size of pane to right} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
.p add [frame .f -width 20 -height 20] [frame .f2 -width 20 -height 20]
@@ -765,10 +765,10 @@ test panedwindow-11.2 {moving sash changes size of pane to right} -setup {
update
lappend result [winfo width .f2]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {20 10}
test panedwindow-11.3 {moving sash does not change reqsize of panedwindow} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
.p add [frame .f -width 20 -height 20] [frame .f2 -width 20 -height 20]
@@ -776,7 +776,7 @@ test panedwindow-11.3 {moving sash does not change reqsize of panedwindow} -setu
winfo reqwidth .p
} -result 44
test panedwindow-11.4 {moving sash changes size of pane above} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
-orient vertical
@@ -788,7 +788,7 @@ test panedwindow-11.4 {moving sash changes size of pane above} -setup {
set result
} -result 20
test panedwindow-11.5 {moving sash changes size of pane below} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
-orient vertical
@@ -801,10 +801,10 @@ test panedwindow-11.5 {moving sash changes size of pane below} -setup {
lappend result [winfo height .f2]
set result
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {10 5}
test panedwindow-11.6 {moving sash does not change reqsize of panedwindow} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
-orient vertical
@@ -814,10 +814,10 @@ test panedwindow-11.6 {moving sash does not change reqsize of panedwindow} -setu
lappend result [winfo reqheight .p]
set result
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 24 24]
test panedwindow-11.7 {moving sash does not alter reqsize of widget} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
-orient vertical
@@ -826,10 +826,10 @@ test panedwindow-11.7 {moving sash does not alter reqsize of widget} -setup {
.p sash place 0 0 20
lappend result [winfo reqheight .f]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 10 10]
test panedwindow-11.8 {moving sash restricted to minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
.p add [frame .f -width 20 -height 20] [button .c] -minsize 15
@@ -839,7 +839,7 @@ test panedwindow-11.8 {moving sash restricted to minsize} -setup {
winfo width .f
} -result 15
test panedwindow-11.9 {moving sash restricted to minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
-orient vertical
@@ -850,7 +850,7 @@ test panedwindow-11.9 {moving sash restricted to minsize} -setup {
winfo height .f
} -result 10
test panedwindow-11.10 {moving sash in unmapped window restricted to reqsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
.p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20]
@@ -858,64 +858,64 @@ test panedwindow-11.10 {moving sash in unmapped window restricted to reqsize} -s
.p sash place 0 100 0
lappend result [.p sash coord 0]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list {20 0} {40 0}]
test panedwindow-11.11 {moving sash right pushes other sashes} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
.p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
- [frame .f3 -width 20 -height 30]
+ [frame .f3 -width 20 -height 30]
.p sash place 0 80 0
list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {{60 0} {64 0}}
test panedwindow-11.12 {moving sash left pushes other sashes} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
.p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
- [frame .f3 -width 20 -height 30]
+ [frame .f3 -width 20 -height 30]
.p sash place 1 0 0
list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {{0 0} {4 0}}
test panedwindow-11.13 {move sash in mapped window restricted to visible win} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
.p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
- [frame .f3 -width 20 -height 30]
+ [frame .f3 -width 20 -height 30]
place .p -width 50
update
.p sash place 1 100 0
update
.p sash coord 1
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {46 0}
test panedwindow-11.14 {move sash in mapped window restricted to visible win} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
.p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
- [frame .f3 -width 20 -height 30]
+ [frame .f3 -width 20 -height 30]
place .p -width 100
update
.p sash place 1 200 0
update
.p sash coord 1
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {96 0}
test panedwindow-11.15 {moving sash into "virtual" space on last pane increases reqsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
.p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
- [frame .f3 -width 20 -height 30]
+ [frame .f3 -width 20 -height 30]
place .p -width 100
set result [winfo reqwidth .p]
update
@@ -923,12 +923,12 @@ test panedwindow-11.15 {moving sash into "virtual" space on last pane increases
update
lappend result [winfo reqwidth .p]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {68 100}
test panedwindow-12.1 {horizontal panedwindow lays out widgets properly} -setup {
- deleteWindows
+ deleteWindows
set result {}
} -body {
panedwindow .p -showhandle false -borderwidth 2 -sashpad 2 -sashwidth 2
@@ -938,10 +938,10 @@ test panedwindow-12.1 {horizontal panedwindow lays out widgets properly} -setup
foreach w [.p panes] {lappend result [winfo x $w] [winfo y $w]}
return $result
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 2 2 28 2 54 2]
test panedwindow-12.2 {vertical panedwindow lays out widgets properly} -setup {
- deleteWindows
+ deleteWindows
set result {}
} -body {
panedwindow .p -showhandle false -borderwidth 2 -sashpad 2 -sashwidth 2 \
@@ -952,15 +952,15 @@ test panedwindow-12.2 {vertical panedwindow lays out widgets properly} -setup {
foreach w [.p panes] {lappend result [winfo x $w] [winfo y $w]}
return $result
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 2 2 2 18 2 34]
test panedwindow-12.3 {horizontal panedwindow lays out widgets properly} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
foreach {win color} {.p.f blue .p.f2 green} {
- .p add [frame $win -width 20 -height 20 -bg $color] -padx 10 -pady 5 \
- -sticky ""
+ .p add [frame $win -width 20 -height 20 -bg $color] -padx 10 -pady 5 \
+ -sticky ""
}
pack .p
update
@@ -972,15 +972,15 @@ test panedwindow-12.3 {horizontal panedwindow lays out widgets properly} -setup
foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]}
return $result
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 80 30 10 5 50 5 60 30 0 5 30 5]
test panedwindow-12.4 {vertical panedwindow lays out widgets properly} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
-orient vertical
foreach win {.p.f .p.f2} {
- .p add [frame $win -width 20 -height 20] -padx 10 -pady 5 -sticky ""
+ .p add [frame $win -width 20 -height 20] -padx 10 -pady 5 -sticky ""
}
pack .p
update
@@ -992,10 +992,10 @@ test panedwindow-12.4 {vertical panedwindow lays out widgets properly} -setup {
foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]}
return $result
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 40 60 10 5 10 35 40 50 10 0 10 25]
test panedwindow-12.5 {panedwindow respects reqsize of panes when possible} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
.p add [frame .p.f -width 20 -height 20] -sticky ""
@@ -1006,10 +1006,10 @@ test panedwindow-12.5 {panedwindow respects reqsize of panes when possible} -set
update
lappend result [winfo width .p.f]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 20 30]
test panedwindow-12.6 {panedwindow takes explicit widget width over reqwidth} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
.p add [frame .p.f -width 20 -height 20] -width 20 -sticky ""
@@ -1020,10 +1020,10 @@ test panedwindow-12.6 {panedwindow takes explicit widget width over reqwidth} -s
update
lappend result [winfo width .p.f]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 20 20]
test panedwindow-12.7 {horizontal panedwindow reqheight is max pane height} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
.p add [frame .p.f -width 20 -height 20] [frame .p.f2 -width 20 -height 20]
@@ -1031,10 +1031,10 @@ test panedwindow-12.7 {horizontal panedwindow reqheight is max pane height} -set
.p.f config -height 40
lappend result [winfo reqheight .p]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {20 40}
test panedwindow-12.8 {horizontal panedwindow reqheight is max pane height} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]}
@@ -1043,10 +1043,10 @@ test panedwindow-12.8 {horizontal panedwindow reqheight is max pane height} -set
.p.f config -height 40
lappend result [winfo reqheight .p]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {20 20}
test panedwindow-12.9 {panedwindow pane width overrides widget width} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]}
@@ -1057,10 +1057,10 @@ test panedwindow-12.9 {panedwindow pane width overrides widget width} -setup {
.p paneconfigure .p.f -width 30
lappend result [winfo width .p.f]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 10 10]
test panedwindow-12.10 {panedwindow respects reqsize of panes when possible} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
.p add [frame .p.f -width 20 -height 20] -sticky ""
@@ -1071,10 +1071,10 @@ test panedwindow-12.10 {panedwindow respects reqsize of panes when possible} -se
update
lappend result [winfo height .p.f]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 20 30]
test panedwindow-12.11 {panedwindow takes explicit height over reqheight} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
.p add [frame .p.f -width 20 -height 20] -height 20 -sticky ""
@@ -1085,10 +1085,10 @@ test panedwindow-12.11 {panedwindow takes explicit height over reqheight} -setup
update
lappend result [winfo height .p.f]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 20 20]
test panedwindow-12.12 {vertical panedwindow reqwidth is max pane width} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
-orient vertical
@@ -1097,10 +1097,10 @@ test panedwindow-12.12 {vertical panedwindow reqwidth is max pane width} -setup
.p.f config -width 40
lappend result [winfo reqwidth .p]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {20 40}
test panedwindow-12.13 {vertical panedwindow reqwidth is max pane width} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
-orient vertical
@@ -1110,10 +1110,10 @@ test panedwindow-12.13 {vertical panedwindow reqwidth is max pane width} -setup
.p.f config -width 40
lappend result [winfo reqwidth .p]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {20 20}
test panedwindow-12.14 {panedwindow pane height overrides widget width} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
-orient vertical
@@ -1125,12 +1125,12 @@ test panedwindow-12.14 {panedwindow pane height overrides widget width} -setup {
.p paneconfigure .p.f -height 30
lappend result [winfo height .p.f]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 10 10]
test panedwindow-13.1 {PanestructureProc, widget yields managements} -setup {
- deleteWindows
+ deleteWindows
} -body {
# Check that the panedwindow correctly yields geometry management of
# a pane when the pane is destroyed.
@@ -1145,7 +1145,7 @@ test panedwindow-13.1 {PanestructureProc, widget yields managements} -setup {
set result ""
} -result {}
test panedwindow-13.2 {PanedWindowLostPaneProc, widget yields management} -setup {
- deleteWindows
+ deleteWindows
} -body {
# Check that the paned window correctly yields geometry management of
# a pane when some other geometry manager steals the pane from us.
@@ -1495,7 +1495,7 @@ test panedwindow-15.16 {panedwindow sticky works} -setup {
test panedwindow-16.1 {setting minsize when pane is too small snaps width} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
.p add [frame .p.f -height 20 -width 20 -bg red]
@@ -1503,17 +1503,17 @@ test panedwindow-16.1 {setting minsize when pane is too small snaps width} -setu
.p paneconfigure .p.f -minsize 40
lappend result [winfo reqwidth .p]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 20 40]
test panedwindow-17.1 {MoveSash, move right} -setup {
- deleteWindows
+ deleteWindows
set result {}
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Get the requested width of the paned window
@@ -1527,14 +1527,14 @@ test panedwindow-17.1 {MoveSash, move right} -setup {
# Check that the sash moved
lappend result [.p sash coord 0]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 42 42 {30 0}]
test panedwindow-17.2 {MoveSash, move right (unmapped) clipped by reqwidth} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
.p sash place 0 100 0
@@ -1543,14 +1543,14 @@ test panedwindow-17.2 {MoveSash, move right (unmapped) clipped by reqwidth} -set
# the panedwindow.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 40 0]
test panedwindow-17.3 {MoveSash, move right (mapped, width < reqwidth) clipped by width} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Put the panedwindow up on the display and give it a width < reqwidth
@@ -1563,14 +1563,14 @@ test panedwindow-17.3 {MoveSash, move right (mapped, width < reqwidth) clipped b
# the panedwindow.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 30 0]
test panedwindow-17.4 {MoveSash, move right (mapped, width > reqwidth) clipped by width} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Put the panedwindow up on the display and give it a width > reqwidth
@@ -1583,14 +1583,14 @@ test panedwindow-17.4 {MoveSash, move right (mapped, width > reqwidth) clipped b
# the panedwindow.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 100 0]
test panedwindow-17.5 {MoveSash, move right respects minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
}
.p sash place 0 100 0
@@ -1599,14 +1599,14 @@ test panedwindow-17.5 {MoveSash, move right respects minsize} -setup {
# respecting minsizes.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 30 0]
test panedwindow-17.6 {MoveSash, move right respects minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
}
.p sash place 0 100 0
@@ -1614,14 +1614,14 @@ test panedwindow-17.6 {MoveSash, move right respects minsize} -setup {
# Get the new sash coord; it should have moved as far as possible.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 40 0]
test panedwindow-17.7 {MoveSash, move right pushes other sashes} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
.p sash place 0 100 0
@@ -1630,14 +1630,14 @@ test panedwindow-17.7 {MoveSash, move right pushes other sashes} -setup {
# respecting minsizes.
.p sash coord 1
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 62 0]
test panedwindow-17.8 {MoveSash, move right pushes other sashes, respects minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
}
.p sash place 0 100 0
@@ -1646,15 +1646,15 @@ test panedwindow-17.8 {MoveSash, move right pushes other sashes, respects minsiz
# respecting minsizes.
.p sash coord 1
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 52 0]
test panedwindow-17.9 {MoveSash, move right respects minsize, exludes pad} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] \
- -sticky nsew -minsize 10 -padx 5
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize 10 -padx 5
}
.p sash place 0 100 0
@@ -1663,15 +1663,15 @@ test panedwindow-17.9 {MoveSash, move right respects minsize, exludes pad} -setu
# respecting minsizes.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 50 0]
test panedwindow-17.10 {MoveSash, move right, negative minsize becomes 0} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] \
- -sticky nsew -minsize -50
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize -50
}
.p sash place 0 50 0
@@ -1680,15 +1680,15 @@ test panedwindow-17.10 {MoveSash, move right, negative minsize becomes 0} -setup
# respecting minsizes.
list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list [list 50 0] [list 52 0]]
test panedwindow-17.11 {MoveSash, move left} -setup {
- deleteWindows
+ deleteWindows
} -body {
set result {}
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Get the requested width of the paned window
@@ -1702,14 +1702,14 @@ test panedwindow-17.11 {MoveSash, move left} -setup {
# Check that the sash moved
lappend result [.p sash coord 0]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 42 42 {10 0}]
test panedwindow-17.12 {MoveSash, move left, can't move outside of window} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
.p sash place 0 -100 0
@@ -1718,14 +1718,14 @@ test panedwindow-17.12 {MoveSash, move left, can't move outside of window} -setu
# the panedwindow.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 0]
test panedwindow-17.13 {MoveSash, move left respects minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
}
.p sash place 0 0 0
@@ -1734,14 +1734,14 @@ test panedwindow-17.13 {MoveSash, move left respects minsize} -setup {
# respecting minsizes.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 10 0]
test panedwindow-17.14 {MoveSash, move left respects minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
}
.p sash place 1 0 0
@@ -1749,14 +1749,14 @@ test panedwindow-17.14 {MoveSash, move left respects minsize} -setup {
# Get the new sash coord; it should have moved as far as possible.
.p sash coord 1
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 22 0]
test panedwindow-17.15 {MoveSash, move left pushes other sashes} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
.p sash place 1 0 0
@@ -1765,14 +1765,14 @@ test panedwindow-17.15 {MoveSash, move left pushes other sashes} -setup {
# respecting minsizes.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 0]
test panedwindow-17.16 {MoveSash, move left pushes other sashes, respects minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
}
.p sash place 1 0 0
@@ -1781,15 +1781,15 @@ test panedwindow-17.16 {MoveSash, move left pushes other sashes, respects minsiz
# respecting minsizes.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 10 0]
test panedwindow-17.17 {MoveSash, move left respects minsize, exludes pad} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] \
- -sticky nsew -minsize 10 -padx 5
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize 10 -padx 5
}
.p sash place 1 0 0
@@ -1798,15 +1798,15 @@ test panedwindow-17.17 {MoveSash, move left respects minsize, exludes pad} -setu
# respecting minsizes.
.p sash coord 1
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 42 0]
test panedwindow-17.18 {MoveSash, move left, negative minsize becomes 0} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
foreach w {.f1 .f2 .f3} c {red blue green} {
- .p add [frame $w -height 20 -width 20 -bg $c] \
- -sticky nsew -minsize -50
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize -50
}
.p sash place 1 10 0
@@ -1815,18 +1815,18 @@ test panedwindow-17.18 {MoveSash, move left, negative minsize becomes 0} -setup
# respecting minsizes.
list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list [list 8 0] [list 10 0]]
test panedwindow-18.1 {MoveSash, move down} -setup {
- deleteWindows
+ deleteWindows
} -body {
set result {}
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Get the requested width of the paned window
@@ -1840,15 +1840,15 @@ test panedwindow-18.1 {MoveSash, move down} -setup {
# Check that the sash moved
lappend result [.p sash coord 0]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 42 42 {0 30}]
test panedwindow-18.2 {MoveSash, move down (unmapped) clipped by reqheight} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
.p sash place 0 0 100
@@ -1857,15 +1857,15 @@ test panedwindow-18.2 {MoveSash, move down (unmapped) clipped by reqheight} -set
# the panedwindow.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 40]
test panedwindow-18.3 {MoveSash, move down (mapped, height < reqheight) clipped by height} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Put the panedwindow up on the display and give it a height < reqheight
@@ -1878,15 +1878,15 @@ test panedwindow-18.3 {MoveSash, move down (mapped, height < reqheight) clipped
# the panedwindow.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 30]
test panedwindow-18.4 {MoveSash, move down (mapped, height > reqheight) clipped by height} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Put the panedwindow up on the display and give it a width > reqwidth
@@ -1899,15 +1899,15 @@ test panedwindow-18.4 {MoveSash, move down (mapped, height > reqheight) clipped
# the panedwindow.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 100]
test panedwindow-18.5 {MoveSash, move down respects minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
}
.p sash place 0 0 100
@@ -1916,15 +1916,15 @@ test panedwindow-18.5 {MoveSash, move down respects minsize} -setup {
# respecting minsizes.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 30]
test panedwindow-18.6 {MoveSash, move down respects minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
}
.p sash place 0 0 100
@@ -1933,15 +1933,15 @@ test panedwindow-18.6 {MoveSash, move down respects minsize} -setup {
# respecting minsizes.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 40]
test panedwindow-18.7 {MoveSash, move down pushes other sashes} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
.p sash place 0 0 100
@@ -1950,15 +1950,15 @@ test panedwindow-18.7 {MoveSash, move down pushes other sashes} -setup {
# respecting minsizes.
.p sash coord 1
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 62]
test panedwindow-18.8 {MoveSash, move down pushes other sashes, respects minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
}
.p sash place 0 0 100
@@ -1967,16 +1967,16 @@ test panedwindow-18.8 {MoveSash, move down pushes other sashes, respects minsize
# respecting minsizes.
.p sash coord 1
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 52]
test panedwindow-18.9 {MoveSash, move down respects minsize, exludes pad} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] \
- -sticky nsew -minsize 10 -pady 5
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize 10 -pady 5
}
.p sash place 0 0 100
@@ -1985,16 +1985,16 @@ test panedwindow-18.9 {MoveSash, move down respects minsize, exludes pad} -setup
# respecting minsizes.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 50]
test panedwindow-18.10 {MoveSash, move right, negative minsize becomes 0} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] \
- -sticky nsew -minsize -50
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize -50
}
.p sash place 0 0 50
@@ -2003,16 +2003,16 @@ test panedwindow-18.10 {MoveSash, move right, negative minsize becomes 0} -setup
# respecting minsizes.
list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list [list 0 50] [list 0 52]]
test panedwindow-18.11 {MoveSash, move up} -setup {
- deleteWindows
+ deleteWindows
} -body {
set result {}
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
# Get the requested width of the paned window
@@ -2026,15 +2026,15 @@ test panedwindow-18.11 {MoveSash, move up} -setup {
# Check that the sash moved
lappend result [.p sash coord 0]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 42 42 {0 10}]
test panedwindow-18.12 {MoveSash, move up, can't move outside of window} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
.p sash place 0 0 -100
@@ -2043,15 +2043,15 @@ test panedwindow-18.12 {MoveSash, move up, can't move outside of window} -setup
# the panedwindow.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 0]
test panedwindow-18.13 {MoveSash, move up respects minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
}
.p sash place 0 0 0
@@ -2060,15 +2060,15 @@ test panedwindow-18.13 {MoveSash, move up respects minsize} -setup {
# respecting minsizes.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 10]
test panedwindow-18.14 {MoveSash, move up respects minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
}
.p sash place 1 0 0
@@ -2076,15 +2076,15 @@ test panedwindow-18.14 {MoveSash, move up respects minsize} -setup {
# Get the new sash coord; it should have moved as far as possible.
.p sash coord 1
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 22]
test panedwindow-18.15 {MoveSash, move up pushes other sashes} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
}
.p sash place 1 0 0
@@ -2093,15 +2093,15 @@ test panedwindow-18.15 {MoveSash, move up pushes other sashes} -setup {
# respecting minsizes.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 0]
test panedwindow-18.16 {MoveSash, move up pushes other sashes, respects minsize} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
}
.p sash place 1 0 0
@@ -2110,16 +2110,16 @@ test panedwindow-18.16 {MoveSash, move up pushes other sashes, respects minsize}
# respecting minsizes.
.p sash coord 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 10]
test panedwindow-18.17 {MoveSash, move up respects minsize, exludes pad} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2 .f3} c {red blue} {
- .p add [frame $w -height 20 -width 20 -bg $c] \
- -sticky nsew -minsize 10 -pady 5
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize 10 -pady 5
}
.p sash place 1 0 0
@@ -2128,16 +2128,16 @@ test panedwindow-18.17 {MoveSash, move up respects minsize, exludes pad} -setup
# respecting minsizes.
.p sash coord 1
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list 0 42]
test panedwindow-18.18 {MoveSash, move up, negative minsize becomes 0} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
foreach w {.f1 .f2 .f3} c {red blue green} {
- .p add [frame $w -height 20 -width 20 -bg $c] \
- -sticky nsew -minsize -50
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize -50
}
.p sash place 1 0 10
@@ -2146,7 +2146,7 @@ test panedwindow-18.18 {MoveSash, move up, negative minsize becomes 0} -setup {
# respecting minsizes.
list [.p sash coord 0] [.p sash coord 1]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list [list 0 8] [list 0 10]]
@@ -2155,90 +2155,90 @@ test panedwindow-18.18 {MoveSash, move up, negative minsize becomes 0} -setup {
# geometry.
test panedwindow-19.1 {ComputeGeometry, reqheight taken from widgets} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
foreach w {.f1 .f2 .f3} {
- .p add [frame $w -width 20 -height 20 -bg blue]
+ .p add [frame $w -width 20 -height 20 -bg blue]
}
set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
.f3 configure -height 40
lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list [list 60 20] [list 60 40]]
test panedwindow-19.2 {ComputeGeometry, reqheight taken from widgets} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
foreach w {.f1 .f2 .f3} {
- .p add [frame $w -width 20 -height 20 -bg blue]
+ .p add [frame $w -width 20 -height 20 -bg blue]
}
set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
.p paneconfigure .f3 -height 40
lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list [list 60 20] [list 60 40]]
test panedwindow-19.3 {ComputeGeometry, reqheight taken from widgets} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
foreach w {.f1 .f2 .f3} {
- .p add [frame $w -width 20 -height 20 -bg blue] -pady 20
+ .p add [frame $w -width 20 -height 20 -bg blue] -pady 20
}
set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
.p paneconfigure .f3 -height 40
lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list [list 60 60] [list 60 80]]
test panedwindow-19.4 {ComputeGeometry, reqwidth taken from widgets} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
-orient vertical
foreach w {.f1 .f2 .f3} {
- .p add [frame $w -width 20 -height 20 -bg blue]
+ .p add [frame $w -width 20 -height 20 -bg blue]
}
set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
.f3 configure -width 40
lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list [list 20 60] [list 40 60]]
test panedwindow-19.5 {ComputeGeometry, reqwidth taken from widgets} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
-orient vertical
foreach w {.f1 .f2 .f3} {
- .p add [frame $w -width 20 -height 20 -bg blue]
+ .p add [frame $w -width 20 -height 20 -bg blue]
}
set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
.p paneconfigure .f3 -width 40
lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list [list 20 60] [list 40 60]]
test panedwindow-19.6 {ComputeGeometry, reqwidth taken from widgets} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
-orient vertical
foreach w {.f1 .f2 .f3} {
- .p add [frame $w -width 20 -height 20 -bg blue] -padx 20
+ .p add [frame $w -width 20 -height 20 -bg blue] -padx 20
}
set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
.p paneconfigure .f3 -width 40
lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list [list 60 60] [list 80 60]]
test panedwindow-19.7 {ComputeGeometry, one pane, reqsize set properly} -setup {
@@ -4308,21 +4308,21 @@ test panedwindow-19.134 {ComputeGeometry/ArrangePanes, pane coords, vert} -setup
test panedwindow-20.1 {destroyed widgets are removed from panedwindow} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [frame .f -width 20 -height 20 -bg blue]
destroy .f
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {}
test panedwindow-20.2 {destroyed pane causes geometry recomputation} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 2
.p add [frame .f -width 20 -height 20 -bg blue] \
- [frame .f2 -width 20 -height 20 -bg red]
+ [frame .f2 -width 20 -height 20 -bg red]
destroy .f
winfo reqwidth .p
} -cleanup {
@@ -4331,11 +4331,11 @@ test panedwindow-20.2 {destroyed pane causes geometry recomputation} -setup {
test panedwindow-21.1 {ArrangePanes, extra space is given to the last pane} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
.p add [frame .f1 -width 20 -height 20 -bg blue] \
- [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
+ [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
place .p -width 100 -x 0 -y 0
update
winfo width .f2
@@ -4343,12 +4343,12 @@ test panedwindow-21.1 {ArrangePanes, extra space is given to the last pane} -set
deleteWindows
} -result 78
test panedwindow-21.2 {ArrangePanes, extra space is given to the last pane} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
.p add [frame .f1 -width 20 -height 20 -bg blue] \
- [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
+ [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
place .p -height 100 -x 0 -y 0
update
winfo height .f2
@@ -4356,51 +4356,51 @@ test panedwindow-21.2 {ArrangePanes, extra space is given to the last pane} -set
deleteWindows
} -result 78
test panedwindow-21.3 {ArrangePanes, explicit height/width are preferred} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
.p add [frame .f1 -width 20 -height 20 -bg blue] \
- [frame .f2 -width 20 -height 20 -bg red] -sticky ""
+ [frame .f2 -width 20 -height 20 -bg red] -sticky ""
.p paneconfigure .f1 -width 10 -height 15
pack .p
update
list [winfo width .f1] [winfo height .f1]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {10 15}
test panedwindow-21.4 {ArrangePanes, panes clipped by size of pane} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
.p add [frame .f1 -width 20 -height 20 -bg blue] \
- [frame .f2 -width 20 -height 20 -bg red]
+ [frame .f2 -width 20 -height 20 -bg red]
.p sash place 0 10 0
pack .p
update
list [winfo width .f1] [winfo height .f1]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {10 20}
test panedwindow-21.5 {ArrangePanes, panes clipped by size of pane} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
.p add [frame .f1 -width 20 -height 20 -bg blue] \
- [frame .f2 -width 20 -height 20 -bg red]
+ [frame .f2 -width 20 -height 20 -bg red]
.p sash place 0 0 10
pack .p
update
list [winfo width .f1] [winfo height .f1]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {20 10}
test panedwindow-21.6 {ArrangePanes, height of pane taken from total height} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
.p add [frame .p.f1 -width 20 -height 20 -bg blue] \
- [frame .p.f2 -width 20 -height 40 -bg red] -sticky ""
+ [frame .p.f2 -width 20 -height 40 -bg red] -sticky ""
pack .p
update
winfo y .p.f1
@@ -4408,12 +4408,12 @@ test panedwindow-21.6 {ArrangePanes, height of pane taken from total height} -se
deleteWindows
} -result 10
test panedwindow-21.7 {ArrangePanes, width of pane taken from total width} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
.p add [frame .p.f1 -width 20 -height 20 -bg blue] \
- [frame .p.f2 -width 40 -height 40 -bg red] -sticky ""
+ [frame .p.f2 -width 40 -height 40 -bg red] -sticky ""
pack .p
update
winfo x .p.f1
@@ -4421,11 +4421,11 @@ test panedwindow-21.7 {ArrangePanes, width of pane taken from total width} -setu
deleteWindows
} -result 10
test panedwindow-21.8 {ArrangePanes, panes with width <= 0 are unmapped} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
.p add [frame .f1 -width 20 -height 20 -bg blue] \
- [frame .f2 -width 20 -height 40 -bg red]
+ [frame .f2 -width 20 -height 40 -bg red]
pack .p
update
set result [winfo ismapped .f1]
@@ -4433,14 +4433,14 @@ test panedwindow-21.8 {ArrangePanes, panes with width <= 0 are unmapped} -setup
update
lappend result [winfo ismapped .f1]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {1 0}
test panedwindow-21.9 {ArrangePanes, panes with width <= 0 are unmapped} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
.p add [frame .p.f1 -width 20 -height 20 -bg blue] \
- [frame .p.f2 -width 20 -height 40 -bg red]
+ [frame .p.f2 -width 20 -height 40 -bg red]
pack .p
update
set result [winfo ismapped .p.f1]
@@ -4448,14 +4448,14 @@ test panedwindow-21.9 {ArrangePanes, panes with width <= 0 are unmapped} -setup
update
lappend result [winfo ismapped .p.f1]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {1 0}
test panedwindow-21.10 {ArrangePanes, panes with width <= 0 are unmapped} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 -orient vertical
.p add [frame .p.f1 -width 20 -height 20 -bg blue] \
- [frame .p.f2 -width 20 -height 40 -bg red]
+ [frame .p.f2 -width 20 -height 40 -bg red]
pack .p
update
set result [winfo ismapped .p.f1]
@@ -4463,14 +4463,14 @@ test panedwindow-21.10 {ArrangePanes, panes with width <= 0 are unmapped} -setup
update
lappend result [winfo ismapped .p.f1]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {1 0}
test panedwindow-21.11 {ArrangePanes, last pane shrinks} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
.p add [frame .f1 -width 20 -height 20 -bg blue] \
- [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
+ [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
place .p -width 40 -x 0 -y 0
update
winfo width .f2
@@ -4478,12 +4478,12 @@ test panedwindow-21.11 {ArrangePanes, last pane shrinks} -setup {
deleteWindows
} -result 18
test panedwindow-21.12 {ArrangePanes, last pane shrinks} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
-orient vertical
.p add [frame .f1 -width 20 -height 20 -bg blue] \
- [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
+ [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
place .p -height 40 -x 0 -y 0
update
winfo height .f2
@@ -4491,67 +4491,67 @@ test panedwindow-21.12 {ArrangePanes, last pane shrinks} -setup {
deleteWindows
} -result 18
test panedwindow-21.13 {ArrangePanes, panedwindow resizes} -setup {
- deleteWindows
+ deleteWindows
} -body {
- panedwindow .p -width 200 -borderwidth 0
- frame .f1 -height 50 -bg blue
- set result [list]
- lappend result [winfo reqwidth .p] [winfo reqheight .p]
- .p add .f1
- pack .p
- lappend result [winfo reqwidth .p] [winfo reqheight .p]
+ panedwindow .p -width 200 -borderwidth 0
+ frame .f1 -height 50 -bg blue
+ set result [list]
+ lappend result [winfo reqwidth .p] [winfo reqheight .p]
+ .p add .f1
+ pack .p
+ lappend result [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
deleteWindows
} -result {200 1 200 50}
test panedwindow-21.14 {ArrangePanes, panedwindow resizes} -setup {
- deleteWindows
+ deleteWindows
} -body {
- panedwindow .p -height 200 -borderwidth 0 -orient vertical
- frame .f1 -width 50 -bg blue
- set result [list]
- lappend result [winfo reqwidth .p] [winfo reqheight .p]
- .p add .f1
- pack .p
- lappend result [winfo reqwidth .p] [winfo reqheight .p]
+ panedwindow .p -height 200 -borderwidth 0 -orient vertical
+ frame .f1 -width 50 -bg blue
+ set result [list]
+ lappend result [winfo reqwidth .p] [winfo reqheight .p]
+ .p add .f1
+ pack .p
+ lappend result [winfo reqwidth .p] [winfo reqheight .p]
} -cleanup {
deleteWindows
} -result {1 200 50 200}
test panedwindow-21.15 {ArrangePanes, last pane grows} -setup {
- deleteWindows
-} -body {
- panedwindow .p -showhandle false -height 50
- .p add [frame .f1 -width 50 -bg red] [frame .f2 -width 50 -bg white] \
- [frame .f3 -width 50 -bg blue] [frame .f4 -width 50 -bg green]
- .p sash place 1 250 0
- pack .p
- update
- set result [list]
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
- [winfo width .f4] [winfo width .p]
- .p configure -width 300
- update
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
- [winfo width .f4] [winfo width .p]
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -height 50
+ .p add [frame .f1 -width 50 -bg red] [frame .f2 -width 50 -bg white] \
+ [frame .f3 -width 50 -bg blue] [frame .f4 -width 50 -bg green]
+ .p sash place 1 250 0
+ pack .p
+ update
+ set result [list]
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4] [winfo width .p]
+ .p configure -width 300
+ update
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4] [winfo width .p]
} -cleanup {
deleteWindows
} -result {50 150 1 1 211 50 150 1 89 300}
test panedwindow-22.1 {PanedWindowReqProc, react to pane geometry changes} -setup {
- deleteWindows
+ deleteWindows
} -body {
# Basically just want to make sure that the PanedWindowReqProc is called
panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 2
.p add [frame .f1 -width 20 -height 20 -bg blue] \
- [frame .f2 -width 20 -height 40 -bg red]
+ [frame .f2 -width 20 -height 40 -bg red]
set result [winfo reqheight .p]
.f1 configure -height 80
lappend result [winfo reqheight .p]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {40 80}
test panedwindow-22.2 {PanedWindowReqProc, react to pane geometry changes} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -orient horizontal -sashpad 0 -sashwidth 2
.p add [frame .f1 -width 10] [frame .f2 -width 10]
@@ -4561,97 +4561,97 @@ test panedwindow-22.2 {PanedWindowReqProc, react to pane geometry changes} -setu
destroy .p .f1 .f2
expr {[lindex $result 1] - [lindex $result 0]}
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {10}
test panedwindow-23.1 {ConfigurePanes, can't add panedwindow to itself} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add .p
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {can't add .p to itself}
test panedwindow-23.2 {ConfigurePanes, bad window throws error} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add .b
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {bad window path name ".b"}
test panedwindow-23.3 {ConfigurePanes, bad window aborts processing} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
button .b
catch {.p add .b .a}
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {}
test panedwindow-23.4 {ConfigurePanes, bad option aborts processing} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
button .b
catch {.p add .b -sticky foobar}
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {}
test panedwindow-23.5 {ConfigurePanes, after win isn't managed by panedwin} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
button .b
button .c
.p add .b -after .c
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {window ".c" is not managed by .p}
test panedwindow-23.6 {ConfigurePanes, before win isn't managed by panedwin} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
button .b
button .c
.p add .b -before .c
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {window ".c" is not managed by .p}
test panedwindow-23.7 {ConfigurePanes, -after {} is a no-op} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b] [button .c]
.p paneconfigure .b -after {}
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.b .c}
test panedwindow-23.8 {ConfigurePanes, -before {} is a no-op} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b] [button .c]
.p paneconfigure .b -before {}
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.b .c}
test panedwindow-23.9 {ConfigurePanes, new panes are added} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b] [button .c]
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.b .c}
test panedwindow-23.10 {ConfigurePanes, options applied to all panes} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b] [button .c] -sticky ne -height 5 -width 5 -minsize 10
@@ -4665,22 +4665,22 @@ test panedwindow-23.10 {ConfigurePanes, options applied to all panes} -setup {
}
return $result
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.b {-sticky ne -height 5 -width 5 -minsize 10} .c {-sticky ne -height 5 -width 5 -minsize 10}}
test panedwindow-23.11 {ConfigurePanes, existing panes are reconfigured} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b] -sticky nw -height 10
.p add .b [button .c] -sticky se -height 2
list [.p panes] [.p panecget .b -sticky] [.p panecget .b -height] \
- [.p panecget .c -sticky] [.p panecget .c -height]
+ [.p panecget .c -sticky] [.p panecget .c -height]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result [list {.b .c} es 2 es 2]
test panedwindow-23.12 {ConfigurePanes, widgets added to end by default} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p add [button .b]
@@ -4688,10 +4688,10 @@ test panedwindow-23.12 {ConfigurePanes, widgets added to end by default} -setup
.p add [button .d]
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.b .c .d}
test panedwindow-23.13 {ConfigurePanes, -after, single addition} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
button .a
@@ -4702,10 +4702,10 @@ test panedwindow-23.13 {ConfigurePanes, -after, single addition} -setup {
.p add .c -after .a
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.a .c .b}
test panedwindow-23.14 {ConfigurePanes, -after, multiple additions} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
button .a
@@ -4717,10 +4717,10 @@ test panedwindow-23.14 {ConfigurePanes, -after, multiple additions} -setup {
.p add .c .d -after .a
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.a .c .d .b}
test panedwindow-23.15 {ConfigurePanes, -after, relocates existing widget} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
button .a
@@ -4732,10 +4732,10 @@ test panedwindow-23.15 {ConfigurePanes, -after, relocates existing widget} -setu
.p add .d -after .a
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.a .d .b .c}
test panedwindow-23.16 {ConfigurePanes, -after, relocates existing widgets} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
button .a
@@ -4747,10 +4747,10 @@ test panedwindow-23.16 {ConfigurePanes, -after, relocates existing widgets} -set
.p add .b .d -after .a
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.a .b .d .c}
test panedwindow-23.17 {ConfigurePanes, -after, relocates existing widgets} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
button .a
@@ -4762,10 +4762,10 @@ test panedwindow-23.17 {ConfigurePanes, -after, relocates existing widgets} -set
.p add .d .a -after .b
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.b .d .a .c}
test panedwindow-23.18 {ConfigurePanes, -after, relocates existing widgets} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
button .a
@@ -4777,10 +4777,10 @@ test panedwindow-23.18 {ConfigurePanes, -after, relocates existing widgets} -set
.p add .d .a -after .a
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.d .a .b .c}
test panedwindow-23.19 {ConfigurePanes, -after, after last window} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
button .a
@@ -4792,10 +4792,10 @@ test panedwindow-23.19 {ConfigurePanes, -after, after last window} -setup {
.p add .d -after .c
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.a .b .c .d}
test panedwindow-23.20 {ConfigurePanes, -before, before first window} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
button .a
@@ -4807,10 +4807,10 @@ test panedwindow-23.20 {ConfigurePanes, -before, before first window} -setup {
.p add .d -before .a
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.d .a .b .c}
test panedwindow-23.21 {ConfigurePanes, -before, relocate existing windows} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
button .a
@@ -4822,10 +4822,10 @@ test panedwindow-23.21 {ConfigurePanes, -before, relocate existing windows} -set
.p add .d .b -before .a
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.d .b .a .c}
test panedwindow-23.22 {ConfigurePanes, pane specified multiple times} -setup {
- deleteWindows
+ deleteWindows
} -body {
# This test should not cause a core dump
@@ -4837,10 +4837,10 @@ test panedwindow-23.22 {ConfigurePanes, pane specified multiple times} -setup {
.p add .a .a .b .c
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.a .b .c}
test panedwindow-23.23 {ConfigurePanes, pane specified multiple times} -setup {
- deleteWindows
+ deleteWindows
} -body {
# This test should not cause a core dump
@@ -4853,48 +4853,48 @@ test panedwindow-23.23 {ConfigurePanes, pane specified multiple times} -setup {
.p add .a .b .a -after .c
.p panes
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.c .a .b}
test panedwindow-23.24 {ConfigurePanes, panedwindow cannot manage toplevels} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
toplevel .t
.p add .t
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {can't add toplevel .t to .p}
test panedwindow-23.25 {ConfigurePanes, restrict possible panes} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
frame .f
button .f.b
.p add .f.b
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {can't add .f.b to .p}
test panedwindow-23.26 {ConfigurePanes, restrict possible panes} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f
panedwindow .f.p
button .b
.f.p add .b
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {}
test panedwindow-23.27 {ConfigurePanes, restrict possible panes} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
button .p.b
.p add .p.b
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {}
test panedwindow-23.28 {ConfigurePanes, restrict possible panes} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f
frame .f.f
@@ -4903,60 +4903,60 @@ test panedwindow-23.28 {ConfigurePanes, restrict possible panes} -setup {
button .b
.f.f.f.p add .b
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {}
test panedwindow-23.29 {ConfigurePanes, -hide works} -setup {
- deleteWindows
-} -body {
- panedwindow .p -showhandle false
- frame .f1 -width 40 -height 100 -bg red
- frame .f2 -width 40 -height 100 -bg white
- frame .f3 -width 40 -height 100 -bg blue
- frame .f4 -width 40 -height 100 -bg green
- .p add .f1 .f2 .f3 .f4
- pack .p
- update
- set result [list]
- lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
- [winfo ismapped .f3] [winfo ismapped .f4]
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
- [winfo width .f4] [winfo width .p]
- .p paneconfigure .f2 -hide 1
- update
- lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
- [winfo ismapped .f3] [winfo ismapped .f4]
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
- [winfo width .f4] [winfo width .p]
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false
+ frame .f1 -width 40 -height 100 -bg red
+ frame .f2 -width 40 -height 100 -bg white
+ frame .f3 -width 40 -height 100 -bg blue
+ frame .f4 -width 40 -height 100 -bg green
+ .p add .f1 .f2 .f3 .f4
+ pack .p
+ update
+ set result [list]
+ lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
+ [winfo ismapped .f3] [winfo ismapped .f4]
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4] [winfo width .p]
+ .p paneconfigure .f2 -hide 1
+ update
+ lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
+ [winfo ismapped .f3] [winfo ismapped .f4]
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4] [winfo width .p]
} -cleanup {
deleteWindows
} -result {1 1 1 1 40 40 40 40 171 1 0 1 1 40 40 40 40 128}
test panedwindow-23.30 {ConfigurePanes, -hide works} -setup {
- deleteWindows
-} -body {
- panedwindow .p -showhandle false -width 130 -height 100
- frame .f1 -width 40 -bg red
- frame .f2 -width 40 -bg white
- frame .f3 -width 40 -bg blue
- frame .f4 -width 40 -bg green
- .p add .f1 .f2 .f3 .f4
- pack .p
- update
- set result [list]
- lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
- [winfo ismapped .f3] [winfo ismapped .f4]
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
- [winfo width .f4] [winfo width .p]
- .p paneconfigure .f2 -hide 1
- update
- lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
- [winfo ismapped .f3] [winfo ismapped .f4]
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
- [winfo width .f4] [winfo width .p]
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -width 130 -height 100
+ frame .f1 -width 40 -bg red
+ frame .f2 -width 40 -bg white
+ frame .f3 -width 40 -bg blue
+ frame .f4 -width 40 -bg green
+ .p add .f1 .f2 .f3 .f4
+ pack .p
+ update
+ set result [list]
+ lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
+ [winfo ismapped .f3] [winfo ismapped .f4]
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4] [winfo width .p]
+ .p paneconfigure .f2 -hide 1
+ update
+ lappend result [winfo ismapped .f1] [winfo ismapped .f2] \
+ [winfo ismapped .f3] [winfo ismapped .f4]
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4] [winfo width .p]
} -cleanup {
deleteWindows
} -result {1 1 1 0 39 40 40 1 130 1 0 1 1 40 40 40 42 130}
test panedwindow-23.30a {ConfigurePanes, hidden panes are unmapped} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p1 -sashrelief raised
panedwindow .p2 -sashrelief raised
@@ -4968,151 +4968,151 @@ test panedwindow-23.30a {ConfigurePanes, hidden panes are unmapped} -setup {
.p1 add .p2 -sticky nsew
.p1 add .l1 -sticky nsew
pack .p1 -side top -expand 1 -fill both
- update
- set result [list]
- lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \
- [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]]
+ update
+ set result [list]
+ lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \
+ [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]]
.p2 paneconfigure .l1 -hide 1
- update
- lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \
- [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]]
+ update
+ lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \
+ [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]]
.p1 paneconfigure .p2 -hide 1
- update
- lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \
- [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]]
+ update
+ lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \
+ [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]]
.p1 paneconfigure .p2 -hide 0
- update
- lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \
- [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]]
+ update
+ lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \
+ [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]]
} -cleanup {
deleteWindows
} -result {{1 1 1 1 1} {1 1 0 1 1} {1 0 0 0 0} {1 1 0 1 1}}
test panedwindow-23.31 {ConfigurePanes, -hide works, last pane stretches} -setup {
- deleteWindows
-} -body {
- panedwindow .p -showhandle false -width 200 -height 200 -borderwidth 0
- frame .f1 -width 50 -bg red
- frame .f2 -width 50 -bg green
- frame .f3 -width 50 -bg blue
- .p add .f1 .f2 .f3
- pack .p
- update
- set result [list]
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3]
- .p paneconfigure .f2 -hide 1
- update
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -width 200 -height 200 -borderwidth 0
+ frame .f1 -width 50 -bg red
+ frame .f2 -width 50 -bg green
+ frame .f3 -width 50 -bg blue
+ .p add .f1 .f2 .f3
+ pack .p
+ update
+ set result [list]
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3]
+ .p paneconfigure .f2 -hide 1
+ update
lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3]
} -cleanup {
deleteWindows
} -result {50 50 94 50 50 147}
test panedwindow-23.32 {ConfigurePanes, -hide works, last pane stretches} -setup {
- deleteWindows
-} -body {
- panedwindow .p -showhandle false -width 200 -height 200 \
- -borderwidth 0 -orient vertical
- frame .f1 -height 50 -bg red
- frame .f2 -height 50 -bg green
- frame .f3 -height 50 -bg blue
- .p add .f1 .f2 .f3
- pack .p
- update
- set result [list]
- lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3]
- .p paneconfigure .f2 -hide 1
- update
- lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3]
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -width 200 -height 200 \
+ -borderwidth 0 -orient vertical
+ frame .f1 -height 50 -bg red
+ frame .f2 -height 50 -bg green
+ frame .f3 -height 50 -bg blue
+ .p add .f1 .f2 .f3
+ pack .p
+ update
+ set result [list]
+ lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3]
+ .p paneconfigure .f2 -hide 1
+ update
+ lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3]
} -cleanup {
deleteWindows
} -result {50 50 94 50 50 147}
test panedwindow-23.33 {ConfigurePanes, -stretch first} -setup {
- deleteWindows
-} -body {
- panedwindow .p -showhandle false -height 100 -width 182
- frame .f1 -width 40 -bg red
- frame .f2 -width 40 -bg white
- frame .f3 -width 40 -bg blue
- frame .f4 -width 40 -bg green
- .p add .f1 .f2 .f3 .f4 -stretch first
- pack .p
- update
- set result [list]
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
- [winfo width .f4]
- .p paneconfigure .f2 -hide 1
- update
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
- [winfo width .f4]
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -height 100 -width 182
+ frame .f1 -width 40 -bg red
+ frame .f2 -width 40 -bg white
+ frame .f3 -width 40 -bg blue
+ frame .f4 -width 40 -bg green
+ .p add .f1 .f2 .f3 .f4 -stretch first
+ pack .p
+ update
+ set result [list]
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4]
+ .p paneconfigure .f2 -hide 1
+ update
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4]
} -cleanup {
deleteWindows
} -result {51 40 40 40 94 40 40 40}
test panedwindow-23.34 {ConfigurePanes, -stretch middle} -setup {
- deleteWindows
-} -body {
- panedwindow .p -showhandle false -height 100 -width 182
- frame .f1 -width 40 -bg red
- frame .f2 -width 40 -bg white
- frame .f3 -width 40 -bg blue
- frame .f4 -width 40 -bg green
- .p add .f1 .f2 .f3 .f4 -stretch middle
- pack .p
- update
- set result [list]
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
- [winfo width .f4]
- .p paneconfigure .f2 -hide 1
- update
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
- [winfo width .f4]
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -height 100 -width 182
+ frame .f1 -width 40 -bg red
+ frame .f2 -width 40 -bg white
+ frame .f3 -width 40 -bg blue
+ frame .f4 -width 40 -bg green
+ .p add .f1 .f2 .f3 .f4 -stretch middle
+ pack .p
+ update
+ set result [list]
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4]
+ .p paneconfigure .f2 -hide 1
+ update
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4]
} -cleanup {
deleteWindows
} -result {40 45 46 40 40 45 94 40}
test panedwindow-23.35 {ConfigurePanes, -stretch always} -setup {
- deleteWindows
-} -body {
- panedwindow .p -showhandle false -height 100 -width 182
- frame .f1 -width 40 -bg red
- frame .f2 -width 40 -bg white
- frame .f3 -width 40 -bg blue
- frame .f4 -width 40 -bg green
- .p add .f1 .f2 .f3 .f4 -stretch always
- pack .p
- update
- set result [list]
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
- [winfo width .f4]
- .p paneconfigure .f2 -hide 1
- update
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
- [winfo width .f4]
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -height 100 -width 182
+ frame .f1 -width 40 -bg red
+ frame .f2 -width 40 -bg white
+ frame .f3 -width 40 -bg blue
+ frame .f4 -width 40 -bg green
+ .p add .f1 .f2 .f3 .f4 -stretch always
+ pack .p
+ update
+ set result [list]
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4]
+ .p paneconfigure .f2 -hide 1
+ update
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4]
} -cleanup {
deleteWindows
} -result {42 43 43 43 58 43 58 58}
test panedwindow-23.36 {ConfigurePanes, -stretch never} -setup {
- deleteWindows
-} -body {
- panedwindow .p -showhandle false -height 100 -width 182
- frame .f1 -width 40 -bg red
- frame .f2 -width 40 -bg white
- frame .f3 -width 40 -bg blue
- frame .f4 -width 40 -bg green
- .p add .f1 .f2 .f3 .f4 -stretch never
- pack .p
- update
- set result [list]
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
- [winfo width .f4]
- .p paneconfigure .f2 -hide 1
- update
- lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
- [winfo width .f4]
+ deleteWindows
+} -body {
+ panedwindow .p -showhandle false -height 100 -width 182
+ frame .f1 -width 40 -bg red
+ frame .f2 -width 40 -bg white
+ frame .f3 -width 40 -bg blue
+ frame .f4 -width 40 -bg green
+ .p add .f1 .f2 .f3 .f4 -stretch never
+ pack .p
+ update
+ set result [list]
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4]
+ .p paneconfigure .f2 -hide 1
+ update
+ lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] \
+ [winfo width .f4]
} -cleanup {
deleteWindows
} -result {40 40 40 40 40 40 40 40}
test panedwindow-24.1 {Unlink, remove a paned with -before/-after refs} -setup {
- deleteWindows
+ deleteWindows
} -body {
# Bug 928413
set result {}
@@ -5129,20 +5129,20 @@ test panedwindow-24.1 {Unlink, remove a paned with -before/-after refs} -setup {
.pw paneconfigure .pw.l2 -before .pw.l1
lappend result [.pw panecget .pw.l2 -before]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {.pw.l3 {} .pw.l1}
test panedwindow-25.1 {DestroyPanedWindow} -setup {
- deleteWindows
+ deleteWindows
} -body {
# This test should not result in any memory leaks.
panedwindow .p
foreach w {.a .b .c .d .e .f .g .h .i .j .k .l .m .n .o .q .r .s .t} {
- .p add [button $w]
+ .p add [button $w]
}
foreach w {.a .b .c .d .e .f .g .h .i .j .k .l .m .n .o .p .q .r .s .t} {
- destroy $w
+ destroy $w
}
set result {}
} -result {}
@@ -5165,307 +5165,307 @@ test panedwindow-25.2 {UnmapNotify and MapNotify events are propagated to panes}
destroy .pw .pw.b
set result
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {1 0 0 1 1}
test panedwindow-26.1 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 0 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {}
test panedwindow-26.2 {PanedWindowIdentifyCoords, padding is included} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 20 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 sash}
test panedwindow-26.3 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 22 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 sash}
test panedwindow-26.4 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 24 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 sash}
test panedwindow-26.5 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 26 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 sash}
test panedwindow-26.6 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 26 -1
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {}
test panedwindow-26.7 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 26 100
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {}
test panedwindow-26.8 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
- -handlesize 6
+ -handlesize 6
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 22 4
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 sash}
test panedwindow-26.9 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
- -handlesize 6
+ -handlesize 6
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 22 5
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 handle}
test panedwindow-26.10 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
- -handlesize 8
+ -handlesize 8
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 20 5
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 handle}
test panedwindow-26.11 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
- -handlesize 8
+ -handlesize 8
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 20 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 sash}
test panedwindow-26.12 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -bd 0 -sashwidth 2 -sashpad 2
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20] \
- [frame .f3 -bg green -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20] \
+ [frame .f3 -bg green -width 20 -height 20]
.p identify 48 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {1 sash}
test panedwindow-26.13 {identify subcommand errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4
.p identify
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {wrong # args: should be ".p identify x y"}
test panedwindow-26.14 {identify subcommand errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p identify foo bar
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {expected integer but got "foo"}
test panedwindow-26.15 {identify subcommand errors} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p
.p identify 0 bar
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {expected integer but got "bar"}
test panedwindow-26.16 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 0 0
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {}
test panedwindow-26.17 {PanedWindowIdentifyCoords, padding is included} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 0 20
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 sash}
test panedwindow-26.18 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 0 22
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 sash}
test panedwindow-26.19 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 0 24
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 sash}
test panedwindow-26.20 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 0 26
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 sash}
test panedwindow-26.21 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify -1 26
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {}
test panedwindow-26.22 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 100 26
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {}
test panedwindow-26.23 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
- -handlesize 6 -orient vertical
+ -handlesize 6 -orient vertical
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 4 22
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 sash}
test panedwindow-26.24 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
- -handlesize 6 -orient vertical
+ -handlesize 6 -orient vertical
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 5 22
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 handle}
test panedwindow-26.25 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
- -handlesize 8 -orient vertical
+ -handlesize 8 -orient vertical
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 5 20
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 handle}
test panedwindow-26.26 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
- -handlesize 8 -orient vertical
+ -handlesize 8 -orient vertical
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20]
.p identify 0 20
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0 sash}
test panedwindow-26.27 {PanedWindowIdentifyCoords} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -showhandle false -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
.p add [frame .f -bg red -width 20 -height 20] \
- [frame .f2 -bg blue -width 20 -height 20] \
- [frame .f3 -bg green -width 20 -height 20]
+ [frame .f2 -bg blue -width 20 -height 20] \
+ [frame .f3 -bg green -width 20 -height 20]
.p identify 0 48
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {1 sash}
test panedwindow-27.1 {destroy the window cleanly on error [Bug #616589]} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bogusopt bogus
} -cleanup {
- deleteWindows
+ deleteWindows
} -returnCodes error -result {unknown option "-bogusopt"}
test panedwindow-27.2 {destroy the window cleanly on rename [Bug #616589]} -setup {
- deleteWindows
+ deleteWindows
} -body {
destroy .p
panedwindow .p
rename .p {}
winfo exists .p
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0}
test panedwindow-28.1 {resizing width} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -bd 5
frame .f1 -width 100 -height 50 -bg blue
@@ -5488,7 +5488,7 @@ test panedwindow-28.1 {resizing width} -setup {
} -result {100 110}
test panedwindow-28.2 {resizing height} -setup {
- deleteWindows
+ deleteWindows
} -body {
panedwindow .p -orient vertical -bd 5
frame .f1 -width 50 -height 100 -bg blue
@@ -5514,13 +5514,13 @@ test panedwindow-28.2 {resizing height} -setup {
test panedwindow-29.1 {display on depths other than the default one} -constraints {
pseudocolor8 haveTruecolor24
} -setup {
- deleteWindows
+ deleteWindows
} -body {
- toplevel .t -visual {truecolor 24}
- pack [panedwindow .t.p]
- .t.p add [frame .t.p.f1] [frame .t.p.f2]
- update
- # If we got here, we didn't crash and that's good
+ toplevel .t -visual {truecolor 24}
+ pack [panedwindow .t.p]
+ .t.p add [frame .t.p.f1] [frame .t.p.f2]
+ update
+ # If we got here, we didn't crash and that's good
} -cleanup {
deleteWindows
} -result {}
@@ -5529,16 +5529,16 @@ test panedwindow-29.2 {display on depths other than the default one} -constraint
} -setup {
deleteWindows
} -body {
- toplevel .t -visual {pseudocolor 8}
- pack [frame .t.f -visual {truecolor 24}]
- pack [panedwindow .t.f.p]
- .t.f.p add [frame .t.f.p.f1 -width 5] [frame .t.f.p.f2 -width 5]
- update
- .t.f.p proxy place 1 1
- update
- .t.f.p proxy forget
- update
- # If we got here, we didn't crash and that's good
+ toplevel .t -visual {pseudocolor 8}
+ pack [frame .t.f -visual {truecolor 24}]
+ pack [panedwindow .t.f.p]
+ .t.f.p add [frame .t.f.p.f1 -width 5] [frame .t.f.p.f2 -width 5]
+ update
+ .t.f.p proxy place 1 1
+ update
+ .t.f.p proxy forget
+ update
+ # If we got here, we didn't crash and that's good
} -cleanup {
deleteWindows
} -result {}
diff --git a/tests/raise.test b/tests/raise.test
index f8674fc..f596b2f 100644
--- a/tests/raise.test
+++ b/tests/raise.test
@@ -20,6 +20,7 @@ proc raise_setup {} {
foreach i [winfo child .raise] {
destroy $i
}
+ update idletasks
foreach i {a b c d e} {
label .raise.$i -text $i -relief raised -bd 2
}
diff --git a/tests/spinbox.test b/tests/spinbox.test
index e4f1c5e..661f10b 100644
--- a/tests/spinbox.test
+++ b/tests/spinbox.test
@@ -2017,15 +2017,14 @@ test spinbox-5.7 {ConfigureSpinbox procedure} -setup {
} -body {
.e configure -font {Courier -12} -width 4 -xscrollcommand scroll
.e insert end "01234567890"
- update idletasks
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ update
+ set scrollInfo wrong
.e configure -width 5
- vwait scrollInfo
+ update
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
- after cancel $timeout
-} -result {0.000000 0.363636}
+} -result {0.000000 0.454545}
test spinbox-5.8 {ConfigureSpinbox procedure} -constraints {
fonts
@@ -2209,14 +2208,13 @@ test spinbox-7.1 {InsertChars procedure} -setup {
} -body {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
- update idletasks
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ update
+ set scrollInfo wrong
.e insert 2 XXX
- vwait scrollInfo
+ update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
- after cancel $timeout
} -result {abXXXcde abXXXcde {0.000000 1.000000}}
test spinbox-7.2 {InsertChars procedure} -setup {
@@ -2227,14 +2225,13 @@ test spinbox-7.2 {InsertChars procedure} -setup {
} -body {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
- update idletasks
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ update
+ set scrollInfo wrong
.e insert 500 XXX
- vwait scrollInfo
+ update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
- after cancel $timeout
} -result {abcdeXXX abcdeXXX {0.000000 1.000000}}
test spinbox-7.3 {InsertChars procedure} -setup {
spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
@@ -2362,14 +2359,13 @@ test spinbox-8.1 {DeleteChars procedure} -setup {
} -body {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
- update idletasks
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ update
+ set scrollInfo wrong
.e delete 2 4
- vwait scrollInfo
+ update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
- after cancel $timeout
} -result {abe abe {0.000000 1.000000}}
test spinbox-8.2 {DeleteChars procedure} -setup {
unset -nocomplain contents
@@ -2379,14 +2375,13 @@ test spinbox-8.2 {DeleteChars procedure} -setup {
} -body {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
- update idletasks
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ update
+ set scrollInfo wrong
.e delete -1 2
- vwait scrollInfo
+ update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
- after cancel $timeout
} -result {cde cde {0.000000 1.000000}}
test spinbox-8.3 {DeleteChars procedure} -setup {
unset -nocomplain contents
@@ -2396,14 +2391,13 @@ test spinbox-8.3 {DeleteChars procedure} -setup {
} -body {
.e configure -textvariable contents -xscrollcommand scroll
.e insert 0 abcde
- update idletasks
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ update
+ set scrollInfo wrong
.e delete 3 1000
- vwait scrollInfo
+ update
list [.e get] $contents [format {%.6f %.6f} {*}$scrollInfo]
} -cleanup {
destroy .e
- after cancel $timeout
} -result {abc abc {0.000000 1.000000}}
test spinbox-8.4 {DeleteChars procedure} -setup {
spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2
@@ -3183,41 +3177,38 @@ test spinbox-16.2 {SpinboxVisibleRange procedure} -body {
test spinbox-17.1 {SpinboxUpdateScrollbar procedure} -body {
spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12}
pack .e
- update idletasks
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ update
+ set scrollInfo wrong
.e delete 0 end
.e insert 0 123
- vwait scrollInfo
+ update
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
- after cancel $timeout
} -result {0.000000 1.000000}
test spinbox-17.2 {SpinboxUpdateScrollbar procedure} -body {
spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12}
pack .e
.e insert 0 0123456789abcdef
- update idletasks
- set timeout [after 500 {set $scrollInfo {-1000000 -1000000}}]
+ update
+ set scrollInfo wrong
.e xview 3
- vwait scrollInfo
+ update
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
- after cancel $timeout
} -result {0.187500 0.812500}
test spinbox-17.3 {SpinboxUpdateScrollbar procedure} -body {
spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12}
pack .e
- update idletasks
- set timeout [after 500 {set scrollInfo {-1000000 -1000000}}]
+ update
+ set scrollInfo wrong
.e insert 0 abcdefghijklmnopqrs
.e xview
- vwait scrollInfo
+ update
format {%.6f %.6f} {*}$scrollInfo
} -cleanup {
destroy .e
- after cancel $timeout
} -result {0.000000 0.526316}
test spinbox-17.4 {SpinboxUpdateScrollbar procedure} -setup {
proc bgerror msg {
@@ -3227,9 +3218,10 @@ test spinbox-17.4 {SpinboxUpdateScrollbar procedure} -setup {
} -body {
spinbox .e -width 5
pack .e
- update idletasks
+ update
+ set scrollInfo wrong
.e configure -xscrollcommand thisisnotacommand
- vwait x
+ update
list $x $errorInfo
} -cleanup {
destroy .e
diff --git a/tests/text.test b/tests/text.test
index 9ee0eff..2f5f1fc 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -2240,7 +2240,7 @@ Line 7"
# Create one visible and one invisible window
frame .t.w1
frame .t.w2
-# Creating this window here means that the elidden text
+# Creating this window here means that the elided text
# now starts at 2.3
.t window create 2.1 -window .t.w1
.t window create 3.1 -window .t.w2
@@ -2263,7 +2263,7 @@ Line 7"
# Create one visible and one invisible window
frame .t.w1
frame .t.w2
-# Creating this window here means that the elidden text
+# Creating this window here means that the elided text
# now starts at 2.3
.t window create 2.1 -window .t.w1
.t window create 3.1 -window .t.w2
@@ -2288,7 +2288,7 @@ Line 7"
frame .t.w1
frame .t.w2
.t mark set a 2.2
-# Creating this window here means that the elidden text
+# Creating this window here means that the elided text
# now starts at 2.3, but 'a' is automatically moved to 2.3
.t window create 2.1 -window .t.w1
.t window create 3.1 -window .t.w2
@@ -2312,7 +2312,7 @@ Line 7"
# Create one visible and one invisible window
frame .t.w1
frame .t.w2
-# Creating this window here means that the elidden text
+# Creating this window here means that the elided text
# now starts at 2.3
.t window create 2.1 -window .t.w1
.t window create 3.1 -window .t.w2
@@ -2336,7 +2336,7 @@ Line 7"
# Create one visible and one invisible window
frame .t.w1
frame .t.w2
-# Creating this window here means that the elidden text
+# Creating this window here means that the elided text
# now starts at 2.3
.t window create 2.1 -window .t.w1
.t window create 3.1 -window .t.w2
@@ -2360,7 +2360,7 @@ Line 7"
# Create one visible and one invisible window
frame .t.w1
frame .t.w2
-# Creating this window here means that the elidden text
+# Creating this window here means that the elided text
# now starts at 2.3
.t window create 2.1 -window .t.w1
.t window create 3.1 -window .t.w2
@@ -2385,7 +2385,7 @@ Line 7"
# Create one visible and one invisible window
frame .t.w1
frame .t.w2
-# Creating this window here means that the elidden text
+# Creating this window here means that the elided text
# now starts at 2.3, but 'a' is automatically moved to 2.3
.t window create 2.1 -window .t.w1
.t window create 3.1 -window .t.w2
@@ -2409,7 +2409,7 @@ Line 7"
# Create one visible and one invisible window
frame .t.w1
frame .t.w2
-# Creating this window here means that the elidden text
+# Creating this window here means that the elided text
# now starts at 2.3
.t window create 2.1 -window .t.w1
.t window create 3.1 -window .t.w2
@@ -2433,7 +2433,7 @@ Line 7"
# Create one visible and one invisible window
frame .t.w1
frame .t.w2
-# Creating this window here means that the elidden text
+# Creating this window here means that the elided text
# now starts at 2.3
.t window create 2.1 -window .t.w1
.t window create 3.1 -window .t.w2
@@ -2459,7 +2459,7 @@ Line 7"
# Create one visible and one invisible window
frame .t.w1
frame .t.w2
-# Creating this window here means that the elidden text
+# Creating this window here means that the elided text
# now starts at 2.3, but 'a' is automatically moved to 2.3
.t window create 2.1 -window .t.w1
.t window create 3.1 -window .t.w2
@@ -2483,7 +2483,7 @@ Line 7"
# Create one visible and one invisible window
frame .t.w1
frame .t.w2
-# Creating this window here means that the elidden text
+# Creating this window here means that the elided text
# now starts at 2.3
.t window create 2.1 -window .t.w1
.t window create 3.1 -window .t.w2
@@ -2508,7 +2508,7 @@ Line 7"
# Create one visible and one invisible window
frame .t.w1
frame .t.w2
-# Creating this window here means that the elidden text
+# Creating this window here means that the elided text
# now starts at 2.3
.t window create 2.1 -window .t.w1
.t window create 3.1 -window .t.w2
@@ -2534,7 +2534,7 @@ Line 7"
# Create one visible and one invisible window
frame .t.w1
frame .t.w2
-# Creating this window here means that the elidden text
+# Creating this window here means that the elided text
# now starts at 2.3, but 'a' is automatically moved to 2.3
.t window create 2.1 -window .t.w1
.t window create 3.1 -window .t.w2
@@ -2558,7 +2558,7 @@ Line 7"
# Create one visible and one invisible window
frame .t.w1
frame .t.w2
-# Creating this window here means that the elidden text
+# Creating this window here means that the elided text
# now starts at 2.3
.t window create 2.1 -window .t.w1
.t window create 3.1 -window .t.w2
@@ -3475,7 +3475,7 @@ test text-14.18 {ConfigureText procedure} -constraints fonts -setup {
# The "overrideredirect" gets rid of the titlebar so the toplevel can shrink
# to the appropriate size.
# On macOS, however, there is no way to make the window overlap the menubar.
-if {[tk windowingsystem] == "aqua"} {
+if {[tk windowingsystem] eq "aqua"} {
set minY [expr [menubarheight] + 1]
} else {
set minY 0
diff --git a/tests/textDisp.test b/tests/textDisp.test
index 3c1face..b98150d 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -11,29 +11,12 @@ eval tcltest::configure $argv
tcltest::loadTestedCommands
namespace import -force tcltest::test
-testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}]
-testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
-
-# Platform specific procedure for updating the text widget.
-
-if {[tk windowingsystem] == "aqua"} {
- proc updateText {} {
- update idletasks
- }
- proc delay {} {
- update idletasks
- after 100
- update idletasks
- }
-} else {
- proc updateText {} {
- update
- }
- proc delay {} {
- update
- after 100
- update
- }
+# The delay procedure needs to wait long enough for the asynchronous updates
+# performed by the text widget to run.
+proc delay {} {
+ update
+ after 100
+ update
}
# The procedure below is used as the scrolling command for the text;
@@ -50,12 +33,27 @@ proc scrollError args {
error "scrolling error"
}
+# Return 1 if the two given lists are the same, otherwise return the two lists.
+# This is used to compare a test actual result with a test expected result.
+
+proc lequal {res expected} {
+ if {[llength $res] != [llength $expected]} {
+ return [list "Lengths differ" result: $res - expected: $expected]
+ }
+ for {set i 0} {$i < [llength $res]} {incr i} {
+ if {[lindex $res $i] ne [lindex $expected $i]} {
+ return [list result: $res - expected: $expected]
+ }
+ }
+ return 1
+}
+
# Create entries in the option database to be sure that geometry options
-# like border width have predictable values.
-set twbw 2
-set twht 2
-option add *Text.borderWidth $twbw
-option add *Text.highlightThickness $twht
+# like border width have selected values.
+option add *Text.borderWidth 2 ; # tests work with [1-3]
+option add *Text.highlightThickness 2 ; # tests work with [0-5]
+option add *Text.padX 1 ; # same padding in x and y, see proc bo; tests work with [0-4]
+option add *Text.padY 1 ; # same padding in x and y, see proc bo; tests work with [0-4]
# The frame .f is needed to make sure that the overall window is always
# fairly wide, even if the text window is very narrow. This is needed
@@ -67,34 +65,74 @@ frame .f -width 100 -height 20
pack .f -side left
set fixedFont {Courier -12}
-# 15 on XP, 13 on Solaris 8
set fixedHeight [font metrics $fixedFont -linespace]
-# 7 on all platforms
set fixedWidth [font measure $fixedFont m]
-# 12 on XP
set fixedAscent [font metrics $fixedFont -ascent]
-set fixedDiff [expr {$fixedHeight - 13}] ;# 2 on XP
-
-set varFont {Times -14}
-# 16 on XP, 15 on Solaris 8
-set varHeight [font metrics $varFont -linespace]
-# 13 on XP
-set varAscent [font metrics $varFont -ascent]
-set varDiff [expr {$varHeight - 15}] ;# 1 on XP
-set bigFont {Helvetica -24}
-# 27 on XP, 27 on Solaris 8
+set bigFont {Helvetica -24} ; # note: not a fixed-width font!
set bigHeight [font metrics $bigFont -linespace]
-# 21 on XP
set bigAscent [font metrics $bigFont -ascent]
+
set ascentDiff [expr {$bigAscent - $fixedAscent}]
+set heightDiff [expr {$bigHeight - $fixedHeight}]
+
+# On Windows at least, the tests do work with {Courier -10}, {Courier -12} or {Courier -14} as fixedFont.
+# Warn the user if the actual font size is too different from what was requested.
+if {[font metrics [font actual $fixedFont] -fixed] != 1} {
+ puts "---> Warning: the font actually used by the tests, which is \"[font actual $fixedFont]\",\
+does not seem to be a fixed-width font as expected. If this is really the case, many upcoming\
+tests will fail."
+}
+if {$fixedHeight < 12 || $fixedHeight > 17} {
+ puts "---> Warning: the font actually used by the tests, which is \"[font actual $fixedFont]\",\
+is $fixedHeight pixels height while the tests expect between 12 and 17 (inclusive) pixels.\
+Some of the upcoming tests will probably fail."
+}
+if {$fixedWidth < 6 || $fixedWidth > 8} {
+ puts "---> Warning: the font actually used by the tests, which is \"[font actual $fixedFont]\",\
+is $fixedWidth pixels in width while the tests expect between 6 and 8 (inclusive) pixels.\
+Some of the upcoming tests will probably fail."
+}
+# Option -width 20 (characters) below is a fundamental assumption of many
+# upcoming tests when wrapping enters in play
+# Also -height 10 (lines) is an important assumption
text .t -font $fixedFont -width 20 -height 10 -yscrollcommand scroll
pack .t -expand 1 -fill both
.t tag configure big -font $bigFont
.t debug on
wm geometry . {}
+# full border size of the text widget, i.e. first x or y coordinate inside the text widget
+# warning: -padx is supposed to be the same as -pady (same border size horizontally and
+# vertically around the widget)
+proc bo {{w .t}} {
+ return [expr {[$w cget -borderwidth] + [$w cget -highlightthickness] + [$w cget -padx]}]
+}
+
+# x-width of $n chars, fixed width font
+proc xw {n} {
+ global fixedWidth
+ return [expr {$n * $fixedWidth}]
+}
+# x-coordinate of the first pixel of $n-th char (count starts at zero), left justified
+proc xchar {n {w .t}} {
+ return [expr {[bo $w] + [xw $n]}]
+}
+# x-coordinate in widget $w of the first pixel of $n-th char counted from the right, right justified
+proc xcharr {n {w .t}} {
+ return [expr {[winfo width $w] - [bo $w] - [xw $n]}]
+}
+# y-coordinate of the first pixel of $l-th display line (count starts at 1)
+proc yline {l {w .t}} {
+ global fixedHeight
+ return [expr {[bo $w] + ($l - 1) * $fixedHeight}]
+}
+# x-pixels of empty space in widget $w on a line containing $n chars
+proc xe {n {w .t}} {
+ return [expr {[winfo width $w] - (2 * [bo $w]) - [xw $n]}]
+}
+
# The statements below reset the main window; it's needed if the window
# manager is mwm to make mwm forget about a previous minimum size setting.
@@ -102,7 +140,7 @@ wm withdraw .
wm minsize . 1 1
wm positionfrom . user
wm deiconify .
-updateText
+update
# Some window managers (like olwm under SunOS 4.1.3) misbehave in a way
# that tends to march windows off the top and left of the screen. If
@@ -183,7 +221,7 @@ test textDisp-0.3 {double tag elide transition} {
.txt tag configure SYSTEM -elide 0
.txt tag configure TRAFFIC -elide 1
.txt insert end "\n" {TRAFFIC SYSTEM}
- updateText
+ update
destroy .txt
} {}
@@ -196,7 +234,7 @@ test textDisp-0.4 {double tag elide transition} {
.txt tag configure TRAFFIC -elide 1
.txt insert end "\n" {SYSTEM TRAFFIC}
# Crash was here.
- updateText
+ update
destroy .txt
} {}
@@ -210,7 +248,7 @@ test textDisp-0.5 {double tag elide transition} {
.txt insert end "\n" {SYSTEM TRAFFIC}
.txt insert end "\n" WELCOME
# Crash was here.
- updateText
+ update
destroy .txt
} {}
@@ -232,22 +270,24 @@ test textDisp-1.1 {GetStyle procedure, priorities and tab stops} {
.t tag raise x
update idletasks
lappend x [lindex [.t bbox 1.2] 0]
-} [list 75 55 55]
+} [list [expr {[bo]+70}] [expr {[bo]+50}] [expr {[bo]+50}]]
.t tag delete x y z
-test textDisp-1.2 {GetStyle procedure, wrapmode} {textfonts} {
+test textDisp-1.2 {GetStyle procedure, wrapmode} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "abcd\nefg hijkl mnop qrstuv wxyz"
.t tag configure x -wrap word
.t tag configure y -wrap none
.t tag raise y
- updateText
+ update
set result [list [.t bbox 2.20]]
.t tag add x 2.0 2.1
lappend result [.t bbox 2.20]
.t tag add y 1.end 2.2
lappend result [.t bbox 2.20]
-} [list [list 5 [expr {5+2*$fixedHeight}] 7 $fixedHeight] [list 40 [expr {5+2*$fixedHeight}] 7 $fixedHeight] {}]
+} [list [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \
+ [list [xchar 5] [yline 3] $fixedWidth $fixedHeight] \
+ {}]
.t tag delete x y
test textDisp-2.1 {LayoutDLine, basics} {
@@ -255,67 +295,82 @@ test textDisp-2.1 {LayoutDLine, basics} {
.t delete 1.0 end
.t insert 1.0 "This is some sample text for testing."
list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list [expr {5 + $fixedWidth * 19}] 5 $fixedWidth $fixedHeight] [list 5 [expr {5 + $fixedHeight}] $fixedWidth $fixedHeight]]
-test textDisp-2.2 {LayoutDLine, basics} {textfonts} {
+} [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-2.2 {LayoutDLine, basics} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "This isx some sample text for testing."
list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 138 5 7 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-2.3 {LayoutDLine, basics} {textfonts} {
+} [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-2.3 {LayoutDLine, basics} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "This isxxx some sample text for testing."
list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 138 5 7 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-2.4 {LayoutDLine, word wrap} {textfonts} {
+} [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-2.4 {LayoutDLine, word wrap} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "This is some sample text for testing."
list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 138 5 7 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-2.5 {LayoutDLine, word wrap} {textfonts} {
+} [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-2.5 {LayoutDLine, word wrap} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "This isx some sample text for testing."
list [.t bbox 1.13] [.t bbox 1.19] [.t bbox 1.20] [.t bbox 1.21]
-} [list [list 96 5 $fixedWidth $fixedHeight] [list 138 5 $fixedWidth $fixedHeight] [list 145 5 0 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] $fixedWidth $fixedHeight]]
-test textDisp-2.6 {LayoutDLine, word wrap} failsOnUbuntu {
+} [list [list [xchar 13] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 20] [yline 1] 0 $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-2.6 {LayoutDLine, word wrap} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "This isxxx some sample text for testing."
list [.t bbox 1.15] [.t bbox 1.16]
-} [list [list 110 5 35 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-2.7 {LayoutDLine, marks and tags} {textfonts} {
+} [list [list [xchar 15] [yline 1] [xe 15] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-2.7 {LayoutDLine, marks and tags} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "This isxxx some sample text for testing."
.t tag add foo 1.4 1.6
.t mark set insert 1.8
list [.t bbox 1.2] [.t bbox 1.5] [.t bbox 1.11]
-} [list [list 19 5 7 $fixedHeight] [list 40 5 7 $fixedHeight] [list 82 5 7 $fixedHeight]]
+} [list [list [xchar 2] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 5] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 11] [yline 1] $fixedWidth $fixedHeight]]
foreach m [.t mark names] {
catch {.t mark unset $m}
}
-scan [wm geom .] %dx%d width height
-test textDisp-2.8 {LayoutDLine, extra chunk at end of dline} {textfonts} {
+test textDisp-2.8 {LayoutDLine, extra chunk at end of dline} -setup {
+ scan [wm geom .] %dx%d width height
+} -body {
wm geom . [expr {$width+1}]x$height
- updateText
+ update
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "This isxx some sample text for testing."
.t mark set foo 1.20
list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 138 5 8 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-wm geom . {}
-updateText
-test textDisp-2.9 {LayoutDLine, marks and tags} {textfonts} {
+} -cleanup {
+ wm geom . {}
+ update
+} -result [list [list [xchar 19] [yline 1] [expr {$fixedWidth+1}] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-2.9 {LayoutDLine, marks and tags} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "This is a very_very_long_word_that_wraps."
list [.t bbox 1.9] [.t bbox 1.10] [.t bbox 1.25]
-} [list [list 68 5 77 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 110 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-2.10 {LayoutDLine, marks and tags} {textfonts} {
+} [list [list [xchar 9] [yline 1] [xe 9] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
+ [list [xchar 15] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-2.10 {LayoutDLine, marks and tags} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "This is a very_very_long_word_that_wraps."
@@ -324,14 +379,17 @@ test textDisp-2.10 {LayoutDLine, marks and tags} {textfonts} {
.t tag add foo 1.17
.t tag add foo 1.19
list [.t bbox 1.9] [.t bbox 1.10] [.t bbox 1.25]
-} [list [list 68 5 77 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 110 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-2.11 {LayoutDLine, newline width} {textfonts} {
+} [list [list [xchar 9] [yline 1] [xe 9] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
+ [list [xchar 15] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-2.11 {LayoutDLine, newline width} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "a\nbb\nccc\ndddd"
list [.t bbox 2.2] [.t bbox 3.3]
-} [list [list 19 [expr {$fixedDiff + 18}] 126 $fixedHeight] [list 26 [expr {2*$fixedDiff + 31}] 119 $fixedHeight]]
-test textDisp-2.12 {LayoutDLine, justification} {textfonts} {
+} [list [list [xchar 2] [yline 2] [xe 2] $fixedHeight] \
+ [list [xchar 3] [yline 3] [xe 3] $fixedHeight]]
+test textDisp-2.12 {LayoutDLine, justification} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "\na\nbb\nccc\ndddd"
@@ -339,8 +397,11 @@ test textDisp-2.12 {LayoutDLine, justification} {textfonts} {
.t tag add x 1.0 end
.t tag add y 3.0 3.2
list [.t bbox 1.0] [.t bbox 2.0] [.t bbox 4.0] [.t bbox 4.2]
-} [list [list 75 5 70 $fixedHeight] [list 71 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 64 [expr {3*$fixedDiff + 44}] 7 $fixedHeight] [list 78 [expr {3*$fixedDiff + 44}] 7 $fixedHeight]]
-test textDisp-2.13 {LayoutDLine, justification} {textfonts} {
+} [list [list [expr {[bo]+[xe 0]/2}] [yline 1] [expr {[xe 0]-[xe 0]/2}] $fixedHeight] \
+ [list [expr {[bo]+[xe 1]/2}] [yline 2] $fixedWidth $fixedHeight] \
+ [list [expr {[bo]+[xe 3]/2}] [yline 4] $fixedWidth $fixedHeight] \
+ [list [expr {[bo]+[xe 3]/2+[xw 2]}] [yline 4] $fixedWidth $fixedHeight]]
+test textDisp-2.13 {LayoutDLine, justification} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "\na\nbb\nccc\ndddd"
@@ -348,8 +409,11 @@ test textDisp-2.13 {LayoutDLine, justification} {textfonts} {
.t tag add x 1.0 end
.t tag add y 3.0 3.2
list [.t bbox 1.0] [.t bbox 2.0] [.t bbox 4.0] [.t bbox 4.2]
-} [list [list 145 5 0 $fixedHeight] [list 138 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 124 [expr {3*$fixedDiff + 44}] 7 $fixedHeight] [list 138 [expr {3*$fixedDiff + 44}] 7 $fixedHeight]]
-test textDisp-2.14 {LayoutDLine, justification} {textfonts} {
+} [list [list [xcharr 0] [yline 1] 0 $fixedHeight] \
+ [list [xcharr 1] [yline 2] $fixedWidth $fixedHeight] \
+ [list [xcharr 3] [yline 4] $fixedWidth $fixedHeight] \
+ [list [xcharr 1] [yline 4] $fixedWidth $fixedHeight]]
+test textDisp-2.14 {LayoutDLine, justification} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "\na\nbb\nccc\ndddd"
@@ -359,8 +423,11 @@ test textDisp-2.14 {LayoutDLine, justification} {textfonts} {
.t tag add y 3.0 4.0
.t tag raise y
list [.t bbox 2.0] [.t bbox 3.0] [.t bbox 3.end] [.t bbox 4.0]
-} [list [list 71 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 131 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 145 [expr {2*$fixedDiff + 31}] 0 $fixedHeight] [list 5 [expr {3*$fixedDiff + 44}] 7 $fixedHeight]]
-test textDisp-2.15 {LayoutDLine, justification} {textfonts} {
+} [list [list [expr {[bo]+[xe 1]/2}] [yline 2] $fixedWidth $fixedHeight] \
+ [list [xcharr 2] [yline 3] $fixedWidth $fixedHeight] \
+ [list [xcharr 0] [yline 3] 0 $fixedHeight] \
+ [list [xchar 0] [yline 4] $fixedWidth $fixedHeight]]
+test textDisp-2.15 {LayoutDLine, justification} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "\na\nbb\nccc\ndddd"
@@ -370,8 +437,11 @@ test textDisp-2.15 {LayoutDLine, justification} {textfonts} {
.t tag add y 3.0 4.0
.t tag lower y
list [.t bbox 2.0] [.t bbox 3.0] [.t bbox 3.end] [.t bbox 4.0]
-} [list [list 71 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 68 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 82 [expr {2*$fixedDiff + 31}] 63 $fixedHeight] [list 5 [expr {3*$fixedDiff + 44}] 7 $fixedHeight]]
-test textDisp-2.16 {LayoutDLine, justification} {textfonts} {
+} [list [list [expr {[bo]+[xe 1]/2}] [yline 2] $fixedWidth $fixedHeight] \
+ [list [expr {[bo]+[xe 2]/2}] [yline 3] $fixedWidth $fixedHeight] \
+ [list [expr {[bo]+[xe 2]/2+[xw 2]}] [yline 3] [expr {[xe 2]/2}] $fixedHeight] \
+ [list [xchar 0] [yline 4] $fixedWidth $fixedHeight]]
+test textDisp-2.16 {LayoutDLine, justification} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "Lots of long words, enough to force word wrap\nThen\nmore lines"
@@ -379,16 +449,22 @@ test textDisp-2.16 {LayoutDLine, justification} {textfonts} {
.t tag add x 1.1 1.20
.t tag add x 1.21 1.end
list [.t bbox 1.0] [.t bbox 1.20] [.t bbox 1.41] [.t bbox 2.0]
-} [list [list 5 5 7 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 61 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 5 [expr {3*$fixedDiff + 44}] 7 $fixedHeight]]
-test textDisp-2.17 {LayoutDLine, justification} {textfonts} {
+} [list [list [xchar 0] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
+ [list [expr {[bo]+[xe 4]/2}] [yline 3] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 4] $fixedWidth $fixedHeight]]
+test textDisp-2.17 {LayoutDLine, justification} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "Lots of very long words, enough to force word wrap\nThen\nmore lines"
.t tag configure x -justify center
.t tag add x 1.18
list [.t bbox 1.0] [.t bbox 1.18] [.t bbox 1.35] [.t bbox 2.0]
-} [list [list 5 5 7 $fixedHeight] [list 15 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 5 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 5 [expr {3*$fixedDiff + 44}] 7 $fixedHeight]]
-test textDisp-2.18 {LayoutDLine, justification} {textfonts} {
+} [list [list [xchar 0] [yline 1] $fixedWidth $fixedHeight] \
+ [list [expr {[bo]+[xe 17]/2}] [yline 2] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 4] $fixedWidth $fixedHeight]]
+test textDisp-2.18 {LayoutDLine, justification} {
.t configure -wrap none
.t delete 1.0 end
.t insert 1.0 "Lots of long words, enough to extend out of the window\n"
@@ -399,18 +475,27 @@ test textDisp-2.18 {LayoutDLine, justification} {textfonts} {
.t tag add y 3.0
.t xview scroll 5 units
list [.t bbox 2.0] [.t bbox 3.0]
-} [list [list 26 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 40 [expr {2*$fixedDiff + 31}] 7 $fixedHeight]]
+} [list [list [expr {[bo]+[xe 4]/2-[xw 5]}] [yline 2] $fixedWidth $fixedHeight] \
+ [list [expr {[xcharr 10]-[xw 5]}] [yline 3] $fixedWidth $fixedHeight]]
.t tag delete x
.t tag delete y
-test textDisp-2.19 {LayoutDLine, margins} {textfonts} {
+test textDisp-2.19 {LayoutDLine, margins} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "Lots of long words, enough to force word wrap\nThen\nmore lines"
- .t tag configure x -lmargin1 20 -lmargin2 40 -rmargin 15
+ # margins in pixels depend on the font width for more flexibility
+ set lm1 [expr {3*$fixedWidth}]
+ set lm2 [expr {2*$lm1}]
+ set rm [expr {2*$fixedWidth}]
+ .t tag configure x -lmargin1 $lm1 -lmargin2 $lm2 -rmargin $rm
.t tag add x 1.0 end
- list [.t bbox 1.0] [.t bbox 1.12] [.t bbox 1.13] [.t bbox 2.0]
-} [list [list 25 5 7 $fixedHeight] [list 109 5 36 $fixedHeight] [list 45 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 25 [expr {5*$fixedDiff + 70}] 7 $fixedHeight]]
-test textDisp-2.20 {LayoutDLine, margins} {textfonts} {
+ set expected [list [list [expr {[bo]+$lm1}] [yline 1] $fixedWidth $fixedHeight] \
+ [list [expr {[bo]+$lm1+[xw 12]}] [yline 1] [expr {[xe 12]-$lm1}] $fixedHeight] \
+ [list [expr {[bo]+$lm2}] [yline 2] $fixedWidth $fixedHeight] \
+ [list [expr {[bo]+$lm1}] [yline 6] $fixedWidth $fixedHeight]]
+ lequal [list [.t bbox 1.0] [.t bbox 1.12] [.t bbox 1.13] [.t bbox 2.0]] $expected
+} {1}
+test textDisp-2.20 {LayoutDLine, margins} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "Lots of long words, enough to force word wrap\nThen\nmore lines"
@@ -420,18 +505,23 @@ test textDisp-2.20 {LayoutDLine, margins} {textfonts} {
.t tag add x 1.0 end
.t tag add y 1.13
list [.t bbox 1.0] [.t bbox 1.13] [.t bbox 1.30] [.t bbox 2.0]
-} [list [list 25 5 7 $fixedHeight] [list 10 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 15 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 25 [expr {3*$fixedDiff + 44}] 7 $fixedHeight]]
-test textDisp-2.21 {LayoutDLine, margins} {textfonts} {
+} [list [list [expr {[bo]+20}] [yline 1] $fixedWidth $fixedHeight] \
+ [list [expr {[bo]+5}] [yline 2] $fixedWidth $fixedHeight] \
+ [list [expr {[bo]+10}] [yline 3] $fixedWidth $fixedHeight] \
+ [list [expr {[bo]+20}] [yline 4] $fixedWidth $fixedHeight]]
+test textDisp-2.21 {LayoutDLine, margins} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "Sample text"
.t tag configure x -lmargin1 80 -lmargin2 80 -rmargin 100
.t tag add x 1.0 end
list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 1.2]
-} [list [list 85 5 60 $fixedHeight] [list 85 [expr {$fixedDiff + 18}] 60 $fixedHeight] [list 85 [expr {2*$fixedDiff + 31}] 60 $fixedHeight]]
+} [list [list [expr {[bo]+80}] [yline 1] [expr {[xe 0]-80}] $fixedHeight] \
+ [list [expr {[bo]+80}] [yline 2] [expr {[xe 0]-80}] $fixedHeight] \
+ [list [expr {[bo]+80}] [yline 3] [expr {[xe 0]-80}] $fixedHeight]]
.t tag delete x
.t tag delete y
-test textDisp-2.22 {LayoutDLine, spacing options} {textfonts} {
+test textDisp-2.22 {LayoutDLine, spacing options} {
.t configure -wrap word
.t delete 1.0 end
.t tag delete x y
@@ -458,7 +548,7 @@ test textDisp-2.22 {LayoutDLine, spacing options} {textfonts} {
list $b1 $b2 $b3 $b4
} [list 2 7 10 15]
.t configure -spacing1 0 -spacing2 0 -spacing3 0
-test textDisp-2.23 {LayoutDLine, spacing options} {textfonts} {
+test textDisp-2.23 {LayoutDLine, spacing options} {
.t configure -wrap word
.t delete 1.0 end
.t tag delete x y
@@ -490,7 +580,7 @@ test textDisp-2.23 {LayoutDLine, spacing options} {textfonts} {
list $b1 $b2 $b3 $b4
} [list 1 5 13 16]
.t configure -spacing1 0 -spacing2 0 -spacing3 0
-test textDisp-2.24 {LayoutDLine, tabs, saving from first chunk} {textfonts} {
+test textDisp-2.24 {LayoutDLine, tabs, saving from first chunk} {
.t delete 1.0 end
.t tag delete x y
.t tag configure x -tabs 70
@@ -499,19 +589,26 @@ test textDisp-2.24 {LayoutDLine, tabs, saving from first chunk} {textfonts} {
.t tag add x 1.0 end
.t tag add y 1.1 end
lindex [.t bbox 1.3] 0
-} {75}
-test textDisp-2.25 {LayoutDLine, tabs, breaking chunks at tabs} {textfonts} {
+} [expr {[bo]+70}]
+test textDisp-2.25 {LayoutDLine, tabs, breaking chunks at tabs} {
.t delete 1.0 end
.t tag delete x
- .t tag configure x -tabs [list 30 60 90 120]
+ # compute a tab width allowing to let 4 tab stops (followed by a single char) on a single line
+ set tw [expr {([winfo width .t]-2*[bo]-$fixedWidth)/4}]
+ .t tag configure x -tabs [list $tw [expr {$tw*2}] [expr {$tw*3}] [expr {$tw*4}]]
.t insert 1.0 "a\tb\tc\td\te"
.t mark set dummy1 1.1
.t mark set dummy2 1.2
.t tag add x 1.0 end
- list [lindex [.t bbox 1.2] 0] [lindex [.t bbox 1.4] 0] \
- [lindex [.t bbox 1.6] 0] [lindex [.t bbox 1.8] 0]
-} [list 35 65 95 125]
-test textDisp-2.26 {LayoutDLine, tabs, breaking chunks at tabs} {textfonts} {
+ set expected [list [expr {[bo]+$tw}] [expr {[bo]+2*$tw}] [expr {[bo]+3*$tw}] [expr {[bo]+4*$tw}]]
+ set res [list [lindex [.t bbox 1.2] 0] [lindex [.t bbox 1.4] 0] \
+ [lindex [.t bbox 1.6] 0] [lindex [.t bbox 1.8] 0]]
+ lequal $res $expected
+} {1}
+# Next test is currently constrained to not run on mac (aqua) because on
+# aqua it fails due to wrong implementation of tabs with right justification
+# (the text is not rendered at all). This is a bug.
+test textDisp-2.26 {LayoutDLine, tabs, breaking chunks at tabs} {notAqua} {
.t delete 1.0 end
.t tag delete x
.t tag configure x -tabs [list 30 60 90 120] -justify right
@@ -520,33 +617,33 @@ test textDisp-2.26 {LayoutDLine, tabs, breaking chunks at tabs} {textfonts} {
.t mark set dummy2 1.2
.t tag add x 1.0 end
list [lindex [.t bbox 1.2] 0] [lindex [.t bbox 1.4] 0] \
- [lindex [.t bbox 1.6] 0] [lindex [.t bbox 1.8] 0]
-} [list 117 124 131 138]
-test textDisp-2.27 {LayoutDLine, tabs, calling AdjustForTab} {textfonts} {
+ [lindex [.t bbox 1.6] 0] [lindex [.t bbox 1.8] 0]
+} [list [xcharr 4] [xcharr 3] [xcharr 2] [xcharr 1]]
+test textDisp-2.27 {LayoutDLine, tabs, calling AdjustForTab} {
.t delete 1.0 end
.t tag delete x
.t tag configure x -tabs [list 30 60]
.t insert 1.0 "a\tb\tcd"
.t tag add x 1.0 end
list [lindex [.t bbox 1.2] 0] [lindex [.t bbox 1.4] 0]
-} [list 35 65]
-test textDisp-2.28 {LayoutDLine, tabs, running out of space in dline} {textfonts} {
+} [list [expr {[bo]+30}] [expr {[bo]+60}]]
+test textDisp-2.28 {LayoutDLine, tabs, running out of space in dline} {
.t delete 1.0 end
.t insert 1.0 "a\tb\tc\td"
.t bbox 1.6
-} [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight]
-test textDisp-2.29 {LayoutDLine, tabs, running out of space in dline} {textfonts} {
+} [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]
+test textDisp-2.29 {LayoutDLine, tabs, running out of space in dline} {
.t delete 1.0 end
.t insert 1.0 "a\tx\tabcd"
.t bbox 1.4
-} [list 117 5 7 $fixedHeight]
-test textDisp-2.30 {LayoutDLine, tabs, running out of space in dline} {textfonts} {
+} [list [xchar [expr {2*8}]] [yline 1] $fixedWidth $fixedHeight]
+test textDisp-2.30 {LayoutDLine, tabs, running out of space in dline} {
.t delete 1.0 end
.t insert 1.0 "a\tx\tabc"
.t bbox 1.4
-} [list 117 5 7 $fixedHeight]
+} [list [xchar [expr {2*8}]] [yline 1] $fixedWidth $fixedHeight]
-test textDisp-3.1 {different character sizes} {textfonts} {
+test textDisp-3.1 {different character sizes} {
.t configure -wrap word
.t delete 1.0 end
.t insert end "Some sample text, including both large\n"
@@ -555,61 +652,82 @@ test textDisp-3.1 {different character sizes} {textfonts} {
.t tag add big 1.5 1.10
.t tag add big 2.11 2.14
list [.t bbox 1.1] [.t bbox 1.6] [.t dlineinfo 1.0] [.t dlineinfo 3.0]
-} [list [list 12 [expr {5+$ascentDiff}] 7 $fixedHeight] [list 52 5 13 27] [list 5 5 114 27 [font metrics $bigFont -ascent]] [list 5 [expr {2* $fixedDiff + 85}] 35 $fixedHeight [expr {$fixedDiff + 10}]]]
+} [list [list [xchar 1] [expr {[yline 1]+$ascentDiff}] $fixedWidth $fixedHeight] \
+ [list [expr {[xchar 5]+[font measure $bigFont s]}] [yline 1] [font measure $bigFont a] $bigHeight] \
+ [list [bo] [yline 1] [expr {[xw 5]+[font measure $bigFont sampl]+[xw 2]}] $bigHeight $bigAscent] \
+ [list [bo] [expr {[bo]+2*$bigHeight+2*$fixedHeight}] [xw 5] $fixedHeight $fixedAscent]]
.t configure -wrap char
-test textDisp-4.1 {UpdateDisplayInfo, basic} {textfonts} {
+
+test textDisp-4.1 {UpdateDisplayInfo, basic} {
.t delete 1.0 end
.t insert end "Line 1\nLine 2\nLine 3\n"
- updateText
+ update
.t delete 2.0 2.end
- updateText
+ update
set res $tk_textRelayout
.t insert 2.0 "New Line 2"
- updateText
+ update
lappend res [.t bbox 1.0] [.t bbox 2.0] [.t bbox 3.0] $tk_textRelayout
-} [list 2.0 [list 5 5 7 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 5 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] 2.0]
-test textDisp-4.2 {UpdateDisplayInfo, re-use tail of text line} {textfonts} {
+} [list 2.0 \
+ [list [xchar 0] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \
+ 2.0]
+test textDisp-4.2 {UpdateDisplayInfo, re-use tail of text line} {
.t delete 1.0 end
.t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3"
- updateText
+ update
.t mark set x 2.21
.t delete 2.2
- updateText
+ update
set res $tk_textRelayout
.t insert 2.0 X
- updateText
+ update
lappend res [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk_textRelayout
-} [list 2.0 2.20 [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 12 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 5 [expr {3*$fixedDiff + 44}] 7 $fixedHeight] {2.0 2.20}]
-test textDisp-4.3 {UpdateDisplayInfo, tail of text line shifts} {textfonts} {
+} [list 2.0 2.20 \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
+ [list [xchar 1] [yline 3] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 4] $fixedWidth $fixedHeight] \
+ {2.0 2.20}]
+test textDisp-4.3 {UpdateDisplayInfo, tail of text line shifts} {
.t delete 1.0 end
.t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3"
- updateText
+ update
.t mark set x 2.21
.t delete 2.2
- updateText
+ update
list [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk_textRelayout
-} [list [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 5 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 5 [expr {3*$fixedDiff + 44}] 7 $fixedHeight] {2.0 2.20}]
+} [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 4] $fixedWidth $fixedHeight] \
+ {2.0 2.20}]
.t mark unset x
-test textDisp-4.4 {UpdateDisplayInfo, wrap-mode "none"} {textfonts} {
+test textDisp-4.4 {UpdateDisplayInfo, wrap-mode "none"} {
.t configure -wrap none
.t delete 1.0 end
.t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3"
- updateText
+ update
list [.t bbox 2.0] [.t bbox 2.25] [.t bbox 3.0] $tk_textRelayout
-} [list [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] {} [list 5 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] {1.0 2.0 3.0}]
-test textDisp-4.5 {UpdateDisplayInfo, tiny window} {textfonts} {
- if {[tk windowingsystem] == "win32"} {
+} [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
+ {} \
+ [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \
+ {1.0 2.0 3.0}]
+test textDisp-4.5 {UpdateDisplayInfo, tiny window} {
+ if {[tk windowingsystem] eq "win32"} {
wm overrideredirect . 1
}
wm geom . 103x$height
- updateText
+ update
.t configure -wrap none
.t delete 1.0 end
.t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3"
- updateText
+ update
list [.t bbox 2.0] [.t bbox 2.1] [.t bbox 3.0] $tk_textRelayout
-} [list [list 5 [expr {$fixedDiff + 18}] 1 $fixedHeight] {} [list 5 [expr {2*$fixedDiff + 31}] 1 $fixedHeight] {1.0 2.0 3.0}]
-if {[tk windowingsystem] == "win32"} {
+} [list [list [xchar 0] [yline 2] 1 $fixedHeight] \
+ {} \
+ [list [xchar 0] [yline 3] 1 $fixedHeight] \
+ {1.0 2.0 3.0}]
+if {[tk windowingsystem] eq "win32"} {
wm overrideredirect . 0
}
test textDisp-4.6 {UpdateDisplayInfo, tiny window} {
@@ -620,30 +738,27 @@ test textDisp-4.6 {UpdateDisplayInfo, tiny window} {
# the overrideredirect on "." confuses the window manager and
# causes subsequent tests to fail.
- if {[tk windowingsystem] == "win32"} {
+ if {[tk windowingsystem] eq "win32"} {
wm overrideredirect . 1
}
frame .f2 -width 20 -height 100
pack .f2 -before .f
wm geom . 103x103
- updateText
+ update
.t configure -wrap none -borderwidth 2
.t delete 1.0 end
.t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3"
- updateText
+ update
set x [list [.t bbox 1.0] [.t bbox 2.0] $tk_textRelayout]
wm overrideredirect . 0
- updateText
- set x
-} [list [list 5 5 1 1] {} 1.0]
+ update
+ set expected [list [list [xchar 0] [yline 1] 1 1] {} 1.0]
+ lequal $x $expected
+} {1}
catch {destroy .f2}
.t configure -borderwidth 0 -wrap char
wm geom . {}
-updateText
-set bw [.t cget -borderwidth]
-set px [.t cget -padx]
-set py [.t cget -pady]
-set hlth [.t cget -highlightthickness]
+update
test textDisp-4.7 {UpdateDisplayInfo, filling in extra vertical space} {
# This test was failing on Windows because the title bar on .
# was a certain minimum size and it was interfering with the size
@@ -652,53 +767,54 @@ test textDisp-4.7 {UpdateDisplayInfo, filling in extra vertical space} {
# the overrideredirect on "." confuses the window manager and
# causes subsequent tests to fail.
- if {[tk windowingsystem] == "win32"} {
+ if {[tk windowingsystem] eq "win32"} {
wm overrideredirect . 1
}
.t delete 1.0 end
.t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17"
.t yview 1.0
- updateText
+ update
.t yview 16.0
- updateText
+ update
set x [list [.t index @0,0] $tk_textRelayout $tk_textRedraw]
wm overrideredirect . 0
- updateText
+ update
set x
} {8.0 {16.0 17.0 15.0 14.0 13.0 12.0 11.0 10.0 9.0 8.0} {8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0}}
-test textDisp-4.8 {UpdateDisplayInfo, filling in extra vertical space} failsOnXQuarz {
+test textDisp-4.8 {UpdateDisplayInfo, filling in extra vertical space} {
.t delete 1.0 end
.t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17"
.t yview 16.0
- updateText
+ update
.t delete 5.0 14.0
- updateText
+ update
set x [list [.t index @0,0] $tk_textRelayout $tk_textRedraw]
} {1.0 {5.0 4.0 3.0 2.0 1.0} {1.0 2.0 3.0 4.0 5.0 eof}}
-test textDisp-4.9 {UpdateDisplayInfo, filling in extra vertical space} {textfonts} {
+test textDisp-4.9 {UpdateDisplayInfo, filling in extra vertical space} {
.t delete 1.0 end
.t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17"
.t yview 16.0
- updateText
+ update
.t delete 15.0 end
list [.t bbox 7.0] [.t bbox 12.0]
-} [list [list [expr {$hlth + $px + $bw}] [expr {$hlth + $py + $bw + 2 * $fixedHeight}] $fixedWidth $fixedHeight] [list [expr {$hlth + $px + $bw}] [expr {$hlth + $py + $bw + 7 * $fixedHeight}] $fixedWidth $fixedHeight]]
+} [list [list [xchar 0] [yline 3] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 8] $fixedWidth $fixedHeight]]
test textDisp-4.10 {UpdateDisplayInfo, filling in extra vertical space} {
.t delete 1.0 end
.t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17"
.t yview end
- updateText
+ update
.t delete 13.0 end
- updateText
+ update
list [.t index @0,0] $tk_textRelayout $tk_textRedraw
} {5.0 {12.0 7.0 6.40 6.20 6.0 5.0} {5.0 6.0 6.20 6.40 7.0 12.0}}
test textDisp-4.11 {UpdateDisplayInfo, filling in extra vertical space} {
.t delete 1.0 end
.t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around, not once but really quite a few times.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17"
.t yview end
- updateText
+ update
.t delete 14.0 end
- updateText
+ update
list [.t index @0,0] $tk_textRelayout $tk_textRedraw
} {6.40 {13.0 7.0 6.80 6.60 6.40} {6.40 6.60 6.80 7.0 13.0}}
test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} {
@@ -707,11 +823,11 @@ test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} {
button .b -text "Test" -bd 2 -highlightthickness 2
.t window create 3.end -window .b
.t yview moveto 1
- updateText
+ update
.t yview moveto 0
- updateText
+ update
.t yview moveto 1
- updateText
+ update
winfo ismapped .b
} {0}
.t configure -wrap word
@@ -724,111 +840,120 @@ test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} {
test textDisp-4.13 {UpdateDisplayInfo, special handling for top/bottom lines} {
.t tag add x 1.0 end
.t yview 1.0
- updateText
+ update
.t yview scroll 3 units
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{11.0 12.0 13.0} {4.0 10.0 11.0 12.0 13.0}}
-test textDisp-4.14 {UpdateDisplayInfo, special handling for top/bottom lines} failsOnXQuarz {
+test textDisp-4.14 {UpdateDisplayInfo, special handling for top/bottom lines} {
.t tag remove x 1.0 end
.t yview 1.0
- updateText
+ update
.t yview scroll 3 units
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{11.0 12.0 13.0} {11.0 12.0 13.0}}
test textDisp-4.15 {UpdateDisplayInfo, special handling for top/bottom lines} {
.t tag add x 1.0 end
.t yview 4.0
- updateText
+ update
.t yview scroll -2 units
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 3.0} {2.0 3.0 4.0 11.0}}
test textDisp-4.16 {UpdateDisplayInfo, special handling for top/bottom lines} {
.t tag remove x 1.0 end
.t yview 4.0
- updateText
+ update
.t yview scroll -2 units
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 3.0} {2.0 3.0}}
-test textDisp-4.17 {UpdateDisplayInfo, horizontal scrolling} {textfonts} {
+test textDisp-4.17 {UpdateDisplayInfo, horizontal scrolling} {
.t configure -wrap none
.t delete 1.0 end
.t insert end "Short line 1\nLine 2 is long enough to scroll horizontally"
.t insert end "\nLine 3\nLine 4"
- updateText
+ update
.t xview scroll 3 units
- updateText
+ update
list $tk_textRelayout $tk_textRedraw [.t bbox 2.0] [.t bbox 2.5] \
[.t bbox 2.23]
-} [list {} {1.0 2.0 3.0 4.0} {} [list 17 [expr {$fixedDiff + 16}] 7 $fixedHeight] {}]
-test textDisp-4.18 {UpdateDisplayInfo, horizontal scrolling} {textfonts} {
+} [list {} {1.0 2.0 3.0 4.0} \
+ {} \
+ [list [expr {[xchar 5]-[xw 3]}] [yline 2] $fixedWidth $fixedHeight] \
+ {}]
+test textDisp-4.18 {UpdateDisplayInfo, horizontal scrolling} {
.t configure -wrap none
.t delete 1.0 end
.t insert end "Short line 1\nLine 2 is long enough to scroll horizontally"
.t insert end "\nLine 3\nLine 4"
- updateText
+ update
.t xview scroll 100 units
- updateText
+ update
list $tk_textRelayout $tk_textRedraw [.t bbox 2.25]
-} [list {} {1.0 2.0 3.0 4.0} [list 10 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-4.19 {UpdateDisplayInfo, horizontal scrolling} {textfonts} {
+} [list {} {1.0 2.0 3.0 4.0} \
+ [list [xcharr 19] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-4.19 {UpdateDisplayInfo, horizontal scrolling} {
.t configure -wrap none
.t delete 1.0 end
.t insert end "Short line 1\nLine 2 is long enough to scroll horizontally"
.t insert end "\nLine 3\nLine 4"
- updateText
+ update
.t xview moveto 0
.t xview scroll -10 units
- updateText
+ update
list $tk_textRelayout $tk_textRedraw [.t bbox 2.5]
-} [list {} {1.0 2.0 3.0 4.0} [list 38 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-4.20 {UpdateDisplayInfo, horizontal scrolling} {textfonts} {
+} [list {} {1.0 2.0 3.0 4.0} \
+ [list [xchar 5] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-4.20 {UpdateDisplayInfo, horizontal scrolling} {
.t configure -wrap none
.t delete 1.0 end
.t insert end "Short line 1\nLine 2 is long enough to scroll horizontally"
.t insert end "\nLine 3\nLine 4"
.t xview moveto 0.0
.t xview scroll 100 units
- updateText
+ update
.t delete 2.30 2.44
- updateText
+ update
list $tk_textRelayout $tk_textRedraw [.t bbox 2.25]
-} [list 2.0 {1.0 2.0 3.0 4.0} [list 108 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-4.21 {UpdateDisplayInfo, horizontal scrolling} {textfonts} {
+} [list 2.0 {1.0 2.0 3.0 4.0} \
+ [list [xcharr 5] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-4.21 {UpdateDisplayInfo, horizontal scrolling} {
.t configure -wrap none
.t delete 1.0 end
.t insert end "Short line 1\nLine 2 is long enough to scroll horizontally"
.t insert end "\nLine 3\nLine 4"
.t xview moveto .9
- updateText
+ update
.t xview moveto .6
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {}}
-test textDisp-4.22 {UpdateDisplayInfo, no horizontal scrolling except for -wrap none} {textfonts} {
+test textDisp-4.22 {UpdateDisplayInfo, no horizontal scrolling except for -wrap none} {
.t configure -wrap none
.t delete 1.0 end
.t insert end "Short line 1\nLine 2 is long enough to scroll horizontally"
.t insert end "\nLine 3\nLine 4"
.t xview scroll 25 units
- updateText
+ update
.t configure -wrap word
list [.t bbox 2.0] [.t bbox 2.16]
-} [list [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 10 [expr {2*$fixedDiff + 29}] 7 $fixedHeight]]
-test textDisp-4.23 {UpdateDisplayInfo, no horizontal scrolling except for -wrap none} {textfonts} {
+} [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
+ [list [xchar 1] [yline 3] $fixedWidth $fixedHeight]]
+test textDisp-4.23 {UpdateDisplayInfo, no horizontal scrolling except for -wrap none} {
.t configure -wrap none
.t delete 1.0 end
.t insert end "Short line 1\nLine 2 is long enough to scroll horizontally"
.t insert end "\nLine 3\nLine 4"
.t xview scroll 25 units
- updateText
+ update
.t configure -wrap char
list [.t bbox 2.0] [.t bbox 2.16]
-} [list [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 115 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-5.1 {DisplayDLine, handling of spacing} {textfonts} {
+} [list [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
+ [list [xchar 16] [yline 2] $fixedWidth $fixedHeight]]
+
+test textDisp-5.1 {DisplayDLine, handling of spacing} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "abcdefghijkl\nmnopqrstuvwzyz"
@@ -842,35 +967,37 @@ test textDisp-5.1 {DisplayDLine, handling of spacing} {textfonts} {
.t window create 1.7 -window .t.f2 -align center
.t window create 2.1 -window .t.f3 -align bottom
.t window create 2.10 -window .t.f4 -align baseline
- updateText
+ update
list [winfo geometry .t.f1] [winfo geometry .t.f2] \
[winfo geometry .t.f3] [winfo geometry .t.f4]
-} [list 10x4+24+11 10x4+55+[expr {$fixedDiff/2 + 15}] 10x4+10+[expr {2*$fixedDiff + 43}] 10x4+76+[expr {2*$fixedDiff + 40}]]
+} [list 10x4+[xchar 3]+[expr {[yline 1]+8}] \
+ 10x4+[expr {[xchar 6]+10}]+[expr {[yline 1]+8+($fixedHeight-4)/2}] \
+ 10x4+[xchar 1]+[expr {[yline 2]+8+2+8+($fixedHeight-4)}] \
+ 10x4+[expr {[xchar 9]+10}]+[expr {[yline 2]+8+2+8+($fixedAscent-4)}]]
.t tag delete spacing
# Although the following test produces a useful result, its main
# effect is to produce a core dump if Tk doesn't handle display
# relayout that occurs during redisplay.
-
test textDisp-5.2 {DisplayDLine, line resizes during display} {
.t delete 1.0 end
frame .t.f -width 20 -height 20 -bd 2 -relief raised
bind .t.f <Configure> {.t.f configure -width 30 -height 30}
.t window create insert -window .t.f
- updateText
+ update
list [winfo width .t.f] [winfo height .t.f]
} [list 30 30]
.t configure -wrap char
-test textDisp-6.1 {scrolling in DisplayText, scroll up} failsOnXQuarz {
+test textDisp-6.1 {scrolling in DisplayText, scroll up} {
.t delete 1.0 end
.t insert 1.0 "Line 1"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 2.0 3.0
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 10.0} {2.0 10.0}}
test textDisp-6.2 {scrolling in DisplayText, scroll down} {
@@ -879,9 +1006,9 @@ test textDisp-6.2 {scrolling in DisplayText, scroll down} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t insert 2.0 "New Line 2\n"
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 3.0} {2.0 3.0}}
test textDisp-6.3 {scrolling in DisplayText, multiple scrolls} {
@@ -891,10 +1018,10 @@ test textDisp-6.3 {scrolling in DisplayText, multiple scrolls} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t insert 2.end "is so long that it wraps"
.t insert 4.end "is so long that it wraps"
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20 4.0 4.20} {2.0 2.20 4.0 4.20}}
test textDisp-6.4 {scrolling in DisplayText, scrolls interfere} {
@@ -904,13 +1031,14 @@ test textDisp-6.4 {scrolling in DisplayText, scrolls interfere} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t insert 2.end "is so long that it wraps around, not once but three times"
.t insert 4.end "is so long that it wraps"
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20 2.40 2.60 4.0 4.20} {2.0 2.20 2.40 2.60 4.0 4.20 6.0}}
-test textDisp-6.5 {scrolling in DisplayText, scroll source obscured} {notAqua} {
+test textDisp-6.5 {scrolling in DisplayText, scroll source obscured} {aquaKnownBug} {
+# constrained by aquaKnownBug until ticket [aad0231f07] is fixed
.t configure -wrap char
frame .f2 -bg red
place .f2 -in .t -relx 0.5 -rely 0.5 -relwidth 0.5 -relheight 0.5
@@ -919,48 +1047,50 @@ test textDisp-6.5 {scrolling in DisplayText, scroll source obscured} {notAqua} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 1.6 1.end
- updateText
+ update
destroy .f2
list $tk_textRelayout $tk_textRedraw
} {{1.0 9.0 10.0} {1.0 4.0 5.0 9.0 10.0}}
-test textDisp-6.6 {scrolling in DisplayText, Expose events after scroll} {notAqua} {
+test textDisp-6.6 {scrolling in DisplayText, Expose events after scroll} {aquaKnownBug} {
+# constrained by aquaKnownBug until ticket [aad0231f07] is fixed
# this test depends on all of the expose events being handled at once
.t configure -wrap char
frame .f2 -bg #ff0000
place .f2 -in .t -relx 0.2 -rely 0.5 -relwidth 0.5 -relheight 0.5
.t configure -bd 2 -relief raised
.t delete 1.0 end
- .t insert 1.0 "Line 1 is so long that it wraps around, a couple of times"
+ # Line 1 must wrap exactly twice to get the expected result
+ .t insert 1.0 "Line 1 is so long that it occupies 3 display lines"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 1.6 1.end
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{1.0 9.0 10.0} {1.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0}}
.t configure -bd 0
test textDisp-6.7 {DisplayText, vertical scrollbar updates} {
.t configure -wrap char
.t delete 1.0 end
- updateText
+ update
.t count -update -ypixels 1.0 end
- updateText
+ update
set scrollInfo
} {0.0 1.0}
test textDisp-6.8 {DisplayText, vertical scrollbar updates} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1"
- updateText
+ update
set scrollInfo "unchanged"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t count -update -ypixels 1.0 end ; update
set scrollInfo
} [list 0.0 [expr {10.0/13}]]
@@ -968,15 +1098,15 @@ test textDisp-6.8 {DisplayText, vertical scrollbar updates} {
test textDisp-6.9 {DisplayText, horizontal scrollbar updates} {
.t configure -wrap none
.t delete 1.0 end
- updateText
+ update
set scrollInfo unchanged
.t insert end xxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx
- updateText
+ update
set scrollInfo
} [list 0.0 [expr {4.0/11}]]
-test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll.} {aqua} {
+test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll} {aqua} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1"
@@ -992,9 +1122,9 @@ test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll.} {aqua
.t insert end "\nLine 8\n"
.t window create end -create {
button %W.button_three -text "Button 3"}
- updateText
+ update
.t delete 2.0 3.0
- updateText
+ update
list $tk_textEmbWinDisplay
} {{4.0 6.0}}
@@ -1005,91 +1135,99 @@ test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll.} {aqua
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
-test textDisp-7.1 {TkTextRedrawRegion} {notAqua} {
+test textDisp-7.1 {TkTextRedrawRegion} {aquaKnownBug} {
+# constrained by aquaKnownBug until ticket [aad0231f07] is fixed
frame .f2 -bg #ff0000
place .f2 -in .t -relx 0.2 -relwidth 0.6 -rely 0.22 -relheight 0.55
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {1.40 2.0 3.0 4.0 5.0 6.0}}
-test textDisp-7.2 {TkTextRedrawRegion} {notAqua} {
+test textDisp-7.2 {TkTextRedrawRegion} {aquaKnownBug} {
+# constrained by aquaKnownBug until ticket [aad0231f07] is fixed
frame .f2 -bg #ff0000
place .f2 -in .t -relx 0 -relwidth 0.5 -rely 0 -relheight 0.5
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {1.0 1.20 1.40 2.0 3.0}}
-test textDisp-7.3 {TkTextRedrawRegion} {notAqua} {
+test textDisp-7.3 {TkTextRedrawRegion} {aquaKnownBug} {
+# constrained by aquaKnownBug until ticket [aad0231f07] is fixed
frame .f2 -bg #ff0000
place .f2 -in .t -relx 0.5 -relwidth 0.5 -rely 0.5 -relheight 0.5
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {4.0 5.0 6.0 7.0 8.0}}
-test textDisp-7.4 {TkTextRedrawRegion} {notAqua} {
- frame .f2 -bg #ff0000
+test textDisp-7.4 {TkTextRedrawRegion} {aquaKnownBug} {
+ # constrained by aquaKnownBug until ticket [aad0231f07] is fixed
+ frame .f2 -bg #ff0000
place .f2 -in .t -relx 0.4 -relwidth 0.2 -rely 0 -relheight 0.2 \
-bordermode ignore
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {borders 1.0 1.20}}
-test textDisp-7.5 {TkTextRedrawRegion} {notAqua} {
+test textDisp-7.5 {TkTextRedrawRegion} {aquaKnownBug} {
+# constrained by aquaKnownBug until ticket [aad0231f07] is fixed
frame .f2 -bg #ff0000
place .f2 -in .t -relx 0.4 -relwidth 0.2 -rely 1.0 -relheight 0.2 \
-anchor s -bordermode ignore
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {borders 7.0 8.0}}
-test textDisp-7.6 {TkTextRedrawRegion} {notAqua} {
+test textDisp-7.6 {TkTextRedrawRegion} {aquaKnownBug} {
+# constrained by aquaKnownBug until ticket [aad0231f07] is fixed
frame .f2 -bg #ff0000
place .f2 -in .t -relx 0 -relwidth 0.2 -rely 0.55 -relheight 0.2 \
-anchor w -bordermode ignore
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {borders 3.0 4.0 5.0}}
-test textDisp-7.7 {TkTextRedrawRegion} {notAqua} {
+test textDisp-7.7 {TkTextRedrawRegion} {aquaKnownBug} {
+# constrained by aquaKnownBug until ticket [aad0231f07] is fixed
frame .f2 -bg #ff0000
place .f2 -in .t -relx 1.0 -relwidth 0.2 -rely 0.55 -relheight 0.2 \
-anchor e -bordermode ignore
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {borders 3.0 4.0 5.0}}
-test textDisp-7.8 {TkTextRedrawRegion} {notAqua} {
+test textDisp-7.8 {TkTextRedrawRegion} {aquaKnownBug} {
+# constrained by aquaKnownBug until ticket [aad0231f07] is fixed
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2\nLine 3\nLine 4\nLine 5\nLine 6\n"
frame .f2 -bg #ff0000
place .f2 -in .t -relx 0.0 -relwidth 0.4 -rely 0.35 -relheight 0.4 \
-anchor nw -bordermode ignore
- updateText
+ update
destroy .f2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{} {borders 4.0 5.0 6.0 7.0 eof}}
.t configure -bd 0
-test textDisp-8.1 {TkTextChanged: redisplay whole lines} {textfonts} {
+test textDisp-8.1 {TkTextChanged: redisplay whole lines} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is so long that it wraps around, two times"
foreach i {3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 2.36 2.38
- updateText
+ update
list $tk_textRelayout $tk_textRedraw [.t bbox 2.32]
-} [list {2.0 2.18 2.38} {2.0 2.18 2.38} [list 101 [expr {2*$fixedDiff + 29}] 7 $fixedHeight]]
+} [list {2.0 2.18 2.38} {2.0 2.18 2.38} [list [xchar 14] [yline 3] $fixedWidth $fixedHeight]]
.t configure -wrap char
test textDisp-8.2 {TkTextChanged, redisplay whole lines} {
.t delete 1.0 end
@@ -1097,9 +1235,9 @@ test textDisp-8.2 {TkTextChanged, redisplay whole lines} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t insert 1.2 xx
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{1.0 1.20 1.40} {1.0 1.20 1.40}}
test textDisp-8.3 {TkTextChanged} {
@@ -1108,9 +1246,9 @@ test textDisp-8.3 {TkTextChanged} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t insert 2.0 xx
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {2.0 2.0}
test textDisp-8.4 {TkTextChanged} {
@@ -1119,9 +1257,9 @@ test textDisp-8.4 {TkTextChanged} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 1.5
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{1.0 1.20 1.40} {1.0 1.20 1.40}}
test textDisp-8.5 {TkTextChanged} {
@@ -1130,9 +1268,9 @@ test textDisp-8.5 {TkTextChanged} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 1.40 1.44
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{1.0 1.20 1.40} {1.0 1.20 1.40}}
test textDisp-8.6 {TkTextChanged} {
@@ -1141,20 +1279,20 @@ test textDisp-8.6 {TkTextChanged} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 1.41 1.44
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{1.0 1.20 1.40} {1.0 1.20 1.40}}
-test textDisp-8.7 {TkTextChanged} failsOnXQuarz {
+test textDisp-8.7 {TkTextChanged} {
.t delete 1.0 end
.t insert 1.0 "Line 1 is so long that it wraps around, two times"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 1.2 1.end
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{1.0 9.0 10.0} {1.0 9.0 10.0}}
test textDisp-8.8 {TkTextChanged} {
@@ -1163,44 +1301,44 @@ test textDisp-8.8 {TkTextChanged} {
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 2.2
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {2.0 2.0}
-test textDisp-8.9 {TkTextChanged} failsOnXQuarz {
+test textDisp-8.9 {TkTextChanged} {
.t delete 1.0 end
.t insert 1.0 "Line 1 is so long that it wraps around, two times"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
.t insert end "\nLine $i"
}
- updateText
+ update
.t delete 2.0 3.0
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 8.0} {2.0 8.0}}
-test textDisp-8.10 {TkTextChanged} failsOnUbuntu {
+test textDisp-8.10 {TkTextChanged} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4"
.t tag add big 2.19
- updateText
+ update
.t delete 2.19
- updateText
+ update
set tk_textRedraw
} {2.0 2.20 eof}
test textDisp-8.11 {TkTextChanged, scrollbar notification when changes are off-screen} {
.t delete 1.0 end
.t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n"
.t configure -yscrollcommand scroll
- updateText
+ update
set scrollInfo ""
.t insert end "a\nb\nc\n"
# We need to wait for our asychronous callbacks to update the
# scrollbar
- updateText
+ update
.t count -update -ypixels 1.0 end
- updateText
+ update
.t configure -yscrollcommand ""
set scrollInfo
} {0.0 0.625}
@@ -1213,133 +1351,145 @@ test textDisp-8.12 {TkTextChanged, moving the insert cursor redraws only past an
.t tag add hidden 5.0 8.0
.t tag configure hidden -elide true
.t mark set insert 9.0
- updateText
+ update
.t mark set insert 8.0 ; # up one line
- updateText
+ update
set res [list $tk_textRedraw]
.t mark set insert 12.2 ; # in the visible text
- updateText
+ update
lappend res $tk_textRedraw
.t mark set insert 6.5 ; # in the hidden text
- updateText
+ update
lappend res $tk_textRedraw
.t mark set insert 3.5 ; # in the visible text again
- updateText
+ update
lappend res $tk_textRedraw
.t mark set insert 3.8 ; # within the same line
- updateText
+ update
lappend res $tk_textRedraw
} {{8.0 9.0} {8.0 12.0} {8.0 12.0} {3.0 8.0} {3.0 4.0}}
test textDisp-8.13 {TkTextChanged, used to crash, see [06c1433906]} {
.t delete 1.0 end
.t insert 1.0 \nLine2\nLine3\n
- updateText
+ update
.t insert 3.0 ""
.t delete 1.0 2.0
update idletasks
} {}
-test textDisp-9.1 {TkTextRedrawTag} failsOnUbuntu {
+test textDisp-9.1 {TkTextRedrawTag} -body {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4"
- updateText
+ update
.t tag add big 2.2 2.4
- updateText
- list $tk_textRelayout $tk_textRedraw
-} {{2.0 2.18} {2.0 2.18}}
-test textDisp-9.2 {TkTextRedrawTag} {textfonts} {
+ update
+ list $tk_textRelayout $tk_textRedraw
+# glob matching is to have some tolerance on actually used font size
+# while still testing what we want to test
+} -match glob -result {{2.0 2.1[78]} {2.0 2.1[78]}}
+test textDisp-9.2 {TkTextRedrawTag} -body {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4"
- updateText
+ update
.t tag add big 1.2 2.4
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
-} {{1.0 2.0 2.17} {1.0 2.0 2.17}}
-test textDisp-9.3 {TkTextRedrawTag} failsOnUbuntu {
+# glob matching is to have some tolerance on actually used font size
+# while still testing what we want to test
+} -match glob -result {{1.0 2.0 2.1[678]} {1.0 2.0 2.1[678]}}
+test textDisp-9.3 {TkTextRedrawTag} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4"
- updateText
+ update
.t tag add big 2.2 2.4
- updateText
+ update
.t tag remove big 1.0 end
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20} {2.0 2.20 eof}}
-test textDisp-9.4 {TkTextRedrawTag} failsOnUbuntu {
+test textDisp-9.4 {TkTextRedrawTag} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4"
- updateText
+ update
.t tag add big 2.2 2.20
- updateText
+ update
.t tag remove big 1.0 end
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20} {2.0 2.20 eof}}
-test textDisp-9.5 {TkTextRedrawTag} {failsOnUbuntu failsOnXQuarz} {
- .t configure -wrap char
+test textDisp-9.5 {TkTextRedrawTag} -setup {
+ .t configure -wrap char -height [expr {[.t cget -height]+10}]
+} -body {
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4"
- updateText
+ update
.t tag add big 2.2 2.end
- updateText
+ update
.t tag remove big 1.0 end
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
-} {{2.0 2.20} {2.0 2.20 eof}}
-test textDisp-9.6 {TkTextRedrawTag} failsOnUbuntu {
+} -cleanup {
+ .t configure -height [expr {[.t cget -height]-10}]
+ update
+} -result {{2.0 2.20} {2.0 2.20 eof}}
+test textDisp-9.6 {TkTextRedrawTag} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap"
- updateText
+ update
.t tag add big 2.2 3.5
- updateText
+ update
.t tag remove big 1.0 end
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20 3.0 3.20} {2.0 2.20 3.0 3.20 eof}}
-test textDisp-9.7 {TkTextRedrawTag} failsOnUbuntu {
+test textDisp-9.7 {TkTextRedrawTag} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4"
.t tag add big 2.19
- updateText
+ update
.t tag remove big 2.19
- updateText
+ update
set tk_textRedraw
} {2.0 2.20 eof}
-test textDisp-9.8 {TkTextRedrawTag} {textfonts} {
+test textDisp-9.8 {TkTextRedrawTag} -body {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4"
.t tag add big 1.0 2.0
- updateText
+ update
.t tag add big 2.0 2.5
- updateText
+ update
set tk_textRedraw
-} {2.0 2.17}
-test textDisp-9.9 {TkTextRedrawTag} {textfonts} {
+# glob matching is to have some tolerance on actually used font size
+# while still testing what we want to test
+} -match glob -result {2.0 2.1[678]}
+test textDisp-9.9 {TkTextRedrawTag} -body {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4"
.t tag add big 1.0 2.0
- updateText
+ update
.t tag add big 1.5 2.5
- updateText
+ update
set tk_textRedraw
-} {2.0 2.17}
+# glob matching is to have some tolerance on actually used font size
+# while still testing what we want to test
+} -match glob -result {2.0 2.1[678]}
test textDisp-9.10 {TkTextRedrawTag} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4"
.t tag add big 1.0 2.0
- updateText
+ update
set tk_textRedraw none
.t tag add big 1.3 1.5
- updateText
+ update
set tk_textRedraw
} none
test textDisp-9.11 {TkTextRedrawTag} {
@@ -1347,9 +1497,9 @@ test textDisp-9.11 {TkTextRedrawTag} {
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4"
.t tag add big 1.0 2.0
- updateText
+ update
.t tag add big 1.0 2.0
- updateText
+ update
set tk_textRedraw
} {}
test textDisp-9.12 {TkTextRedrawTag} {
@@ -1360,9 +1510,9 @@ test textDisp-9.12 {TkTextRedrawTag} {
}
.t tag configure hidden -elide true
.t tag add hidden 2.6 3.6
- updateText
+ update
.t tag add hidden 3.11 4.6
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {2.0 {2.0 eof}}
test textDisp-9.13 {TkTextRedrawTag} {
@@ -1375,9 +1525,9 @@ test textDisp-9.13 {TkTextRedrawTag} {
.t tag add hidden 6.8 7.17
.t tag configure hidden -background red
.t tag configure hidden -elide true
- updateText
+ update
.t tag configure hidden -elide false
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{2.0 6.0 7.0} {2.0 6.0 7.0}}
test textDisp-9.14 {TkTextRedrawTag} {
@@ -1387,7 +1537,7 @@ test textDisp-9.14 {TkTextRedrawTag} {
}
.tnocrash tag configure mytag1 -relief raised
.tnocrash tag configure mytag2 -relief solid
- updateText
+ update
proc doit {} {
.tnocrash tag add mytag1 4.0 5.0
.tnocrash tag add mytag2 4.0 5.0
@@ -1409,9 +1559,9 @@ test textDisp-10.1 {TkTextRelayoutWindow} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4"
- updateText
+ update
.t configure -bg black
- updateText
+ update
list $tk_textRelayout $tk_textRedraw
} {{1.0 2.0 2.20 3.0 3.20 4.0} {borders 1.0 2.0 2.20 3.0 3.20 4.0 eof}}
.t configure -bg [lindex [.t configure -bg] 3]
@@ -1425,7 +1575,7 @@ test textDisp-10.2 {TkTextRelayoutWindow} {
.top.t see insert
tkwait visibility .top.t
place .top.t -width 150 -height 100
- updateText
+ update
.top.t index @0,0
} {1.0}
catch {destroy .top}
@@ -1435,96 +1585,96 @@ catch {destroy .top}
for {set i 2} {$i <= 200} {incr i} {
.t insert end "\nLine $i"
}
-updateText
+update
test textDisp-11.1 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
.t index @0,0
} {30.0}
-test textDisp-11.2 {TkTextSetYView} failsOnXQuarz {
+test textDisp-11.2 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
.t yview 32.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {32.0 {40.0 41.0}}
test textDisp-11.3 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
.t yview 28.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {28.0 {28.0 29.0}}
-test textDisp-11.4 {TkTextSetYView} failsOnXQuarz {
+test textDisp-11.4 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
.t yview 31.4
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {31.0 40.0}
test textDisp-11.5 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
set tk_textRedraw {}
.t yview -pickplace 31.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {30.0 {}}
test textDisp-11.6 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
set tk_textRedraw {}
.t yview -pickplace 28.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {28.0 {28.0 29.0}}
test textDisp-11.7 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
set tk_textRedraw {}
.t yview -pickplace 26.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {21.0 {21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0}}
-test textDisp-11.8 {TkTextSetYView} failsOnXQuarz {
+test textDisp-11.8 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
set tk_textRedraw {}
.t yview -pickplace 41.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {32.0 {40.0 41.0}}
-test textDisp-11.9 {TkTextSetYView} failsOnXQuarz {
+test textDisp-11.9 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
set tk_textRedraw {}
.t yview -pickplace 43.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {38.0 {40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0}}
test textDisp-11.10 {TkTextSetYView} {
.t yview 30.0
- updateText
+ update
set tk_textRedraw {}
.t yview 10000.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {191.0 {191.0 192.0 193.0 194.0 195.0 196.0 197.0 198.0 199.0 200.0}}
test textDisp-11.11 {TkTextSetYView} {
.t yview 195.0
- updateText
+ update
set tk_textRedraw {}
.t yview 197.0
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {191.0 {191.0 192.0 193.0 194.0 195.0 196.0}}
-test textDisp-11.12 {TkTextSetYView, wrapped line is off-screen} failsOnXQuarz {
+test textDisp-11.12 {TkTextSetYView, wrapped line is off-screen} {
.t insert 10.0 "Long line with enough text to wrap\n"
.t yview 1.0
- updateText
+ update
set tk_textRedraw {}
.t see 10.30
- updateText
+ update
list [.t index @0,0] $tk_textRedraw
} {2.0 10.20}
.t delete 10.0 11.0
@@ -1538,15 +1688,15 @@ test textDisp-11.13 {TkTestSetYView, partially visible last line} {
for {set i 2} {$i <= 100} {incr i} {
.top.t insert end "\nLine $i"
}
- updateText
+ update
scan [wm geometry .top] "%dx%d" w2 h2
wm geometry .top ${w2}x[expr {$h2-2}]
- updateText
+ update
.top.t yview 1.0
- updateText
+ update
set tk_textRedraw {}
.top.t see 5.0
- updateText
+ update
# Note, with smooth scrolling, the results of this test
# have changed, and the old '2.0 {5.0 6.0}' is quite wrong.
list [.top.t index @0,0] $tk_textRedraw
@@ -1560,29 +1710,29 @@ pack .top.t
for {set i 2} {$i <= 20} {incr i} {
.top.t insert end "\nLine $i"
}
-updateText
+update
test textDisp-11.14 {TkTextSetYView, only a few lines visible} {
.top.t yview 5.0
- updateText
+ update
.top.t see 10.0
.top.t index @0,0
} {8.0}
test textDisp-11.15 {TkTextSetYView, only a few lines visible} {
.top.t yview 5.0
- updateText
+ update
.top.t see 11.0
.top.t index @0,0
# The index 9.0 should be just visible by a couple of pixels
} {9.0}
test textDisp-11.16 {TkTextSetYView, only a few lines visible} {
.top.t yview 8.0
- updateText
+ update
.top.t see 5.0
.top.t index @0,0
} {5.0}
test textDisp-11.17 {TkTextSetYView, only a few lines visible} {
.top.t yview 8.0
- updateText
+ update
.top.t see 4.0
.top.t index @0,0
# The index 2.0 should be just visible by a couple of pixels
@@ -1597,7 +1747,7 @@ test textDisp-11.18 {TkTextSetYView, see in elided lines} {
.top.t tag add hidden 4.10 "4.10 lineend"
.top.t tag add hidden 5.15 10.3
.top.t tag configure hidden -elide true
- updateText
+ update
.top.t see "8.0 lineend"
# The index "8.0 lineend" is on screen despite elided -> no scroll
.top.t index @0,0
@@ -1617,19 +1767,19 @@ test textDisp-11.19 {TkTextSetYView, see in elided lines} {
# Indices 21.0, 17.0 and 15.0 are all on the same display line
# therefore index @0,0 shall be the same for all of them
.top.t see end
- updateText
+ update
.top.t see 21.0
- updateText
+ update
set ind1 [.top.t index @0,0]
.top.t see end
- updateText
+ update
.top.t see 17.0
- updateText
+ update
set ind2 [.top.t index @0,0]
.top.t see end
- updateText
+ update
.top.t see 15.0
- updateText
+ update
set ind3 [.top.t index @0,0]
list [expr {$ind1 == $ind2}] [expr {$ind1 == $ind3}]
} {1 1}
@@ -1652,7 +1802,7 @@ test textDisp-11.21 {TkTextSetYView, window height smaller than the line height}
}
set lineheight [font metrics [.top.t cget -font] -linespace]
wm geometry .top 200x[expr {$lineheight / 2}]
- updateText
+ update
.top.t see 1.0
.top.t index @0,[expr {$lineheight - 2}]
} {1.0}
@@ -1664,9 +1814,9 @@ test textDisp-11.22 {TkTextSetYView, peer has -startline} {
pack [.top.t peer create .top.p] -side left
pack [scrollbar .top.sb -command {.top.p yview}] -side left -fill y
.top.p configure -startline 5 -endline 35 -yscrollcommand {.top.sb set}
- updateText
+ update
.top.p yview moveto 0
- updateText
+ update
set res [.top.p get @0,0 "@0,0 lineend"]
destroy .top.p
set res
@@ -1677,38 +1827,38 @@ test textDisp-11.22 {TkTextSetYView, peer has -startline} {
.t insert 50.0 "This is a long line, one that will wrap around twice.\n"
test textDisp-12.1 {MeasureUp} {
.t yview 100.0
- updateText
+ update
.t yview -pickplace 52.0
- updateText
+ update
.t index @0,0
} {49.0}
test textDisp-12.2 {MeasureUp} {
.t yview 100.0
- updateText
+ update
.t yview -pickplace 53.0
- updateText
+ update
.t index @0,0
} {50.0}
test textDisp-12.3 {MeasureUp} {
.t yview 100.0
- updateText
+ update
.t yview -pickplace 50.10
- updateText
+ update
.t index @0,0
} {45.0}
.t configure -wrap none
test textDisp-12.4 {MeasureUp} {
.t yview 100.0
- updateText
+ update
.t yview -pickplace 53.0
- updateText
+ update
.t index @0,0
} {48.0}
test textDisp-12.5 {MeasureUp} {
.t yview 100.0
- updateText
+ update
.t yview -pickplace 50.10
- updateText
+ update
.t index @0,0
} {45.0}
@@ -1731,7 +1881,7 @@ test textDisp-13.3 {TkTextSeeCmd procedure} {
test textDisp-13.4 {TkTextSeeCmd procedure} {
.t xview moveto 0
.t yview moveto 0
- updateText
+ update
.t see 4.2
.t index @0,0
} {1.0}
@@ -1739,7 +1889,7 @@ test textDisp-13.5 {TkTextSeeCmd procedure} {
.t configure -wrap char
.t xview moveto 0
.t yview moveto 0
- updateText
+ update
.t see 12.1
.t index @0,0
} {3.0}
@@ -1747,18 +1897,18 @@ test textDisp-13.6 {TkTextSeeCmd procedure} {
.t configure -wrap char
.t xview moveto 0
.t yview moveto 0
- updateText
+ update
.t see 30.50
set x [.t index @0,0]
.t configure -wrap none
set x
} {27.0}
-test textDisp-13.7 {TkTextSeeCmd procedure} {textfonts} {
+test textDisp-13.7 {TkTextSeeCmd procedure} {
.t xview moveto 0
.t yview moveto 0
.t tag add sel 30.20
.t tag add sel 30.40
- updateText
+ update
.t see 30.50
.t yview 25.0
.t see 30.50
@@ -1769,13 +1919,16 @@ test textDisp-13.7 {TkTextSeeCmd procedure} {textfonts} {
lappend x [.t bbox 30.38]
.t see 30.20
lappend x [.t bbox 30.20]
-} [list [list 73 [expr {5*$fixedDiff + 68}] 7 $fixedHeight] [list 3 [expr {5*$fixedDiff + 68}] 7 $fixedHeight] [list 3 [expr {5*$fixedDiff + 68}] 7 $fixedHeight] [list 73 [expr {5*$fixedDiff + 68}] 7 $fixedHeight]]
-test textDisp-13.8 {TkTextSeeCmd procedure} {textfonts} {
+} [list [list [xchar 10] [yline 6] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 6] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 6] $fixedWidth $fixedHeight] \
+ [list [xchar 10] [yline 6] $fixedWidth $fixedHeight]]
+test textDisp-13.8 {TkTextSeeCmd procedure} {
.t xview moveto 0
.t yview moveto 0
.t tag add sel 30.20
.t tag add sel 30.50
- updateText
+ update
.t see 30.50
set x [list [.t bbox 30.50]]
.t see 30.60
@@ -1784,14 +1937,22 @@ test textDisp-13.8 {TkTextSeeCmd procedure} {textfonts} {
lappend x [.t bbox 30.65]
.t see 30.90
lappend x [.t bbox 30.90]
-} [list [list 73 [expr {9*$fixedDiff/2 + 64}] 7 $fixedHeight] [list 136 [expr {9*$fixedDiff/2 + 64}] 7 $fixedHeight] [list 136 [expr {9*$fixedDiff/2 + 64}] 7 $fixedHeight] [list 73 [expr {9*$fixedDiff/2 + 64}] 7 $fixedHeight]]
-test textDisp-13.9 {TkTextSeeCmd procedure} {textfonts} {
+ # contrary to textDisp-13.7 above there is no yview command in this test
+ # therefore take into account that the top line is partially hidden
+ set y [expr {[yline 6] + [lindex [.t bbox @0,0] 1] - [bo]}]
+ set expected [list [list [xchar 10] $y $fixedWidth $fixedHeight] \
+ [list [xchar 19] $y $fixedWidth $fixedHeight] \
+ [list [xchar 19] $y $fixedWidth $fixedHeight] \
+ [list [xchar 10] $y $fixedWidth $fixedHeight]]
+ lequal $x $expected
+} {1}
+test textDisp-13.9 {TkTextSeeCmd procedure} {
wm geom . [expr {$width-2}]x$height
.t xview moveto 0
.t yview moveto 0
.t tag add sel 30.20
.t tag add sel 30.50
- updateText
+ update
.t see 30.50
set x [list [.t bbox 30.50]]
.t see 30.60
@@ -1800,8 +1961,16 @@ test textDisp-13.9 {TkTextSeeCmd procedure} {textfonts} {
lappend x [.t bbox 30.65]
.t see 30.90
lappend x [.t bbox 30.90]
-} [list [list 74 [expr {9*$fixedDiff/2 + 66}] 7 $fixedHeight] [list 138 [expr {9*$fixedDiff/2 + 66}] 7 $fixedHeight] [list 138 [expr {9*$fixedDiff/2 + 66}] 7 $fixedHeight] [list 74 [expr {9*$fixedDiff/2 + 66}] 7 $fixedHeight]]
-test textDisp-13.10 {TkTextSeeCmd procedure} {} {
+ # contrary to textDisp-13.7 above there is no yview command in this test
+ # therefore take into account that the top line is partially hidden
+ set y [expr {[yline 6] + [lindex [.t bbox @0,0] 1] - [bo]}]
+ set expected [list [list [expr {[bo]+round([winfo width .t]-2*[bo])/2}] $y $fixedWidth $fixedHeight] \
+ [list [xcharr 1] $y $fixedWidth $fixedHeight] \
+ [list [xcharr 1] $y $fixedWidth $fixedHeight] \
+ [list [expr {[bo]+round([winfo width .t]-2*[bo])/2}] $y $fixedWidth $fixedHeight]]
+ lequal $x $expected
+} {1}
+test textDisp-13.10 {TkTextSeeCmd procedure} {
# SF Bug 641778
set w .tsee
destroy $w
@@ -1820,16 +1989,15 @@ test textDisp-13.11 {TkTextSeeCmd procedure} {} {
pack [text .top2.t2 -wrap none]
for {set i 1} {$i < 5} {incr i} {
.top2.t2 insert end [string repeat "Line $i: éèàçù" 5]\n
-
}
wm geometry .top2 300x200+0+0
- updateText
+ update
.top2.t2 see "1.0 lineend"
- updateText
+ update
set ref [.top2.t2 index @0,0]
.top2.t2 insert "1.0 lineend" ç
.top2.t2 see "1.0 lineend"
- updateText
+ update
set new [.top2.t2 index @0,0]
set res [.top2.t2 compare $ref == $new]
destroy .top2
@@ -1840,7 +2008,7 @@ wm geom . {}
.t configure -wrap none
test textDisp-14.1 {TkTextXviewCmd procedure} {
.t delete 1.0 end
- updateText
+ update
.t insert end xxxxxxxxx\n
.t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n"
.t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx"
@@ -1850,7 +2018,7 @@ test textDisp-14.1 {TkTextXviewCmd procedure} {
.t configure -wrap char
test textDisp-14.2 {TkTextXviewCmd procedure} {
.t delete 1.0 end
- updateText
+ update
.t insert end xxxxxxxxx\n
.t insert end "xxxxx\n"
.t insert end "xxxx"
@@ -1859,7 +2027,7 @@ test textDisp-14.2 {TkTextXviewCmd procedure} {
.t configure -wrap none
test textDisp-14.3 {TkTextXviewCmd procedure} {
.t delete 1.0 end
- updateText
+ update
.t insert end xxxxxxxxx\n
.t insert end "xxxxx\n"
.t insert end "xxxx"
@@ -1874,30 +2042,30 @@ test textDisp-14.5 {TkTextXviewCmd procedure} {
test textDisp-14.6 {TkTextXviewCmd procedure} {
list [catch {.t xview moveto a} msg] $msg
} {1 {expected floating-point number but got "a"}}
-test textDisp-14.7 {TkTextXviewCmd procedure} failsOnUbuntu {
+test textDisp-14.7 {TkTextXviewCmd procedure} {
.t delete 1.0 end
.t insert end xxxxxxxxx\n
- .t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n"
+ .t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n" ; # 56 chars on this line
.t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx"
.t xview moveto .3
.t xview
-} [list [expr {118.0/392}] [expr {258.0/392}]]
+} [list [expr {round(0.3*(56*$fixedWidth))/(56.0*$fixedWidth)}] [expr {round(0.3*(56*$fixedWidth)+20*$fixedWidth)/(56.0*$fixedWidth)}]]
test textDisp-14.8 {TkTextXviewCmd procedure} {
.t delete 1.0 end
.t insert end xxxxxxxxx\n
- .t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n"
+ .t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n" ; # 56 chars on this line
.t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx"
.t xview moveto -.4
.t xview
-} [list 0.0 [expr {5.0/14}]]
+} [list 0.0 [expr {20.0/56}]]
test textDisp-14.9 {TkTextXviewCmd procedure} {
.t delete 1.0 end
.t insert end xxxxxxxxx\n
- .t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n"
+ .t insert end "xxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx\n" ; # 56 chars on this line
.t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx"
.t xview m 1.4
.t xview
-} [list [expr {9.0/14}] 1.0]
+} [list [expr {(56.0-20)/56}] 1.0]
test textDisp-14.10 {TkTextXviewCmd procedure} {
list [catch {.t xview scroll a} msg] $msg
} {1 {wrong # args: should be ".t xview scroll number units|pages|pixels"}}
@@ -1952,43 +2120,43 @@ for {set i 1} {$i < 99} {incr i} {
.t insert 50.0 "This is a long line, one that will wrap around twice.\n"
test textDisp-15.1 {ScrollByLines procedure, scrolling backwards} {
.t yview 45.0
- updateText
+ update
.t yview scroll -3 units
.t index @0,0
} {42.0}
test textDisp-15.2 {ScrollByLines procedure, scrolling backwards} {
.t yview 51.0
- updateText
+ update
.t yview scroll -2 units
.t index @0,0
} {50.20}
test textDisp-15.3 {ScrollByLines procedure, scrolling backwards} {
.t yview 51.0
- updateText
+ update
.t yview scroll -4 units
.t index @0,0
} {49.0}
test textDisp-15.4 {ScrollByLines procedure, scrolling backwards} {
.t yview 50.20
- updateText
+ update
.t yview scroll -2 units
.t index @0,0
} {49.0}
test textDisp-15.5 {ScrollByLines procedure, scrolling backwards} {
.t yview 50.40
- updateText
+ update
.t yview scroll -2 units
.t index @0,0
} {50.0}
test textDisp-15.6 {ScrollByLines procedure, scrolling backwards} {
.t yview 3.2
- updateText
+ update
.t yview scroll -5 units
.t index @0,0
} {1.0}
test textDisp-15.7 {ScrollByLines procedure, scrolling forwards} {
.t yview 48.0
- updateText
+ update
.t yview scroll 4 units
.t index @0,0
} {50.40}
@@ -2014,7 +2182,7 @@ test textDisp-15.8 {Scrolling near end of window} {
for {set i 1} {$i < $textheight} {incr i} {
.tf.f.t insert end "\nLine $i"
}
- updateText
+ update
set refind [.tf.f.t index @0,[winfo height .tf.f.t]]
# Should scroll and should not crash!
.tf.f.t yview scroll 1 unit
@@ -2033,14 +2201,20 @@ for {set i 2} {$i <= 200} {incr i} {
}
.t tag add big 100.0 105.0
.t insert 151.end { has a lot of extra text, so that it wraps around on the screen several times over.}
-.t insert 153.end { also has enoug extra text to wrap.}
-updateText
-.t count -update -ypixels 1.0 end
+.t insert 153.end { also has largely enough extra text to wrap.}
+update
+set totpix [.t count -update -ypixels 1.0 end]
+# check that the wrapping lines wrap exactly 6 times in total (4 times for line 151, and twice for line 153),
+# this is an assumption of the upcoming tests
+if {[expr {double(($totpix-5*$heightDiff)/$fixedHeight)}] != 206.0} {
+ puts "---> Warning: the font actually used by the tests, which is \"[font actual [.t cget -font]]\",\
+is too different from the requested \"[.t cget -font]\". Some of the upcoming tests will probably fail."
+}
test textDisp-16.1 {TkTextYviewCmd procedure} {
.t yview 21.0
set x [.t yview]
.t yview 1.0
- list [expr {int([lindex $x 0]*100)}] [expr {int ([lindex $x 1] * 100)}]
+ list [expr {int([lindex $x 0]*100)}] [expr {int([lindex $x 1]*100)}]
} {9 14}
test textDisp-16.2 {TkTextYviewCmd procedure} {
list [catch {.t yview 2 3} msg] $msg
@@ -2056,7 +2230,7 @@ test textDisp-16.5 {TkTextYviewCmd procedure} {
} {1 {bad option "-bogus": must be moveto or scroll}}
test textDisp-16.6 {TkTextYviewCmd procedure, integer position} {
.t yview 100.0
- updateText
+ update
.t yview 98
.t index @0,0
} {99.0}
@@ -2074,7 +2248,7 @@ test textDisp-16.9 {TkTextYviewCmd procedure, "moveto" option} {
test textDisp-16.10 {TkTextYviewCmd procedure, "moveto" option} {
list [catch {.t yview moveto gorp} msg] $msg
} {1 {expected floating-point number but got "gorp"}}
-test textDisp-16.11 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu {
+test textDisp-16.11 {TkTextYviewCmd procedure, "moveto" option} {
.t yview moveto 0.5
.t index @0,0
} {103.0}
@@ -2086,32 +2260,61 @@ test textDisp-16.13 {TkTextYviewCmd procedure, "moveto" option} {
.t yview moveto 1.1
.t index @0,0
} {191.0}
-test textDisp-16.14 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu {
+test textDisp-16.14 {TkTextYviewCmd procedure, "moveto" option} {
+ # y move to 3/4 of text widget content height
.t yview moveto .75
- .t index @0,0
-} {151.60}
-test textDisp-16.15 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu {
- .t yview moveto .752
- .t index @0,0
-} {151.60}
-test textDisp-16.16 {TkTextYviewCmd procedure, "moveto" option} textfonts {
- set count [expr {5 * $bigHeight + 150 * $fixedHeight}]
- set extra [expr {0.04 * double($fixedDiff * 150) / double($count)}]
- .t yview moveto [expr {.753 - $extra}]
- .t index @0,0
-} {151.60}
-test textDisp-16.17 {TkTextYviewCmd procedure, "moveto" option} failsOnUbuntu {
+ # target y position is inside line 151, which wraps 4 times
+ # exactly which display line depends on actual font size
+ set ytargetline [expr {150*$fixedHeight+5*$heightDiff}]
+ set expected 151.0
+ while {[expr {$ytargetline+$fixedHeight}] <= [expr {round(0.75*$totpix)}]} {
+ incr ytargetline $fixedHeight
+ set expected [.t index "$expected + 1 display line"]
+ }
+ lequal [.t index @0,0] $expected
+} {1}
+test textDisp-16.15 {TkTextYviewCmd procedure, "moveto" option} {
+ # y move to 3/4 of text widget content height plus just one line height minus one pixel
+ .t yview moveto .75
+ set pixtonextline [expr {-[bo] + [lindex [.t bbox @0,0] 1] + [lindex [.t bbox @0,0] 3]}]
+ .t yview moveto [expr {0.75 + ($pixtonextline-1)/double($totpix)}]
+ # target y position is inside line 151, which wraps 4 times
+ # exactly which display line depends on actual font size
+ set ytargetline [expr {150*$fixedHeight+5*$heightDiff}]
+ set expected 151.0
+ while {[expr {$ytargetline+$fixedHeight}] <= [expr {round(0.75*$totpix + ($pixtonextline-1))}]} {
+ incr ytargetline $fixedHeight
+ set expected [.t index "$expected + 1 display line"]
+ }
+ lequal [.t index @0,0] $expected
+} {1}
+test textDisp-16.16 {TkTextYviewCmd procedure, "moveto" option} {
+ # y move to 3/4 of text widget content height plus exactly one line height
+ .t yview moveto .75
+ set pixtonextline [expr {-[bo] + [lindex [.t bbox @0,0] 1] + [lindex [.t bbox @0,0] 3]}]
+ .t yview moveto [expr {0.75 + $pixtonextline/double($totpix)}]
+ # target y position is inside line 151, which wraps 4 times
+ # exactly which display line depends on actual font size
+ set ytargetline [expr {150*$fixedHeight+5*$heightDiff}]
+ set expected 151.0
+ while {[expr {$ytargetline+$fixedHeight}] <= [expr {round(0.75*$totpix + $pixtonextline)}]} {
+ incr ytargetline $fixedHeight
+ set expected [.t index "$expected + 1 display line"]
+ }
+ lequal [.t index @0,0] $expected
+} {1}
+test textDisp-16.17 {TkTextYviewCmd procedure, "moveto" option} {
.t yview moveto .755
.t index @0,0
} {151.80}
-test textDisp-16.18 {TkTextYviewCmd procedure, "moveto" roundoff} {textfonts} {
+test textDisp-16.18 {TkTextYviewCmd procedure, "moveto" roundoff} {
catch {destroy .top1}
toplevel .top1
wm geometry .top1 +0+0
text .top1.t -height 3 -width 4 -wrap none -setgrid 1 -padx 6 \
-spacing3 6
pack .top1.t
- updateText
+ update
.top1.t insert end "1\n2\n3\n4\n5\n6"
.top1.t yview moveto 0.3333
set result [.top1.t yview]
@@ -2132,7 +2335,7 @@ test textDisp-16.21.2 {TkTextYviewCmd procedure, "scroll" option} {
} {1 {expected integer but got "badInt"}}
test textDisp-16.22 {TkTextYviewCmd procedure, "scroll" option, back pages} {
.t yview 50.0
- updateText
+ update
.t yview scroll -1 pages
.t index @0,0
} {42.0}
@@ -2141,69 +2344,77 @@ test textDisp-16.22.1 {TkTextYviewCmd procedure, "scroll" option, back pages} {
} {1 {ambiguous argument "p": must be units, pages, or pixels}}
test textDisp-16.23 {TkTextYviewCmd procedure, "scroll" option, back pages} {
.t yview 50.0
- updateText
+ update
.t yview scroll -3 pa
.t index @0,0
} {26.0}
test textDisp-16.24 {TkTextYviewCmd procedure, "scroll" option, back pages} {
.t yview 5.0
- updateText
+ update
.t yview scroll -3 pa
.t index @0,0
} {1.0}
-test textDisp-16.25 {TkTextYviewCmd procedure, "scroll" option, back pages} {
+test textDisp-16.25 {TkTextYviewCmd procedure, "scroll" option, back pages} -setup {
+ # this frame is needed because some window managers don't allow the overall
+ # height of a window to get very narrow, triggering false test failure
+ frame .f2 -height 20
+ pack .f2 -side top
+} -body {
.t configure -height 1
- updateText
+ update
.t yview 50.0
- updateText
+ update
.t yview scroll -1 pages
set x [.t index @0,0]
.t configure -height 10
- updateText
+ update
set x
-} {49.0}
+} -cleanup {
+ destroy .f2
+} -result {49.0}
test textDisp-16.26 {TkTextYviewCmd procedure, "scroll" option, forward pages} {
.t yview 50.0
- updateText
+ update
.t yview scroll 1 pages
.t index @0,0
} {58.0}
test textDisp-16.27 {TkTextYviewCmd procedure, "scroll" option, forward pages} {
.t yview 50.0
- updateText
+ update
.t yview scroll 2 pages
.t index @0,0
} {66.0}
-test textDisp-16.28 {TkTextYviewCmd procedure, "scroll" option, forward pages} {textfonts} {
+test textDisp-16.28 {TkTextYviewCmd procedure, "scroll" option, forward pages} {
.t yview 98.0
- updateText
+ update
+ # The man page does not say it but the code does: scrolling 1 page actually uses the
+ # window height minus two lines, so that there's some overlap between adjacent pages.
+ # Note: it's a bit tricky but we only need to subtract one [bo] from [winfo height .t] here
+ # because the origin of @x,y coordinates is at borderwidth start, not at text area start.
+ set expected [.t index @0,[expr {[winfo height .t]-[bo]-2*$fixedHeight}]]
.t yview scroll 1 page
- set res [expr {int([.t index @0,0])}]
- if {$fixedDiff > 1} {
- incr res -1
- }
- set res
-} {102}
+ lequal [.t index @0,0] $expected
+} {1}
test textDisp-16.29 {TkTextYviewCmd procedure, "scroll" option, forward pages} {
.t configure -height 1
- updateText
+ update
.t yview 50.0
- updateText
+ update
.t yview scroll 1 pages
set x [.t index @0,0]
.t configure -height 10
- updateText
+ update
set x
} {51.0}
test textDisp-16.30 {TkTextYviewCmd procedure, "scroll units" option} {
.t yview 45.0
- updateText
+ update
.t yview scroll -3 units
.t index @0,0
} {42.0}
test textDisp-16.31 {TkTextYviewCmd procedure, "scroll units" option} {
.t yview 149.0
- updateText
+ update
.t yview scroll 4 units
.t index @0,0
} {151.40}
@@ -2264,7 +2475,7 @@ test textDisp-16.38 {TkTextYviewCmd procedure} {
test textDisp-16.39 {TkTextYviewCmd procedure} {
list [catch {.t yview scroll 1.3i pixels} msg] $msg
} {0 {}}
-test textDisp-16.40 {text count -xpixels} failsOnUbuntu {
+test textDisp-16.40 {text count -xpixels} {
set res {}
lappend res [.t count -xpixels 1.0 1.5] \
[.t count -xpixels 1.5 1.0] \
@@ -2273,7 +2484,7 @@ test textDisp-16.40 {text count -xpixels} failsOnUbuntu {
[.t count -xpixels 1.0 "1.0 lineend"] \
[.t count -xpixels 1.0 "1.0 displaylineend"] \
[.t count -xpixels 1.0 end]
-} {35 -35 0 42 42 42 0}
+} [list [expr {5*$fixedWidth}] [expr {-5*$fixedWidth}] 0 [expr {6*$fixedWidth}] [expr {6*$fixedWidth}] [expr {6*$fixedWidth}] 0]
test textDisp-16.41 {text count -xpixels with indices in elided lines} {
set res {}
.t delete 1.0 end
@@ -2308,7 +2519,7 @@ test textDisp-16.42 {TkTextYviewCmd procedure with indices in elided lines} {
.t tag configure hidden -elide true
.t yview 35.0
.t yview scroll [expr {- 15 * $fixedHeight}] pixels
- updateText
+ update
.t index @0,0
} {5.0}
test textDisp-16.43 {TkTextYviewCmd procedure with indices in elided lines} {
@@ -2322,7 +2533,7 @@ test textDisp-16.43 {TkTextYviewCmd procedure with indices in elided lines} {
.t tag configure hidden -elide true
.t yview 35.0
.t yview scroll -15 units
- updateText
+ update
.t index @0,0
} {5.0}
test textDisp-16.44 {TkTextYviewCmd procedure, scroll down, with elided lines} {
@@ -2333,9 +2544,9 @@ test textDisp-16.44 {TkTextYviewCmd procedure, scroll down, with elided lines} {
.t insert end "$x 1111\n$x 2222\n$x 3333\n$x 4444\n$x 5555\n$x 6666" hidden
}
.t tag configure hidden -elide true ; # 5 hidden lines
- updateText
+ update
.t see [expr {5 + [winfo height .t] / $fixedHeight + 1}].0
- updateText
+ update
.t index @0,0
} {2.0}
@@ -2360,74 +2571,97 @@ test textDisp-17.4 {TkTextScanCmd procedure} {
test textDisp-17.5 {TkTextScanCmd procedure} {
list [catch {.t scan stupid 123 456} msg] $msg
} {1 {bad scan option "stupid": must be mark or dragto}}
-test textDisp-17.6 {TkTextScanCmd procedure} {textfonts} {
+test textDisp-17.6 {TkTextScanCmd procedure} {
.t yview 1.0
.t xview moveto 0
- updateText
+ update
+ set expected [.t index @[expr {[bo]+50}],[expr {[bo]+50}]]
.t scan mark 40 60
.t scan dragto 35 55
- updateText
- .t index @0,0
-} {4.7}
-test textDisp-17.7 {TkTextScanCmd procedure} {textfonts} {
- .t yview 10.0
+ update
+ lequal [.t index @0,0] $expected
+} {1}
+test textDisp-17.7 {TkTextScanCmd procedure} {
+ # 1st result
+ .t yview 1.0
.t xview moveto 0
- updateText
+ update
+ set expected [.t index @[expr {[bo]+20*$fixedWidth-50}],[expr {[bo]+9*$fixedHeight-50}]]
+ .t yview 10.0
.t xview scroll 20 units
- updateText
+ update
.t scan mark -10 60
.t scan dragto -5 65
- updateText
- .t index @0,0
+ update
set x [.t index @0,0]
- .t scan dragto 0 [expr {70 + $fixedDiff}]
- updateText
- list $x [.t index @0,0]
-} {6.12 2.5}
-test textDisp-17.8 {TkTextScanCmd procedure} {textfonts} {
+ # 2nd result
+ .t yview 1.0
+ .t xview moveto 0
+ update
+ lappend expected [.t index @[expr {[bo]+20*$fixedWidth-50-50}],[expr {[bo]+9*$fixedHeight-50-70}]]
+ .t yview 10.0
+ .t xview scroll 20 units
+ update
+ .t scan mark -10 60
+ .t scan dragto -5 65
+ update
+ .t scan dragto 0 72
+ update
+ lequal [list $x [.t index @0,0]] $expected
+} {1}
+test textDisp-17.8 {TkTextScanCmd procedure} {
.t yview 1.0
.t xview moveto 0
- updateText
+ update
+ set expected [.t index @[expr {[bo]+50}],[expr {[bo]+50}]]
.t scan mark 0 60
.t scan dragto 30 100
- updateText
+ update
.t scan dragto 25 95
- updateText
- .t index @0,0
-} {4.7}
-test textDisp-17.9 {TkTextScanCmd procedure} {textfonts} {
+ update
+ lequal [.t index @0,0] $expected
+} {1}
+test textDisp-17.9 {TkTextScanCmd procedure} {
.t yview end
.t xview moveto 0
- updateText
+ update
+ # this brings us at lower right corner of the text
.t xview scroll 100 units
- updateText
+ update
+ # this does not trigger any scroll, we're already at the corner
.t scan mark 90 60
.t scan dragto 10 0
- updateText
+ update
+ set expected [.t index @[expr {[winfo width .t]-[bo]-40}],[expr {[winfo height .t]-[bo]-50}]]
+ set expected [.t index "$expected - [.t cget -height] lines - [.t cget -width] chars"]
.t scan dragto 14 5
- updateText
- .t index @0,0
-} {14.44}
+ update
+ lequal [.t index @0,0] $expected
+} {1}
.t configure -wrap word
-test textDisp-17.10 {TkTextScanCmd procedure, word wrapping} {textfonts} {
+test textDisp-17.10 {TkTextScanCmd procedure, word wrapping} {
.t yview 10.0
- updateText
+ update
+ set origin [.t index @0,0]
+ set expected [.t index "$origin - [expr {int(ceil(50.0/$fixedHeight))}] display lines"]
.t scan mark -10 60
.t scan dragto -5 65
- updateText
+ update
set x [.t index @0,0]
- .t scan dragto 0 [expr {70 + $fixedDiff}]
- updateText
- list $x [.t index @0,0]
-} {9.0 8.0}
+ lappend expected [.t index "$origin - [expr {int(ceil((50.0+70.0)/$fixedHeight))}] display lines"]
+ .t scan dragto 0 72
+ update
+ lequal [list $x [.t index @0,0]] $expected
+} {1}
.t configure -xscrollcommand scroll -yscrollcommand {}
+
test textDisp-18.1 {GetXView procedure} {
.t configure -wrap none
.t delete 1.0 end
.t insert end xxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx
- updateText
+ update
set scrollInfo
} [list 0.0 [expr {4.0/11}]]
test textDisp-18.2 {GetXView procedure} {
@@ -2436,13 +2670,13 @@ test textDisp-18.2 {GetXView procedure} {
.t insert end xxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx
- updateText
+ update
set scrollInfo
} {0.0 1.0}
test textDisp-18.3 {GetXView procedure} {
.t configure -wrap none
.t delete 1.0 end
- updateText
+ update
set scrollInfo
} {0.0 1.0}
test textDisp-18.4 {GetXView procedure} {
@@ -2451,7 +2685,7 @@ test textDisp-18.4 {GetXView procedure} {
.t insert end xxxxxxxxx\n
.t insert end xxxxxx\n
.t insert end xxxxxxxxxxxxxxxxx
- updateText
+ update
set scrollInfo
} {0.0 1.0}
test textDisp-18.5 {GetXView procedure} {
@@ -2461,7 +2695,7 @@ test textDisp-18.5 {GetXView procedure} {
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxx
.t xview scroll 31 units
- updateText
+ update
set scrollInfo
} [list [expr {31.0/55}] [expr {51.0/55}]]
test textDisp-18.6 {GetXView procedure} {
@@ -2472,27 +2706,27 @@ test textDisp-18.6 {GetXView procedure} {
.t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx"
.t xview moveto 0
.t xview scroll 31 units
- updateText
+ update
set x {}
lappend x $scrollInfo
.t configure -wrap char
- updateText
+ update
lappend x $scrollInfo
.t configure -wrap word
- updateText
+ update
lappend x $scrollInfo
.t configure -wrap none
- updateText
+ update
lappend x $scrollInfo
} [list [list [expr {31.0/56}] [expr {51.0/56}]] {0.0 1.0} {0.0 1.0} [list 0.0 [expr {5.0/14}]]]
test textDisp-18.7 {GetXView procedure} {
.t configure -wrap none
.t delete 1.0 end
- updateText
+ update
set scrollInfo unchanged
.t insert end xxxxxx\n
.t insert end xxx
- updateText
+ update
set scrollInfo
} {unchanged}
test textDisp-18.8 {GetXView procedure} {
@@ -2506,10 +2740,10 @@ test textDisp-18.8 {GetXView procedure} {
.t configure -wrap none
.t delete 1.0 end
.t insert end xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n
- updateText
+ update
.t delete 1.0 end
.t configure -xscrollcommand scrollError
- updateText
+ update
set x
} {{scrolling error} {scrolling error
while executing
@@ -2520,43 +2754,42 @@ test textDisp-18.8 {GetXView procedure} {
(horizontal scrolling command executed by text)}}
catch {rename bgerror {}}
catch {rename bogus {}}
-.t configure -xscrollcommand {} -yscrollcommand scroll
.t configure -xscrollcommand {} -yscrollcommand scroll
test textDisp-19.1 {GetYView procedure} {
.t configure -wrap char
.t delete 1.0 end
- updateText
+ update
set scrollInfo
} {0.0 1.0}
test textDisp-19.2 {GetYView procedure} {
.t configure -wrap char
.t delete 1.0 end
- updateText
+ update
set scrollInfo "unchanged"
.t insert 1.0 "Line1\nLine2"
- updateText
+ update
set scrollInfo
} {unchanged}
test textDisp-19.3 {GetYView procedure} {
.t configure -wrap char
.t delete 1.0 end
- updateText
+ update
set scrollInfo "unchanged"
.t insert 1.0 "Line 1\nLine 2 is so long that it wraps around\nLine 3"
- updateText
+ update
set scrollInfo
} {unchanged}
test textDisp-19.4 {GetYView procedure} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1"
- updateText
+ update
set scrollInfo "unchanged"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13} {
.t insert end "\nLine $i"
}
- updateText
+ update
set scrollInfo
} [list 0.0 [expr {70.0/91}]]
test textDisp-19.5 {GetYView procedure} {
@@ -2567,7 +2800,7 @@ test textDisp-19.5 {GetYView procedure} {
.t insert end "\nLine $i"
}
.t insert 2.end " is really quite long; in fact it's so long that it wraps three times"
- updateText
+ update
set x $scrollInfo
} {0.0 0.625}
test textDisp-19.6 {GetYView procedure} {
@@ -2579,7 +2812,7 @@ test textDisp-19.6 {GetYView procedure} {
}
.t insert 2.end " is really quite long; in fact it's so long that it wraps three times"
.t yview 4.0
- updateText
+ update
set x $scrollInfo
} {0.375 1.0}
test textDisp-19.7 {GetYView procedure} {
@@ -2591,10 +2824,10 @@ test textDisp-19.7 {GetYView procedure} {
}
.t insert 2.end " is really quite long; in fact it's so long that it wraps three times"
.t yview 2.26
- updateText
+ update
set x $scrollInfo
} {0.125 0.75}
-test textDisp-19.8 {GetYView procedure} failsOnUbuntu {
+test textDisp-19.8 {GetYView procedure} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1"
@@ -2603,7 +2836,7 @@ test textDisp-19.8 {GetYView procedure} failsOnUbuntu {
}
.t insert 10.end " is really quite long; in fact it's so long that it wraps three times"
.t yview 2.0
- updateText
+ update
.t count -update -ypixels 1.0 end
set x $scrollInfo
} {0.0625 0.6875}
@@ -2615,7 +2848,7 @@ test textDisp-19.9 {GetYView procedure} {
.t insert end "\nLine $i"
}
.t yview 3.0
- updateText
+ update
set scrollInfo
} [list [expr {4.0/30}] 0.8]
test textDisp-19.10 {GetYView procedure} {
@@ -2626,7 +2859,7 @@ test textDisp-19.10 {GetYView procedure} {
.t insert end "\nLine $i"
}
.t yview 11.0
- updateText
+ update
set scrollInfo
} [list [expr {1.0/3}] 1.0]
test textDisp-19.10.1 {Widget manipulation causes height miscount} {
@@ -2637,7 +2870,7 @@ test textDisp-19.10.1 {Widget manipulation causes height miscount} {
.t insert end "\nLine $i"
}
.t yview 11.0
- updateText
+ update
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "Line 1"
@@ -2647,7 +2880,7 @@ test textDisp-19.10.1 {Widget manipulation causes height miscount} {
.t insert end "\nThis last line wraps around four "
.t insert end "times with a little bit left on the last line."
.t yview insert
- updateText
+ update
.t count -update -ypixels 1.0 end
set scrollInfo
} {0.5 1.0}
@@ -2661,7 +2894,7 @@ test textDisp-19.11 {GetYView procedure} {
.t insert end "\nThis last line wraps around four "
.t insert end "times with a little bit left on the last line."
.t yview insert
- updateText
+ update
.t count -update -ypixels 1.0 end
set scrollInfo
} {0.5 1.0}
@@ -2799,13 +3032,13 @@ test textDisp-19.12 {GetYView procedure, partially visible last line} {
pack .top.t -expand yes -fill both
.top.t insert end "Line 1\nLine 2\nLine 3\nLine 4\nLine 5"
# Need to wait for asychronous calculations to complete.
- updateText
+ update
scan [wm geom .top] %dx%d twidth theight
wm geom .top ${twidth}x[expr {$theight - 3}]
- updateText
+ update
.top.t yview
} [list 0.0 [expr {(5.0 * $fixedHeight - 3.0)/ (5.0 * $fixedHeight)}]]
-test textDisp-19.13 {GetYView procedure, partially visible last line} {textfonts} {
+test textDisp-19.13 {GetYView procedure, partially visible last line} {
catch {destroy .top}
toplevel .top
wm geometry .top +0+0
@@ -2813,10 +3046,10 @@ test textDisp-19.13 {GetYView procedure, partially visible last line} {textfonts
pack .top.t -expand yes -fill both
.top.t insert end "Line 1\nLine 2\nLine 3\nLine 4 has enough text to wrap around at least once"
# Need to wait for asychronous calculations to complete.
- updateText
+ update
scan [wm geom .top] %dx%d twidth theight
wm geom .top ${twidth}x[expr {$theight - 3}]
- updateText
+ update
.top.t yview
} [list 0.0 [expr {(5.0 * $fixedHeight - 3.0)/ (5.0 * $fixedHeight)}]]
catch {destroy .top}
@@ -2830,14 +3063,14 @@ test textDisp-19.14 {GetYView procedure} {
.t insert end "\nThis last line wraps around four "
.t insert end "times with a little bit left on the last line."
# Need to update so everything is calculated.
- updateText
+ update
.t count -update -ypixels 1.0 end
- updateText
+ delay
set scrollInfo "unchanged"
.t mark set insert 3.0
.t tag configure x -background red
.t tag add x 1.0 5.0
- updateText
+ update
.t tag delete x
set scrollInfo
} {unchanged}
@@ -2850,14 +3083,14 @@ test textDisp-19.15 {GetYView procedure} {
}
.t insert end "\nThis last line wraps around four "
.t insert end "times with a bit little left on the last line."
- updateText
+ update
.t configure -yscrollcommand scrollError
proc bgerror args {
global x errorInfo errorCode
set x [list $args $errorInfo $errorCode]
}
.t delete 1.0 end
- updateText
+ update
rename bgerror {}
.t configure -yscrollcommand scroll
set x
@@ -2879,19 +3112,23 @@ test textDisp-19.16 {count -ypixels} {
.t insert end "\nThis last line wraps around four "
.t insert end "times with a little bit left on the last line."
# Need to update so everything is calculated.
- updateText
+ update
.t count -update -ypixels 1.0 end
- updateText
- set res {}
- lappend res \
+ update
+ set res [list \
[.t count -ypixels 1.0 end] \
[.t count -update -ypixels 1.0 end] \
[.t count -ypixels 15.0 16.0] \
[.t count -ypixels 15.0 "16.0 displaylineend +1c"] \
[.t count -ypixels 16.0 "16.0 displaylineend +1c"] \
- [.t count -ypixels "16.0 +1 displaylines" "16.0 +4 displaylines +3c"]
-} [list [expr {260 + 20 * $fixedDiff}] [expr {260 + 20 * $fixedDiff}] $fixedHeight [expr {2*$fixedHeight}] $fixedHeight [expr {3*$fixedHeight}]]
-test textDisp-19.17 {count -ypixels with indices in elided lines} {failsOnUbuntu failsOnXQuarz} {
+ [.t count -ypixels "16.0 +1 displaylines" "16.0 +4 displaylines +3c"] ]
+} [list [expr {20 * $fixedHeight}] \
+ [expr {20 * $fixedHeight}] \
+ $fixedHeight \
+ [expr {2*$fixedHeight}] \
+ $fixedHeight \
+ [expr {3*$fixedHeight}]]
+test textDisp-19.17 {count -ypixels with indices in elided lines} {
.t configure -wrap none
.t delete 1.0 end
for {set i 1} {$i < 100} {incr i} {
@@ -2900,9 +3137,10 @@ test textDisp-19.17 {count -ypixels with indices in elided lines} {failsOnUbuntu
}
.t tag add hidden 5.15 20.15
.t tag configure hidden -elide true
- set res {}
update
- lappend res \
+ .t count -update -ypixels 1.0 end
+ update
+ set res [list \
[.t count -ypixels 1.0 6.0] \
[.t count -ypixels 2.0 7.5] \
[.t count -ypixels 5.0 8.5] \
@@ -2914,11 +3152,18 @@ test textDisp-19.17 {count -ypixels with indices in elided lines} {failsOnUbuntu
[.t count -ypixels 5.0 25.0] \
[.t count -ypixels 25.0 5.0] \
[.t count -ypixels 25.4 27.50] \
- [.t count -ypixels 35.0 38.0]
+ [.t count -ypixels 35.0 38.0] ]
.t yview 35.0
lappend res [.t count -ypixels 5.0 25.0]
-} [list [expr {4 * $fixedHeight}] [expr {3 * $fixedHeight}] 0 0 0 0 0 0 [expr {5 * $fixedHeight}] [expr {- 5 * $fixedHeight}] [expr {2 * $fixedHeight}] [expr {3 * $fixedHeight}] [expr {5 * $fixedHeight}]]
-test textDisp-19.18 {count -ypixels with indices in elided lines} {failsOnUbuntu failsOnXQuarz} {
+} [list [expr {4 * $fixedHeight}] \
+ [expr {3 * $fixedHeight}] \
+ 0 0 0 0 0 0 \
+ [expr {5 * $fixedHeight}] \
+ [expr {- 5 * $fixedHeight}] \
+ [expr {2 * $fixedHeight}] \
+ [expr {3 * $fixedHeight}] \
+ [expr {5 * $fixedHeight}]]
+test textDisp-19.18 {count -ypixels with indices in elided lines} {
.t configure -wrap none
.t delete 1.0 end
for {set i 1} {$i < 100} {incr i} {
@@ -2928,11 +3173,12 @@ test textDisp-19.18 {count -ypixels with indices in elided lines} {failsOnUbuntu
.t tag add hidden 5.15 20.15
.t tag configure hidden -elide true
.t yview 35.0
- set res {}
update
- lappend res [.t count -ypixels 5.0 25.0]
+ .t count -update -ypixels 1.0 end
+ update
+ set res [.t count -ypixels 5.0 25.0]
.t yview scroll [expr {- 15 * $fixedHeight}] pixels
- updateText
+ update
lappend res [.t count -ypixels 5.0 25.0]
} [list [expr {5 * $fixedHeight}] [expr {5 * $fixedHeight}]]
test textDisp-19.19 {count -ypixels with indices in elided lines} {
@@ -2945,7 +3191,7 @@ test textDisp-19.19 {count -ypixels with indices in elided lines} {
.t tag add hidden 5.27 11.0
.t tag configure hidden -elide true
.t yview 5.0
- updateText
+ update
set res [list [.t count -ypixels 5.0 11.0] [.t count -ypixels 5.0 11.20]]
} [list [expr {1 * $fixedHeight}] [expr {2 * $fixedHeight}]]
.t delete 1.0 end
@@ -2956,52 +3202,69 @@ for {set i 2} {$i <= 200} {incr i} {
.t configure -wrap word
.t delete 50.0 51.0
.t insert 50.0 "This is a long line, one that will wrap around twice.\n"
-test textDisp-20.1 {FindDLine} failsOnUbuntu {
+test textDisp-20.1 {FindDLine} {
.t yview 48.0
list [.t dlineinfo 46.0] [.t dlineinfo 47.0] [.t dlineinfo 49.0] \
[.t dlineinfo 58.0]
-} [list {} {} [list 3 [expr {$fixedDiff + 16}] 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}]
-test textDisp-20.2 {FindDLine} failsOnUbuntu {
+} [list {} {} [list [bo] [yline 2] [xw 7] $fixedHeight $fixedAscent] {}]
+test textDisp-20.2 {FindDLine} {
.t yview 100.0
.t yview -pickplace 53.0
- list [.t dlineinfo 50.0] [.t dlineinfo 50.14] [.t dlineinfo 50.21]
-} [list [list 3 [expr {-1 - $fixedDiff/2}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {-1 - $fixedDiff/2}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {12 + $fixedDiff/2}] 133 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]]]
-test textDisp-20.3 {FindDLine} failsOnUbuntu {
+ set centlineY [lindex [.t bbox 53.0] 1]
+ set expectedY [expr {$centlineY - int(($centlineY-[bo])/$fixedHeight)*$fixedHeight - $fixedHeight}]
+ set expected [list [list [bo] $expectedY [xw 20] $fixedHeight $fixedAscent] \
+ [list [bo] $expectedY [xw 20] $fixedHeight $fixedAscent] \
+ [list [bo] [expr {$expectedY+$fixedHeight}] [xw 19] $fixedHeight $fixedAscent]]
+ set res [list [.t dlineinfo 50.0] [.t dlineinfo 50.14] [.t dlineinfo 50.21]]
+ lequal $res $expected
+} {1}
+test textDisp-20.3 {FindDLine} {
.t yview 100.0
.t yview 49.0
list [.t dlineinfo 50.0] [.t dlineinfo 50.24] [.t dlineinfo 57.0]
-} [list [list 3 [expr {$fixedDiff + 16}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {2*$fixedDiff + 29}] 133 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}]
-test textDisp-20.4 {FindDLine} failsOnUbuntu {
+} [list [list [bo] [yline 2] [xw 20] $fixedHeight $fixedAscent] \
+ [list [bo] [yline 3] [xw 19] $fixedHeight $fixedAscent] \
+ {}]
+test textDisp-20.4 {FindDLine} {
.t yview 100.0
.t yview 42.0
list [.t dlineinfo 50.0] [.t dlineinfo 50.24] [.t dlineinfo 50.40]
-} [list [list 3 [expr {8*$fixedDiff + 107}] 140 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {9*$fixedDiff + 120}] 133 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}]
+} [list [list [bo] [yline 9] [xw 20] $fixedHeight $fixedAscent] \
+ [list [bo] [yline 10] [xw 19] $fixedHeight $fixedAscent] \
+ {}]
.t config -wrap none
-test textDisp-20.5 {FindDLine} failsOnUbuntu {
+test textDisp-20.5 {FindDLine} {
.t yview 100.0
.t yview 48.0
list [.t dlineinfo 50.0] [.t dlineinfo 50.20] [.t dlineinfo 50.40]
-} [list [list 3 [expr {3+2*$fixedHeight}] 371 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {3+2*$fixedHeight}] 371 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {3+2*$fixedHeight}] 371 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]]]
+} [list [list [bo] [yline 3] [xw 53] $fixedHeight $fixedAscent] \
+ [list [bo] [yline 3] [xw 53] $fixedHeight $fixedAscent] \
+ [list [bo] [yline 3] [xw 53] $fixedHeight $fixedAscent]]
.t config -wrap word
-test textDisp-21.1 {TkTextPixelIndex} {textfonts} {
+test textDisp-21.1 {TkTextPixelIndex} {
.t yview 48.0
- list [.t index @-10,-10] [.t index @6,6] [.t index @22,6] \
- [.t index @102,6] [.t index @38,[expr {$fixedHeight * 4 + 3}]] [.t index @44,67]
-} {48.0 48.0 48.2 48.7 50.45 50.45}
+ set off [expr {[bo]+3}]
+ list [.t index @-10,-10] [.t index @$off,$off] [.t index @[expr {[xchar 2]+2}],$off] \
+ [.t index @[expr {[xchar 14]+1}],$off] [.t index @[xchar 5],[yline 5]]
+} {48.0 48.0 48.2 48.7 50.45}
.t insert end \n
-test textDisp-21.2 {TkTextPixelIndex} {textfonts} {
+test textDisp-21.2 {TkTextPixelIndex} {
.t yview 195.0
- list [.t index @11,[expr {$fixedHeight * 5 + 5}]] [.t index @11,[expr {$fixedHeight * 6 + 5}]] [.t index @11,[expr {$fixedHeight * 7 + 5}]] \
- [.t index @11,1002]
+ set off [expr {[xchar 1]+1}]
+ list [.t index @$off,[expr {[yline 6]+2}]] \
+ [.t index @$off,[expr {[yline 7]+2}]] \
+ [.t index @$off,[expr {[yline 8]+2}]] \
+ [.t index @$off,1002]
} {197.1 198.1 199.1 201.0}
-test textDisp-21.3 {TkTextPixelIndex, horizontal scrolling} {textfonts} {
+test textDisp-21.3 {TkTextPixelIndex, horizontal scrolling} {
.t configure -wrap none
.t delete 1.0 end
.t insert end "12345\n"
.t insert end "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
.t xview scroll 2 units
- list [.t index @-5,7] [.t index @5,7] [.t index @33,20]
+ set off [expr {[yline 1]+4}]
+ list [.t index @-5,$off] [.t index @[expr {[xchar 1]-2}],$off] [.t index @[expr {[xchar 4]+2}],[expr {[yline 2]+2}]]
} {1.2 1.2 2.6}
test textDisp-21.4 {count -displaylines regression} {
set message {
@@ -3037,59 +3300,84 @@ for {set i 2} {$i <= 200} {incr i} {
.t configure -wrap word
.t delete 50.0 51.0
.t insert 50.0 "This is a long line, one that will wrap around twice.\n"
-updateText
+update
.t tag add x 50.1
-test textDisp-22.1 {TkTextCharBbox} {textfonts} {
+test textDisp-22.1 {TkTextCharBbox} {
.t config -wrap word
.t yview 48.0
list [.t bbox 47.2] [.t bbox 48.0] [.t bbox 50.5] [.t bbox 50.40] \
[.t bbox 58.0]
-} [list {} [list 3 3 7 $fixedHeight] [list 38 [expr {3+2*$fixedHeight}] 7 $fixedHeight] [list 3 [expr {3+4*$fixedHeight}] 7 $fixedHeight] {}]
-test textDisp-22.2 {TkTextCharBbox} {textfonts} {
+} [list {} \
+ [list [xchar 0] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 5] [yline 3] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 5] $fixedWidth $fixedHeight] \
+ {}]
+test textDisp-22.2 {TkTextCharBbox} {
.t config -wrap none
.t yview 48.0
list [.t bbox 50.5] [.t bbox 50.40] [.t bbox 57.0]
-} [list [list 38 [expr {3+2*$fixedHeight}] 7 $fixedHeight] {} [list 3 [expr {3+9*$fixedHeight}] 7 $fixedHeight]]
-test textDisp-22.3 {TkTextCharBbox, cut-off lines} {textfonts} {
+} [list [list [xchar 5] [yline 3] $fixedWidth $fixedHeight] \
+ {} \
+ [list [xchar 0] [yline 10] $fixedWidth $fixedHeight]]
+test textDisp-22.3 {TkTextCharBbox, cut-off lines} {
+ wm geometry . {}
+ update
+ scan [wm geom .] %dx%d oriWidth oriHeight
.t config -wrap char
.t yview 10.0
wm geom . ${width}x[expr {$height-1}]
- updateText
- list [.t bbox 19.1] [.t bbox 20.1]
-} [list [list 10 [expr {3+9*$fixedHeight}] 7 $fixedHeight] [list 10 [expr {3+10*$fixedHeight}] 7 3]]
-test textDisp-22.4 {TkTextCharBbox, cut-off lines} {textfonts} {
+ update
+ set expected [list [list [xchar 1] [yline 10] $fixedWidth $fixedHeight] \
+ [list [xchar 1] [yline 11] $fixedWidth [expr {($height-1)-$oriHeight}]]]
+ lequal [list [.t bbox 19.1] [.t bbox 20.1]] $expected
+} {1}
+test textDisp-22.4 {TkTextCharBbox, cut-off lines} {
+ wm geometry . {}
+ update
+ scan [wm geom .] %dx%d oriWidth oriHeight
.t config -wrap char
.t yview 10.0
wm geom . ${width}x[expr {$height+1}]
- updateText
- list [.t bbox 19.1] [.t bbox 20.1]
-} [list [list 10 [expr {3+9*$fixedHeight}] 7 $fixedHeight] [list 10 [expr {3+10*$fixedHeight}] 7 5]]
-test textDisp-22.5 {TkTextCharBbox, cut-off char} {textfonts} {
+ update
+ set expected [list [list [xchar 1] [yline 10] $fixedWidth $fixedHeight] \
+ [list [xchar 1] [yline 11] $fixedWidth [expr {($height+1)-$oriHeight}]]]
+ lequal [list [.t bbox 19.1] [.t bbox 20.1]] $expected
+} {1}
+test textDisp-22.5 {TkTextCharBbox, cut-off char} {
+ wm geometry . {}
+ update
.t config -wrap none
.t yview 10.0
- wm geom . [expr {$width-95}]x$height
- updateText
+ wm geom . [expr {$width-(20-7)*$fixedWidth}]x$height
+ update
.t bbox 15.6
-} [list 45 [expr {3+5*$fixedHeight}] 7 $fixedHeight]
-test textDisp-22.6 {TkTextCharBbox, line visible but not char} {textfonts} {
+} [list [xchar 6] [yline 6] $fixedWidth $fixedHeight]
+test textDisp-22.6 {TkTextCharBbox, line visible but not char} {
+ wm geometry . {}
+ update
+ scan [wm geom .] %dx%d oriWidth oriHeight
.t config -wrap char
.t yview 10.0
.t tag add big 20.2 20.5
wm geom . ${width}x[expr {$height+3}]
- updateText
- list [.t bbox 19.1] [.t bbox 20.1] [.t bbox 20.2]
-} [list [list 10 [expr {3+9*$fixedHeight}] 7 $fixedHeight] {} [list 17 [expr {3+10*$fixedHeight}] 14 7]]
+ update
+ set expected [list [list [xchar 1] [yline 10] $fixedWidth $fixedHeight] \
+ {} \
+ [list [xchar 2] [yline 11] [font measure $bigFont "n"] [expr {($height+3)-$oriHeight}]]]
+ lequal [list [.t bbox 19.1] [.t bbox 20.1] [.t bbox 20.2]] $expected
+} {1}
wm geom . {}
-updateText
-test textDisp-22.7 {TkTextCharBbox, different character sizes} {textfonts} {
+update
+test textDisp-22.7 {TkTextCharBbox, different character sizes} {
.t config -wrap char
.t yview 10.0
.t tag add big 12.2 12.5
- updateText
+ update
list [.t bbox 12.1] [.t bbox 12.2]
-} [list [list 10 [expr {3 + 2*$fixedHeight + $ascentDiff}] 7 $fixedHeight] [list 17 [expr {3+ 2*$fixedHeight}] 14 27]]
+} [list [list [xchar 1] [expr {[yline 3]+$ascentDiff}] $fixedWidth $fixedHeight] \
+ [list [xchar 2] [yline 3] [font measure $bigFont "n"] $bigHeight]]
.t tag remove big 1.0 end
-test textDisp-22.8 {TkTextCharBbox, horizontal scrolling} {textfonts} {
+test textDisp-22.8 {TkTextCharBbox, horizontal scrolling} {
.t configure -wrap none
.t delete 1.0 end
.t insert end "12345\n"
@@ -3097,8 +3385,13 @@ test textDisp-22.8 {TkTextCharBbox, horizontal scrolling} {textfonts} {
.t xview scroll 4 units
list [.t bbox 1.3] [.t bbox 1.4] [.t bbox 2.3] [.t bbox 2.4] \
[.t bbox 2.23] [.t bbox 2.24]
-} [list {} [list 3 3 7 $fixedHeight] {} [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 136 [expr {$fixedDiff + 16}] 7 $fixedHeight] {}]
-test textDisp-22.9 {TkTextCharBbox, handling of spacing} {textfonts} {
+} [list {} \
+ [list [xchar 0] [yline 1] $fixedWidth $fixedHeight] \
+ {} \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
+ [list [xchar 19] [yline 2] $fixedWidth $fixedHeight] \
+ {}]
+test textDisp-22.9 {TkTextCharBbox, handling of spacing} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "abcdefghijkl\nmnopqrstuvwzyz"
@@ -3112,12 +3405,17 @@ test textDisp-22.9 {TkTextCharBbox, handling of spacing} {textfonts} {
.t window create 1.7 -window .t.f2 -align center
.t window create 2.1 -window .t.f3 -align bottom
.t window create 2.10 -window .t.f4 -align baseline
- updateText
+ update
list [.t bbox .t.f1] [.t bbox .t.f2] [.t bbox .t.f3] [.t bbox .t.f4] \
[.t bbox 1.1] [.t bbox 2.9]
-} [list [list 24 11 10 4] [list 55 [expr {$fixedDiff/2 + 15}] 10 4] [list 10 [expr {2*$fixedDiff + 43}] 10 4] [list 76 [expr {2*$fixedDiff + 40}] 10 4] [list 10 11 7 $fixedHeight] [list 69 [expr {$fixedDiff + 34}] 7 $fixedHeight]]
+} [list [list [xchar 3] [expr {[yline 1]+8}] 10 4] \
+ [list [expr {[xchar 3]+10+[xw 3]}] [expr {[yline 1]+8+($fixedHeight-4)/2}] 10 4] \
+ [list [xchar 1] [expr {[yline 2]+8+2+8+($fixedHeight-4)}] 10 4] \
+ [list [expr {[xchar 1]+10+[xw 8]}] [expr {[yline 2]+8+2+8+($fixedAscent-4)}] 10 4] \
+ [list [xchar 1] [expr {[yline 1]+8}] $fixedWidth $fixedHeight] \
+ [list [expr {[xchar 1]+10+[xw 7]}] [expr {[yline 2]+8+2+8}] $fixedWidth $fixedHeight]]
.t tag delete spacing
-test textDisp-22.10 {TkTextCharBbox, handling of elided lines} {textfonts} {
+test textDisp-22.10 {TkTextCharBbox, handling of elided lines} {
.t configure -wrap char
.t delete 1.0 end
for {set i 1} {$i < 10} {incr i} {
@@ -3126,7 +3424,7 @@ test textDisp-22.10 {TkTextCharBbox, handling of elided lines} {textfonts} {
.t tag add hidden 2.8 2.13
.t tag add hidden 6.8 7.13
.t tag configure hidden -elide true
- updateText
+ update
list \
[expr {[lindex [.t bbox 2.9] 0] - [lindex [.t bbox 2.8] 0]}] \
[expr {[lindex [.t bbox 2.10] 0] - [lindex [.t bbox 2.8] 0]}] \
@@ -3140,7 +3438,7 @@ test textDisp-22.10 {TkTextCharBbox, handling of elided lines} {textfonts} {
[expr {[lindex [.t bbox 7.1] 0] - [lindex [.t bbox 6.8] 0]}] \
[expr {[lindex [.t bbox 7.12] 0] - [lindex [.t bbox 6.8] 0]}]
} [list 0 0 0 0 0 0 0 0 0 0 0]
-test textDisp-22.11 {TkTextCharBbox, handling of wrapped elided lines} {textfonts} {
+test textDisp-22.11 {TkTextCharBbox, handling of wrapped elided lines} {
.t configure -wrap char
.t delete 1.0 end
for {set i 1} {$i < 10} {incr i} {
@@ -3148,7 +3446,7 @@ test textDisp-22.11 {TkTextCharBbox, handling of wrapped elided lines} {textfont
}
.t tag add hidden 1.30 2.5
.t tag configure hidden -elide true
- updateText
+ update
list \
[expr {[lindex [.t bbox 1.30] 0] - [lindex [.t bbox 2.4] 0]}] \
[expr {[lindex [.t bbox 1.30] 0] - [lindex [.t bbox 2.5] 0]}]
@@ -3162,54 +3460,71 @@ for {set i 2} {$i <= 200} {incr i} {
.t configure -wrap word
.t delete 50.0 51.0
.t insert 50.0 "This is a long line, one that will wrap around twice.\n"
-updateText
-test textDisp-23.1 {TkTextDLineInfo} {textfonts} {
+update
+test textDisp-23.1 {TkTextDLineInfo} {
.t config -wrap word
.t yview 48.0
list [.t dlineinfo 47.3] [.t dlineinfo 48.0] [.t dlineinfo 50.40] \
[.t dlineinfo 56.0]
-} [list {} [list 3 3 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {4*$fixedDiff + 55}] 91 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] {}]
-test textDisp-23.2 {TkTextDLineInfo} {textfonts} {
- .t config -bd 4 -wrap word
- updateText
+} [list {} \
+ [list [bo] [yline 1] [xw 7] $fixedHeight $fixedAscent] \
+ [list [bo] [yline 5] [xw 13] $fixedHeight $fixedAscent] \
+ {}]
+.t config -bd 4
+test textDisp-23.2 {TkTextDLineInfo} {
+ .t config -wrap word
+ update
.t yview 48.0
.t dlineinfo 50.40
-} [list 7 [expr {4*$fixedDiff + 59}] 91 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]]
+} [list [bo] [yline 5] [xw 13] $fixedHeight $fixedAscent]
.t config -bd 0
-test textDisp-23.3 {TkTextDLineInfo} {textfonts} {
+test textDisp-23.3 {TkTextDLineInfo} {
.t config -wrap none
- updateText
+ update
.t yview 48.0
list [.t dlineinfo 50.40] [.t dlineinfo 57.3]
-} [list [list 3 [expr {2*$fixedDiff + 29}] 371 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {9*$fixedDiff + 120}] 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]]]
-test textDisp-23.4 {TkTextDLineInfo, cut-off lines} {textfonts} {
+} [list [list [bo] [yline 3] [xw 53] $fixedHeight $fixedAscent] \
+ [list [bo] [yline 10] [xw 7] $fixedHeight $fixedAscent]]
+test textDisp-23.4 {TkTextDLineInfo, cut-off lines} {
+ wm geometry . {}
+ update
+ scan [wm geom .] %dx%d oriWidth oriHeight
.t config -wrap char
.t yview 10.0
wm geom . ${width}x[expr {$height-1}]
- updateText
- list [.t dlineinfo 19.0] [.t dlineinfo 20.0]
-} [list [list 3 [expr {9*$fixedDiff + 120}] 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {10*$fixedDiff + 133}] 49 3 [expr {$fixedDiff + 10}]]]
-test textDisp-23.5 {TkTextDLineInfo, cut-off lines} {textfonts} {
+ update
+ set expected [list [list [bo] [yline 10] [xw 7] $fixedHeight $fixedAscent] \
+ [list [bo] [yline 11] [xw 7] [expr {($height-1)-$oriHeight}] $fixedAscent]]
+ lequal [list [.t dlineinfo 19.0] [.t dlineinfo 20.0]] $expected
+} {1}
+test textDisp-23.5 {TkTextDLineInfo, cut-off lines} {
+ wm geometry . {}
+ update
+ scan [wm geom .] %dx%d oriWidth oriHeight
.t config -wrap char
.t yview 10.0
wm geom . ${width}x[expr {$height+1}]
- updateText
- list [.t dlineinfo 19.0] [.t dlineinfo 20.0]
-} [list [list 3 [expr {9*$fixedDiff + 120}] 49 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {10*$fixedDiff + 133}] 49 5 [expr {$fixedDiff + 10}]]]
+ update
+ set expected [list [list [bo] [yline 10] [xw 7] $fixedHeight $fixedAscent] \
+ [list [bo] [yline 11] [xw 7] [expr {($height+1)-$oriHeight}] $fixedAscent]]
+ lequal [list [.t dlineinfo 19.0] [.t dlineinfo 20.0]] $expected
+} {1}
wm geom . {}
-updateText
-test textDisp-23.6 {TkTextDLineInfo, horizontal scrolling} {textfonts} {
+update
+test textDisp-23.6 {TkTextDLineInfo, horizontal scrolling} {
.t config -wrap none
.t delete 1.0 end
.t insert end "First line\n"
.t insert end "Second line is a very long one that doesn't all fit.\n"
.t insert end "Third"
.t xview scroll 6 units
- updateText
+ update
list [.t dlineinfo 1.0] [.t dlineinfo 2.0] [.t dlineinfo 3.0]
-} [list [list -39 3 70 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list -39 [expr {$fixedDiff + 16}] 364 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list -39 [expr {2*$fixedDiff + 29}] 35 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]]]
+} [list [list [expr {[xw -6]+[bo]}] [yline 1] [xw 10] $fixedHeight $fixedAscent] \
+ [list [expr {[xw -6]+[bo]}] [yline 2] [xw 52] $fixedHeight $fixedAscent] \
+ [list [expr {[xw -6]+[bo]}] [yline 3] [xw 5] $fixedHeight $fixedAscent]]
.t xview moveto 0
-test textDisp-23.7 {TkTextDLineInfo, centering} {textfonts} {
+test textDisp-23.7 {TkTextDLineInfo, centering} {
.t config -wrap word
.t delete 1.0 end
.t insert end "First line\n"
@@ -3220,169 +3535,248 @@ test textDisp-23.7 {TkTextDLineInfo, centering} {textfonts} {
.t tag add x 1.0
.t tag add y 3.0
list [.t dlineinfo 1.0] [.t dlineinfo 2.0] [.t dlineinfo 3.0]
-} [list [list 38 3 70 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 3 [expr {$fixedDiff + 16}] 119 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 108 [expr {4*$fixedDiff + 55}] 35 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]]]
+} [list [list [expr {[bo]+[xe 10]/2}] [yline 1] [xw 10] $fixedHeight $fixedAscent] \
+ [list [bo] [yline 2] [xw 17] $fixedHeight $fixedAscent] \
+ [list [xcharr 5] [yline 5] [xw 5] $fixedHeight $fixedAscent]]
.t tag delete x y
-test textDisp-24.1 {TkTextCharLayoutProc} {textfonts} {
+test textDisp-24.1 {TkTextCharLayoutProc} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "abcdefghijklmnopqrstuvwxyz"
list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 136 3 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-24.2 {TkTextCharLayoutProc} {textfonts} {
+} [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-24.2 {TkTextCharLayoutProc} {
+ wm geometry . {}
+ update
+ scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "abcdefghijklmnopqrstuvwxyz"
- wm geom . [expr {$width+1}]x$height
- updateText
- list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 136 3 12 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-24.3 {TkTextCharLayoutProc} {textfonts} {
+ # be tolerant about borderwidth et al. - don't let another char fit on the line
+ set wi $width
+ while {$wi+1-$oriWidth >= $fixedWidth} {
+ incr wi -$fixedWidth
+ }
+ wm geom . [expr {$wi+1}]x$height
+ update
+ set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($wi+1-$oriWidth)}] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+ lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
+} {1}
+test textDisp-24.3 {TkTextCharLayoutProc} {
+ wm geometry . {}
+ update
+ scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "abcdefghijklmnopqrstuvwxyz"
wm geom . [expr {$width-1}]x$height
- updateText
- list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 136 3 10 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-24.4 {TkTextCharLayoutProc, newline not visible} {textfonts} {
+ update
+ set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-1-$oriWidth)}] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+ lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
+} {1}
+test textDisp-24.4 {TkTextCharLayoutProc, newline not visible} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 01234567890123456789\n012345678901234567890
wm geom . {}
- updateText
+ update
list [.t bbox 1.19] [.t bbox 1.20] [.t bbox 2.20]
-} [list [list 136 3 7 $fixedHeight] [list 143 3 0 $fixedHeight] [list 3 [expr {2*$fixedDiff + 29}] 7 $fixedHeight]]
-test textDisp-24.5 {TkTextCharLayoutProc, char doesn't fit, newline not visible} {unix textfonts} {
+} [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 20] [yline 1] 0 $fixedHeight] \
+ [list [xchar 0] [yline 3] $fixedWidth $fixedHeight]]
+test textDisp-24.5 {TkTextCharLayoutProc, char doesn't fit, newline not visible} {nonwin} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 0\n1\n
- wm geom . 110x$height
- updateText
+ # set text widget width to 1-char width minus [bo] pixels
+ # note: windows refuses to shrink enough therefore the constraint
+ set wi [expr {[winfo width .f]+[bo]+[xw 1]}]
+ wm geom . ${wi}x$height
+ update
list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 2.0]
-} [list [list 3 3 4 $fixedHeight] [list 7 3 0 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 4 $fixedHeight]]
-test textDisp-24.6 {TkTextCharLayoutProc, line ends with space} {textfonts} {
+} [list [list [xchar 0] [yline 1] [expr {$fixedWidth-[bo]}] $fixedHeight] \
+ [list [expr {[xchar 1]-[bo]}] [yline 1] 0 $fixedHeight] \
+ [list [xchar 0] [yline 2] [expr {$fixedWidth-[bo]}] $fixedHeight]]
+test textDisp-24.6 {TkTextCharLayoutProc, line ends with space} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "a b c d e f g h i j k l m n o p"
wm geom . {}
- updateText
+ update
list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 136 3 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-24.7 {TkTextCharLayoutProc, line ends with space} {textfonts} {
+} [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-24.7 {TkTextCharLayoutProc, line ends with space} {
+ wm geometry . {}
+ update
+ scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "a b c d e f g h i j k l m n o p"
- wm geom . [expr {$width+1}]x$height
- updateText
- list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 136 3 12 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-24.8 {TkTextCharLayoutProc, line ends with space} {textfonts} {
+ # be tolerant about borderwidth et al. - don't let another char fit on the line
+ set wi $width
+ while {$wi+1-$oriWidth >= $fixedWidth} {
+ incr wi -$fixedWidth
+ }
+ wm geom . [expr {$wi+1}]x$height
+ update
+ set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($wi+1-$oriWidth)}] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+ lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
+} {1}
+test textDisp-24.8 {TkTextCharLayoutProc, line ends with space} {
+ wm geometry . {}
+ update
+ scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "a b c d e f g h i j k l m n o p"
wm geom . [expr {$width-1}]x$height
- updateText
- list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 136 3 10 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-24.9 {TkTextCharLayoutProc, line ends with space} {textfonts} {
+ update
+ set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-1-$oriWidth)}] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+ lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
+} {1}
+test textDisp-24.9 {TkTextCharLayoutProc, line ends with space} {
+ wm geometry . {}
+ update
+ scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "a b c d e f g h i j k l m n o p"
wm geom . [expr {$width-6}]x$height
- updateText
- list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 136 3 5 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-24.10 {TkTextCharLayoutProc, line ends with space} {textfonts} {
+ update
+ set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-6-$oriWidth)}] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+ lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
+} {1}
+test textDisp-24.10 {TkTextCharLayoutProc, line ends with space} {
+ wm geometry . {}
+ update
+ scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "a b c d e f g h i j k l m n o p"
wm geom . [expr {$width-7}]x$height
- updateText
- list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 136 3 4 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-24.11 {TkTextCharLayoutProc, line ends with space that doesn't quite fit} {textfonts} {
+ update
+ set expected [list [list [xchar 19] [yline 1] [expr {$fixedWidth+($width-7-$oriWidth)}] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+ lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
+} {1}
+test textDisp-24.11 {TkTextCharLayoutProc, line ends with space that doesn't quite fit} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "01234567890123456789 \nabcdefg"
- wm geom . [expr {$width-2}]x$height
- updateText
- set result {}
- lappend result [.t bbox 1.21] [.t bbox 2.0]
+ # set text widget width to 2 pixels more than 20-char width
+ set wi [expr {[winfo width .f]+2*[bo]+[xw 20]+2}]
+ wm geom . ${wi}x$height
+ update
+ set result [list [.t bbox 1.21] [.t bbox 2.0]]
.t mark set insert 1.21
lappend result [.t bbox 1.21] [.t bbox 2.0]
-} [list [list 145 3 0 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 145 3 0 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-24.12 {TkTextCharLayoutProc, tab causes wrap} {textfonts} {
+} [list [list [expr {[xchar 20]+2}] [yline 1] 0 $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
+ [list [expr {[xchar 20]+2}] [yline 1] 0 $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+wm geom . {}
+update
+test textDisp-24.12 {TkTextCharLayoutProc, tab causes wrap} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "abcdefghi"
.t mark set insert 1.4
.t insert insert \t\t\t
- list [.t bbox {insert -1c}] [.t bbox insert]
-} [list [list 115 3 30 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-24.13 {TkTextCharLayoutProc, -wrap none} {textfonts} {
+ set expected [list [list [expr {[xchar 0]+2*8*$fixedWidth}] [yline 1] [expr {[winfo width .t]-([xchar 0]+2*8*$fixedWidth)-[bo]}] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+ lequal [list [.t bbox {insert -1c}] [.t bbox insert]] $expected
+} {1}
+test textDisp-24.13 {TkTextCharLayoutProc, -wrap none} {
.t configure -wrap none
.t delete 1.0 end
.t insert 1.0 "abcdefghijklmnopqrstuvwxyz"
wm geom . {}
- updateText
+ update
list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 136 3 7 $fixedHeight] {}]
-test textDisp-24.14 {TkTextCharLayoutProc, -wrap none} {textfonts} {
+} [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] {}]
+test textDisp-24.14 {TkTextCharLayoutProc, -wrap none} {
+ wm geometry . {}
+ update
+ scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap none
.t delete 1.0 end
.t insert 1.0 "abcdefghijklmnopqrstuvwxyz"
wm geom . [expr {$width+1}]x$height
- updateText
- list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 136 3 7 $fixedHeight] [list 143 3 5 $fixedHeight]]
-test textDisp-24.15 {TkTextCharLayoutProc, -wrap none} {textfonts} {
+ update
+ set expected [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 20] [yline 1] [expr {$width+1-$oriWidth}] $fixedHeight]]
+ lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
+} {1}
+test textDisp-24.15 {TkTextCharLayoutProc, -wrap none} {
+ wm geometry . {}
+ update
+ scan [wm geom .] %dx%d oriWidth oriHeight
.t configure -wrap none
.t delete 1.0 end
.t insert 1.0 "abcdefghijklmnopqrstuvwxyz"
wm geom . [expr {$width-1}]x$height
- updateText
- list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 136 3 7 $fixedHeight] [list 143 3 3 $fixedHeight]]
-test textDisp-24.16 {TkTextCharLayoutProc, no chars fit} {textfonts} {
- if {[tk windowingsystem] == "win32"} {
+ update
+ set expected [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 20] [yline 1] [expr {$width-1-$oriWidth}] $fixedHeight]]
+ lequal [list [.t bbox 1.19] [.t bbox 1.20]] $expected
+} {1}
+test textDisp-24.16 {TkTextCharLayoutProc, no chars fit} {
+ if {[tk windowingsystem] eq "win32"} {
wm overrideredirect . 1
}
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "abcdefghijklmnopqrstuvwxyz"
- wm geom . 103x$height
- updateText
+ # set text widget width to [bo] pixels (no chars fit in the widget at all)
+ set wi [expr {[winfo width .f]+[bo]}]
+ wm geom . ${wi}x$height
+ update
list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 1.2]
-} [list [list 3 3 1 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 1 $fixedHeight] [list 3 [expr {2*$fixedDiff + 29}] 1 $fixedHeight]]
-if {[tk windowingsystem] == "win32"} {
+} [list [list [xchar 0] [yline 1] 1 $fixedHeight] \
+ [list [xchar 0] [yline 2] 1 $fixedHeight] \
+ [list [xchar 0] [yline 3] 1 $fixedHeight]]
+if {[tk windowingsystem] eq "win32"} {
wm overrideredirect . 0
}
-test textDisp-24.17 {TkTextCharLayoutProc, -wrap word} {textfonts} {
+test textDisp-24.17 {TkTextCharLayoutProc, -wrap word} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "This is a line that wraps around"
wm geom . {}
- updateText
+ update
list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 136 3 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-24.18 {TkTextCharLayoutProc, -wrap word} {textfonts} {
+} [list [list [xchar 19] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-24.18 {TkTextCharLayoutProc, -wrap word} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "xxThis is a line that wraps around"
wm geom . {}
- updateText
- list [.t bbox 1.15] [.t bbox 1.16] [.t bbox 1.17]
-} [list [list 108 3 7 $fixedHeight] [list 115 3 28 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 7 $fixedHeight]]
-test textDisp-24.19 {TkTextCharLayoutProc, -wrap word} {textfonts} {
+ update
+ list [.t bbox 1.15] [.t bbox 1.16] [.t bbox 1.17] [.t bbox 1.21]
+} [list [list [xchar 15] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 16] [yline 1] [xe 16] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight] \
+ [list [xchar 4] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-24.19 {TkTextCharLayoutProc, -wrap word} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "xxThis is a line that wraps around"
wm geom . {}
- updateText
+ update
list [.t bbox 1.14] [.t bbox 1.15] [.t bbox 1.16]
-} [list [list 101 3 7 $fixedHeight] [list 108 3 7 $fixedHeight] [list 115 3 28 $fixedHeight]]
-test textDisp-24.20 {TkTextCharLayoutProc, vertical offset} {textfonts} {
+} [list [list [xchar 14] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 15] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 16] [yline 1] [xe 16] $fixedHeight]]
+test textDisp-24.20 {TkTextCharLayoutProc, vertical offset} {
.t configure -wrap none
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2\nLine 3"
@@ -3391,80 +3785,96 @@ test textDisp-24.20 {TkTextCharLayoutProc, vertical offset} {textfonts} {
.t tag configure up -offset 6
.t tag add up 2.1
lappend result [.t bbox 2.1] [.t dlineinfo 2.1]
- .t tag configure up -offset -2
+ .t tag configure up -offset -2
lappend result [.t bbox 2.1] [.t dlineinfo 2.1]
.t tag delete up
set result
-} [list [list 10 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 42 [expr {$fixedDiff + 13}] [expr {$fixedDiff + 10}]] [list 10 [expr {$fixedDiff + 16}] 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 42 [expr {$fixedDiff + 19}] [expr {$fixedDiff + 16}]] [list 10 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 42 [expr {$fixedDiff + 15}] [expr {$fixedDiff + 10}]]]
+} [list [list [xchar 1] [yline 2] $fixedWidth $fixedHeight] \
+ [list [bo] [yline 2] [xw 6] $fixedHeight $fixedAscent] \
+ [list [xchar 1] [yline 2] $fixedWidth $fixedHeight] \
+ [list [bo] [yline 2] [xw 6] [expr {$fixedHeight+6}] [expr {$fixedAscent+6}]] \
+ [list [xchar 1] [expr {[yline 2]+2}] $fixedWidth $fixedHeight] \
+ [list [bo] [yline 2] [xw 6] [expr {$fixedHeight+2}] $fixedAscent]]
.t configure -width 30
-updateText
-test textDisp-24.21 {TkTextCharLayoutProc, word breaks} {textfonts} {
+update
+test textDisp-24.21 {TkTextCharLayoutProc, word breaks} {
.t configure -wrap word
.t delete 1.0 end
.t insert 1.0 "Sample text xxxxxxx yyyyy zzzzzzz qqqqq rrrr ssss tt u vvvvv"
frame .t.f -width 30 -height 20 -bg black
.t window create 1.36 -window .t.f
.t bbox 1.26
-} [list 3 [expr {$fixedDiff/2 + 19}] 7 $fixedHeight]
-test textDisp-24.22 {TkTextCharLayoutProc, word breaks} {textfonts} {
+} [list [xchar 0] [expr {[yline 2]+(20-$fixedHeight)/2}] $fixedWidth $fixedHeight]
+test textDisp-24.22 {TkTextCharLayoutProc, word breaks} {
.t configure -wrap word
.t delete 1.0 end
frame .t.f -width 30 -height 20 -bg black
.t insert 1.0 "Sample text xxxxxxx yyyyyyy"
.t window create end -window .t.f
.t insert end "zzzzzzz qqqqq rrrr ssss tt u vvvvv"
- .t bbox 1.28
-} [list 33 [expr {$fixedDiff/2 + 19}] 7 $fixedHeight]
-test textDisp-24.23 {TkTextCharLayoutProc, word breaks} {textfonts} {
+ .t bbox 1.28
+} [list [expr {[bo]+30}] [expr {[yline 2]+(20-$fixedHeight)/2}] $fixedWidth $fixedHeight]
+test textDisp-24.23 {TkTextCharLayoutProc, word breaks} {
.t configure -wrap word
.t delete 1.0 end
- frame .t.f -width 30 -height 20 -bg black
+ frame .t.f -width 50 -height 20 -bg black
.t insert 1.0 "Sample text xxxxxxx yyyyyyy "
.t insert end "zzzzzzz qqqqq rrrr ssss tt"
.t window create end -window .t.f
.t insert end "u vvvvv"
.t bbox .t.f
-} [list 3 [expr {2*$fixedDiff + 29}] 30 20]
+} [list [xchar 0] [yline 3] 50 20]
catch {destroy .t.f}
.t configure -width 20
-updateText
-test textDisp-24.24 {TkTextCharLayoutProc, justification and tabs} {textfonts} {
+update
+# Next test is currently constrained to not run on mac (aqua) because on
+# aqua it fails due to wrong implementation of tabs with right justification
+# (the text is not rendered at all). This is a bug.
+test textDisp-24.24 {TkTextCharLayoutProc, justification and tabs} notAqua {
.t delete 1.0 end
.t tag configure x -justify center
.t insert 1.0 aa\tbb\tcc\tdd\t
.t tag add x 1.0 end
list [.t bbox 1.0] [.t bbox 1.10]
-} [list [list 45 3 7 $fixedHeight] [list 94 3 7 $fixedHeight]]
-test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -constraints {textfonts failsOnXQuarz} -setup {
+} [list [list [expr {[bo]+[xe 8]/2}] [yline 1] $fixedWidth $fixedHeight] \
+ [list [expr {[bo]+[xe 8]/2+[xw 7]}] [yline 1] $fixedWidth $fixedHeight]]
+test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -setup {
text .tt -tabs {40 right} -wrap none -font $fixedFont
pack .tt
} -body {
.tt insert end \t9\n\t99\n\t999
- updateText
- list [.tt bbox 1.1] [.tt bbox 2.2] [.tt bbox 3.3]
+ update
+ set expected [list [list [expr {[bo .tt]+40-$fixedWidth}] [yline 1 .tt] $fixedWidth $fixedHeight] \
+ [list [expr {[bo .tt]+40-$fixedWidth}] [yline 2 .tt] $fixedWidth $fixedHeight] \
+ [list [expr {[bo .tt]+40-$fixedWidth}] [yline 3 .tt] $fixedWidth $fixedHeight]]
+ lequal [list [.tt bbox 1.1] [.tt bbox 2.2] [.tt bbox 3.3]] $expected
} -cleanup {
destroy .tt
-} -result [list [list 38 5 7 $fixedHeight] [list 38 20 7 $fixedHeight] [list 38 35 7 $fixedHeight]]
+} -result {1}
-.t configure -width 40 -bd 0 -relief flat -highlightthickness 0 -padx 0 \
+.t configure -width 40 -bd 0 -relief flat -highlightthickness 0 \
-tabs 100
-updateText
-test textDisp-25.1 {CharBboxProc procedure, check tab width} {textfonts} {
+update
+test textDisp-25.1 {CharBboxProc procedure, check tab width} {
.t delete 1.0 end
.t insert 1.0 abc\td\tfgh
list [.t bbox 1.3] [.t bbox 1.5] [.t bbox 1.6]
-} [list [list 21 1 79 $fixedHeight] [list 107 1 93 $fixedHeight] [list 200 1 7 $fixedHeight]]
+} [list [list [xchar 3] [yline 1] [expr {100-3*$fixedWidth}] $fixedHeight] \
+ [list [expr {[bo]+100+$fixedWidth}] [yline 1] [expr {200-(100+$fixedWidth)}] $fixedHeight] \
+ [list [expr {[bo]+200}] [yline 1] $fixedWidth $fixedHeight]]
-.t configure -width 40 -bd 0 -relief flat -highlightthickness 0 -padx 0 \
+.t configure -width 40 -bd 0 -relief flat -highlightthickness 0 -padx 0 -pady 0 \
-tabs {}
-updateText
-test textDisp-26.1 {AdjustForTab procedure, no tabs} {textfonts} {
+update
+test textDisp-26.1 {AdjustForTab procedure, no tabs} {
.t delete 1.0 end
.t insert 1.0 a\tbcdefghij\tc\td
list [lindex [.t bbox 1.2] 0] [lindex [.t bbox 1.12] 0] \
[lindex [.t bbox 1.14] 0]
-} [list 56 126 168]
-test textDisp-26.1.2 {AdjustForTab procedure, no tabs} {textfonts} {
+} [list [expr {[bo]+8*$fixedWidth}] \
+ [expr {[bo]+2*8*$fixedWidth+2*$fixedWidth}] \
+ [expr {[bo]+3*8*$fixedWidth}]]
+test textDisp-26.1.2 {AdjustForTab procedure, no tabs} {
.t delete 1.0 end
.t insert 1.0 a\tbcdefghij\tc\td
.t configure -tabstyle wordprocessor
@@ -3472,7 +3882,9 @@ test textDisp-26.1.2 {AdjustForTab procedure, no tabs} {textfonts} {
[lindex [.t bbox 1.14] 0]]
.t configure -tabstyle tabular
set res
-} [list 56 168 224]
+} [list [expr {[bo]+8*$fixedWidth}] \
+ [expr {[bo]+3*8*$fixedWidth}] \
+ [expr {[bo]+4*8*$fixedWidth}]]
test textDisp-26.2 {AdjustForTab procedure, not enough tabs specified} {
.t delete 1.0 end
.t insert 1.0 a\tb\tc\td
@@ -3580,30 +3992,41 @@ test textDisp-26.12 {AdjustForTab procedure, adjusting chunks} {
.t tag add y 1.9
button .b -text "="
.t window create 1.3 -window .b
- updateText
+ update
lindex [.t bbox 1.5] 0
} {120}
-test textDisp-26.13 {AdjustForTab procedure, not enough space} {textfonts} {
+test textDisp-26.13 {AdjustForTab procedure, not enough space} {
.t delete 1.0 end
.t insert 1.0 "abc\txyz\tqrs\txyz\t0"
.t tag delete x
- .t tag configure x -tabs {10 30 center 50 right 120}
+ set t1 [expr { $fixedWidth+3}]
+ set t2 [expr { 4*$fixedWidth+2}]
+ set t3 [expr { 7*$fixedWidth+1}]
+ set t4 [expr {17*$fixedWidth+1}]
+ .t tag configure x -tabs "$t1 $t2 center $t3 right $t4"
.t tag add x 1.0 end
- list [lindex [.t bbox 1.4] 0] [lindex [.t bbox 1.8] 0] \
- [lindex [.t bbox 1.12] 0] [lindex [.t bbox 1.16] 0]
-} [list 28 56 84 120]
-test textDisp-26.13.2 {AdjustForTab procedure, not enough space} {textfonts} {
+ set expected [list [xchar 4] [xchar 8] [xchar 12] $t4]
+ set res [list [lindex [.t bbox 1.4] 0] [lindex [.t bbox 1.8] 0] \
+ [lindex [.t bbox 1.12] 0] [lindex [.t bbox 1.16] 0]]
+ lequal $res $expected
+} {1}
+test textDisp-26.13.2 {AdjustForTab procedure, not enough space} {
.t delete 1.0 end
.t insert 1.0 "abc\txyz\tqrs\txyz\t0"
.t tag delete x
- .t tag configure x -tabs {10 30 center 50 right 120} -tabstyle wordprocessor
+ set t1 [expr { $fixedWidth+3}]
+ set t2 [expr { 4*$fixedWidth+2}]
+ set t3 [expr { 7*$fixedWidth+1}]
+ set t4 [expr {17*$fixedWidth+1}]
+ .t tag configure x -tabs "$t1 $t2 center $t3 right $t4" -tabstyle wordprocessor
.t tag add x 1.0 end
+ set expected [list [xchar 4] [xchar 8] $t4 [expr {$t4+($t4-$t3)}]]
set res [list [lindex [.t bbox 1.4] 0] [lindex [.t bbox 1.8] 0] \
[lindex [.t bbox 1.12] 0] [lindex [.t bbox 1.16] 0]]
.t tag configure x -tabstyle tabular
- set res
-} [list 28 56 120 190]
-test textDisp-26.14 {AdjustForTab procedure, not enough space} {textfonts} {
+ lequal $res $expected
+} {1}
+test textDisp-26.14 {AdjustForTab procedure, not enough space} {
.t delete 1.0 end
.t insert end "a \tb \tc \td \te \tf \tg\n"
.t insert end "Watch the \tX and the \t\t\tY\n"
@@ -3611,8 +4034,8 @@ test textDisp-26.14 {AdjustForTab procedure, not enough space} {textfonts} {
.t insert end "Watch the \tX and the \t\t\tY\n" moop
list [lindex [.t bbox 2.11] 0] [lindex [.t bbox 2.24] 0] \
[lindex [.t bbox 3.11] 0] [lindex [.t bbox 3.24] 0]
-} [list 77 224 77 224]
-test textDisp-26.14.2 {AdjustForTab procedure, not enough space} {textfonts} {
+} [list [xchar 11] [xchar 32] [xchar 11] [xchar 32]]
+test textDisp-26.14.2 {AdjustForTab procedure, not enough space} {
.t delete 1.0 end
.t configure -tabstyle wordprocessor
.t insert end "a \tb \tc \td \te \tf \tg\n"
@@ -3623,65 +4046,90 @@ test textDisp-26.14.2 {AdjustForTab procedure, not enough space} {textfonts} {
[lindex [.t bbox 3.11] 0] [lindex [.t bbox 3.24] 0]]
.t configure -tabstyle tabular
set res
-} [list 112 56 112 56]
+} [list [xchar 16] [xchar 8] [xchar 16] [xchar 8]]
.t configure -width 20 -bd 2 -highlightthickness 2 -relief sunken -tabs {} \
-wrap char
-updateText
-test textDisp-27.1 {SizeOfTab procedure, old-style tabs} {textfonts} {
+update
+test textDisp-27.1 {SizeOfTab procedure, old-style tabs} {
.t delete 1.0 end
.t insert 1.0 a\tbcdefghij\tc\td
list [.t bbox 1.2] [.t bbox 1.10] [.t bbox 1.12]
-} [list [list 60 5 7 $fixedHeight] [list 116 5 7 $fixedHeight] [list 130 5 7 $fixedHeight]]
-test textDisp-27.1.1 {SizeOfTab procedure, old-style tabs} {textfonts} {
+} [list [list [xchar 8] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar [expr {8+8}]] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar [expr {8+8+1+1}]] [yline 1] $fixedWidth $fixedHeight]]
+test textDisp-27.1.1 {SizeOfTab procedure, old-style tabs} {
.t delete 1.0 end
.t insert 1.0 a\tbcdefghij\tc\td
.t configure -tabstyle wordprocessor
set res [list [.t bbox 1.2] [.t bbox 1.10] [.t bbox 1.12]]
.t configure -tabstyle tabular
set res
-} [list [list 60 5 7 $fixedHeight] [list 116 5 7 $fixedHeight] [list 4 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-27.2 {SizeOfTab procedure, choosing tabX and alignment} {textfonts} {
+} [list [list [xchar 8] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar [expr {8+8}]] [yline 1] $fixedWidth $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-27.2 {SizeOfTab procedure, choosing tabX and alignment} {
.t delete 1.0 end
.t insert 1.0 a\tbcd
.t tag delete x
- .t tag configure x -tabs 120
+ # compute a tab width such that the first display line is just not large enough
+ # to show the last char 'd', which then wraps on display line 2
+ set tw [expr {(20-2)*$fixedWidth-($fixedWidth-1)}]
+ .t tag configure x -tabs $tw
.t tag add x 1.0 end
- list [.t bbox 1.3] [.t bbox 1.4]
-} [list [list 131 5 13 $fixedHeight] [list 4 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-27.3 {SizeOfTab procedure, choosing tabX and alignment} {textfonts} {
+ set expected [list [list [expr {[bo]+$tw+[xw 1]}] [yline 1] [expr {[winfo width .t]-([bo]+$tw+[xw 1])-[bo]}] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+ lequal [list [.t bbox 1.3] [.t bbox 1.4]] $expected
+} {1}
+test textDisp-27.3 {SizeOfTab procedure, choosing tabX and alignment} {
.t delete 1.0 end
.t insert 1.0 a\t\t\tbcd
.t tag delete x
- .t tag configure x -tabs 40
+ # compute a tab width such that the first display line is just not large enough
+ # to show the last char 'd', which then wraps on display line 2
+ set tw [expr {int(ceil(((20-2)*$fixedWidth-($fixedWidth-1))/3.0))}]
+ .t tag configure x -tabs $tw
.t tag add x 1.0 end
- list [.t bbox 1.5] [.t bbox 1.6]
-} [list [list 131 5 13 $fixedHeight] [list 4 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-27.4 {SizeOfTab procedure, choosing tabX and alignment} {textfonts} {
+ set expected [list [list [expr {[bo]+3*$tw+[xw 1]}] [yline 1] [expr {[winfo width .t]-([bo]+3*$tw+[xw 1])-[bo]}] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+ lequal [list [.t bbox 1.5] [.t bbox 1.6]] $expected
+} {1}
+test textDisp-27.4 {SizeOfTab procedure, choosing tabX and alignment} {
.t delete 1.0 end
.t insert 1.0 a\t\t\tbcd
.t tag delete x
- .t tag configure x -tabs {20 center 70 left}
+ # compute a tab width such that the first display line is just not large enough
+ # to show the last char 'd', which then wraps on display line 2
+ set tw [expr {int(ceil(((20-2)*$fixedWidth-($fixedWidth-1) + 20)/2.0))}]
+ .t tag configure x -tabs "20 center $tw left"
.t tag add x 1.0 end
- list [.t bbox 1.5] [.t bbox 1.6]
-} [list [list 131 5 13 $fixedHeight] [list 4 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-27.5 {SizeOfTab procedure, center alignment} {textfonts} {
+ set expected [list [list [expr {[bo]+$tw+($tw-20)+[xw 1]}] [yline 1] [expr {[winfo width .t]-([bo]+$tw+($tw-20)+[xw 1])-[bo]}] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+ lequal [list [.t bbox 1.5] [.t bbox 1.6]] $expected
+} {1}
+test textDisp-27.5 {SizeOfTab procedure, center alignment} {
.t delete 1.0 end
.t insert 1.0 a\txyzzyabc
.t tag delete x
- .t tag configure x -tabs {120 center}
+ # compute a tab width such that the last y on the first display line is the last displayed char
+ # while 'xyzzyabc' is centered at the tab stop; the 'abc" part of the line wraps on display line 2
+ set tw [expr {[winfo width .t]-2*[bo]-3*$fixedWidth+1}]
+ .t tag configure x -tabs "$tw center"
.t tag add x 1.0 end
- list [.t bbox 1.6] [.t bbox 1.7]
-} [list [list 135 5 9 $fixedHeight] [list 4 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-27.6 {SizeOfTab procedure, center alignment} {textfonts} {
+ set expected [list [list [expr {[bo]+$tw+round(1.5*$fixedWidth)}] [yline 1] [expr {[winfo width .t]-([bo]+$tw+round(1.5*$fixedWidth))-[bo]}] $fixedHeight] \
+ [list [xchar 0] [yline 2] $fixedWidth $fixedHeight]]
+ lequal [list [.t bbox 1.6] [.t bbox 1.7]] $expected
+} {1}
+test textDisp-27.6 {SizeOfTab procedure, center alignment} {
.t delete 1.0 end
.t insert 1.0 a\txyzzyabc
.t tag delete x
- .t tag configure x -tabs {150 center}
+ .t tag configure x -tabs "[expr {round(21.4*$fixedWidth)}] center"
.t tag add x 1.0 end
list [.t bbox 1.6] [.t bbox 1.7]
-} [list [list 32 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 39 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-27.7 {SizeOfTab procedure, center alignment, wrap -none (potential numerical problems)} {textfonts failsOnXQuarz} {
+} [list [list [xchar 4] [yline 2] $fixedWidth $fixedHeight] \
+ [list [xchar 5] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-27.7 {SizeOfTab procedure, center alignment, wrap -none (potential numerical problems)} {
.t delete 1.0 end
set cm [winfo fpixels .t 1c]
.t configure -tabs {1c 2c center 3c 4c 5c 6c 7c 8c} -wrap none -width 40
@@ -3692,16 +4140,16 @@ test textDisp-27.7 {SizeOfTab procedure, center alignment, wrap -none (potential
set tab [expr {$tab + $cm}]
}
# Now we've calculated to the end of the tab after 'a', add one
- # more for 'bb\t' and we're there, with 4 for the border. Since
+ # more for 'bb\t' and we're there, with some pixels for the border. Since
# Tk_GetPixelsFromObj uses the standard 'int(0.5 + float)' rounding,
# so must we.
- set tab [expr {4 + int(0.5 + $tab + $cm)}]
- updateText
+ set tab [expr {[bo] + int(0.5 + $tab + $cm)}]
+ update
set res [.t bbox 2.23]
- lset res 0 [expr {[lindex $res 0] - $tab}]
- set res
-} [list -28 [expr {$fixedDiff + 18}] 7 $fixedHeight]
-test textDisp-27.7.1 {SizeOfTab procedure, center alignment, wrap -none (potential numerical problems)} {textfonts} {
+ set expected [list [expr {[xchar 23]-$tab}] [yline 2] $fixedWidth $fixedHeight]
+ lequal [lset res 0 [expr {[lindex $res 0] - $tab}]] $expected
+} {1}
+test textDisp-27.7.1 {SizeOfTab procedure, center alignment, wrap -none (potential numerical problems)} {
.t delete 1.0 end
.t configure -tabstyle wordprocessor
set cm [winfo fpixels .t 1c]
@@ -3713,16 +4161,15 @@ test textDisp-27.7.1 {SizeOfTab procedure, center alignment, wrap -none (potenti
set tab [expr {$tab + $cm}]
}
# Now we've calculated to the end of the tab after 'a', add one
- # more for 'bb\t' and we're there, with 4 for the border. Since
+ # more for 'bb\t' and we're there, with some pixels for the border. Since
# Tk_GetPixelsFromObj uses the standard 'int(0.5 + float)' rounding,
# so must we.
- set tab [expr {4 + int(0.5 + $tab + $cm)}]
- updateText
+ set tab [expr {[bo] + int(0.5 + $tab + $cm)}]
+ update
set res [.t bbox 2.23]
.t configure -tabstyle tabular
lset res 0 [expr {[lindex $res 0] - $tab}]
- set res
-} [list 0 [expr {$fixedDiff + 18}] 7 $fixedHeight]
+} [list 0 [yline 2] $fixedWidth $fixedHeight]
test textDisp-27.7.2 {SizeOfTab procedure, fractional tab interpolation problem} {
.t delete 1.0 end
set interpolatetab {1c 2c}
@@ -3732,70 +4179,78 @@ test textDisp-27.7.2 {SizeOfTab procedure, fractional tab interpolation problem}
}
.t configure -tabs $interpolatetab -wrap none -width 150
.t insert 1.0 [string repeat "a\t" 20]
- updateText
+ update
set res [.t bbox 1.20]
# Now, Tk's interpolated tabs should be the same as
# non-interpolated.
.t configure -tabs $precisetab
- updateText
+ update
expr {[lindex $res 0] - [lindex [.t bbox 1.20] 0]}
} {0}
.t configure -wrap char -tabs {} -width 20
-updateText
-test textDisp-27.8 {SizeOfTab procedure, right alignment} {textfonts} {
+update
+test textDisp-27.8 {SizeOfTab procedure, right alignment} {
.t delete 1.0 end
.t insert 1.0 a\t\txyzzyabc
.t tag delete x
- .t tag configure x -tabs {100 left 140 right}
+ .t tag configure x -tabs "[expr {14.3*$fixedWidth}] left [expr {[.t cget -width]*$fixedWidth}] right"
.t tag add x 1.0 end
list [.t bbox 1.6] [.t bbox 1.7]
-} [list [list 137 5 7 $fixedHeight] [list 4 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-27.9 {SizeOfTab procedure, left alignment} {textfonts} {
+} [list [list [xcharr 1] [yline 1] $fixedWidth $fixedHeight] \
+ [list [bo] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-27.9 {SizeOfTab procedure, left alignment} {
.t delete 1.0 end
.t insert 1.0 a\txyzzyabc
.t tag delete x
- .t tag configure x -tabs {120}
+ .t tag configure x -tabs "[expr {17.14*$fixedWidth}]"
.t tag add x 1.0 end
list [.t bbox 1.3] [.t bbox 1.4]
-} [list [list 131 5 13 $fixedHeight] [list 4 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-27.10 {SizeOfTab procedure, numeric alignment} {textfonts} {
+} [list [list [expr {round([bo]+17.14*$fixedWidth+$fixedWidth)}] [yline 1] [expr {[winfo width .t]-round([bo]+17.14*$fixedWidth+$fixedWidth)-[bo]}] $fixedHeight] \
+ [list [bo] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-27.10 {SizeOfTab procedure, numeric alignment} {
.t delete 1.0 end
.t insert 1.0 a\t123.4
.t tag delete x
- .t tag configure x -tabs {120 numeric}
+ .t tag configure x -tabs "[expr {17.14*$fixedWidth}] numeric"
.t tag add x 1.0 end
list [.t bbox 1.3] [.t bbox 1.4]
-} [list [list 117 5 27 $fixedHeight] [list 4 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-27.11 {SizeOfTab procedure, making tabs at least as wide as a space} {textfonts} {
+} [list [list [expr {round([bo]+17.14*$fixedWidth-$fixedWidth)}] [yline 1] [expr {[winfo width .t]-round([bo]+17.14*$fixedWidth-$fixedWidth)-[bo]}] $fixedHeight] \
+ [list [bo] [yline 2] $fixedWidth $fixedHeight]]
+test textDisp-27.11 {SizeOfTab procedure, making tabs at least as wide as a space} {
.t delete 1.0 end
.t insert 1.0 abc\tdefghijklmnopqrst
.t tag delete x
- .t tag configure x -tabs {120}
+ .t tag configure x -tabs "[expr {17.14*$fixedWidth}]"
.t tag add x 1.0 end
list [.t bbox 1.5] [.t bbox 1.6]
-} [list [list 131 5 13 $fixedHeight] [list 4 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
+} [list [list [expr {round([bo]+17.14*$fixedWidth+$fixedWidth)}] [yline 1] [expr {[winfo width .t]-round([bo]+17.14*$fixedWidth+$fixedWidth)-[bo]}] $fixedHeight] \
+ [list [bo] [yline 2] $fixedWidth $fixedHeight]]
proc bizarre_scroll args {
.t2.t delete 5.0 end
}
-test textDisp-28.1 {"yview" option with bizarre scroll command} {
+test textDisp-28.1 {"yview" option with bizarre scroll command} -setup {
catch {destroy .t2}
+} -body {
toplevel .t2
text .t2.t -width 40 -height 4
.t2.t insert end "1\n2\n3\n4\n5\n6\n7\n8\n"
pack .t2.t
wm geometry .t2 +0+0
- updateText
+ update
.t2.t configure -yscrollcommand bizarre_scroll
.t2.t yview 100.0
set result [.t2.t index @0,0]
- updateText
+ update
lappend result [.t2.t index @0,0]
-} {6.0 1.0}
+} -cleanup {
+ destroy .t2
+} -result {6.0 1.0}
-test textDisp-29.1 {miscellaneous: lines wrap but are still too long} {textfonts} {
+test textDisp-29.1 {miscellaneous: lines wrap but are still too long} -setup {
catch {destroy .t2}
+} -body {
toplevel .t2
wm geometry .t2 +0+0
text .t2.t -width 20 -height 10 -font $fixedFont \
@@ -3806,11 +4261,17 @@ test textDisp-29.1 {miscellaneous: lines wrap but are still too long} {textfonts
.t2.t insert end 123
frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
.t2.t window create 1.1 -window .t2.t.f
- updateText
- list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]
-} [list [list 0.0 [expr {20.0*$fixedWidth/300}]] 300x50+[expr {$twbw + $twht + 1}]+[expr {$twbw + $twht + $fixedHeight + 1}] [list [expr {$twbw + $twht + $fixedWidth + 1}] [expr {$twbw + $twht + $fixedHeight + 50 + 1}] $fixedWidth $fixedHeight]]
-test textDisp-29.2 {miscellaneous: lines wrap but are still too long} {textfonts} {
+ update
+ set expected [list [list 0.0 [expr {20.0*$fixedWidth/300}]] \
+ 300x50+[bo .t2.t]+[yline 2 .t2.t] \
+ [list [xchar 1 .t2.t] [expr {[yline 2 .t2.t]+50}] $fixedWidth $fixedHeight]]
+ lequal [list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]] $expected
+} -cleanup {
+ destroy .t2
+} -result {1}
+test textDisp-29.2 {miscellaneous: lines wrap but are still too long} -setup {
catch {destroy .t2}
+} -body {
toplevel .t2
wm geometry .t2 +0+0
text .t2.t -width 20 -height 10 -font $fixedFont \
@@ -3821,13 +4282,19 @@ test textDisp-29.2 {miscellaneous: lines wrap but are still too long} {textfonts
.t2.t insert end 123
frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
.t2.t window create 1.1 -window .t2.t.f
- updateText
+ update
.t2.t xview scroll 1 unit
- updateText
- list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]
-} [list [list [expr {1.0*$fixedWidth/300}] [expr {21.0*$fixedWidth/300}]] 300x50+[expr {$twbw + $twht + 1 - $fixedWidth}]+[expr {$twbw + $twht + $fixedHeight + 1}] [list [expr {$twbw + $twht + $fixedWidth + 1 - $fixedWidth}] [expr {$twbw + $twht + $fixedHeight + 50 + 1}] $fixedWidth $fixedHeight]]
-test textDisp-29.2.1 {miscellaneous: lines wrap but are still too long} {textfonts} {
+ update
+ set expected [list [list [expr {1.0*$fixedWidth/300}] [expr {21.0*$fixedWidth/300}]] \
+ 300x50+[expr {[bo .t2.t]-$fixedWidth}]+[yline 2 .t2.t] \
+ [list [expr {[bo .t2.t]-$fixedWidth+$fixedWidth}] [expr {[yline 2 .t2.t]+50}] $fixedWidth $fixedHeight]]
+ lequal [list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]] $expected
+} -cleanup {
+ destroy .t2
+} -result {1}
+test textDisp-29.2.1 {miscellaneous: lines wrap but are still too long} -setup {
catch {destroy .t2}
+} -body {
toplevel .t2
wm geometry .t2 +0+0
text .t2.t -width 20 -height 10 -font $fixedFont \
@@ -3837,13 +4304,16 @@ test textDisp-29.2.1 {miscellaneous: lines wrap but are still too long} {textfon
pack .t2.s -side bottom -fill x
.t2.t insert end 1\n
.t2.t insert end [string repeat "abc" 30]
- updateText
+ update
.t2.t xview scroll 5 unit
- updateText
+ update
.t2.t xview
-} [list [expr {5.0/90}] [expr {25.0/90}]]
-test textDisp-29.2.2 {miscellaneous: lines wrap but are still too long} {textfonts} {
+} -cleanup {
+ destroy .t2
+} -result [list [expr {5.0/90}] [expr {25.0/90}]]
+test textDisp-29.2.2 {miscellaneous: lines wrap but are still too long} -setup {
catch {destroy .t2}
+} -body {
toplevel .t2
wm geometry .t2 +0+0
text .t2.t -width 20 -height 10 -font $fixedFont \
@@ -3854,13 +4324,19 @@ test textDisp-29.2.2 {miscellaneous: lines wrap but are still too long} {textfon
.t2.t insert end 123
frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
.t2.t window create 1.1 -window .t2.t.f
- updateText
+ update
.t2.t xview scroll 2 unit
- updateText
- list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]
-} [list [list [expr {2.0*$fixedWidth/300}] [expr {22.0*$fixedWidth/300}]] 300x50+[expr {$twbw + $twht + 1 - 2*$fixedWidth}]+[expr {$twbw + $twht + $fixedHeight + 1}] {}]
-test textDisp-29.2.3 {miscellaneous: lines wrap but are still too long} {textfonts} {
+ update
+ set expected [list [list [expr {2.0*$fixedWidth/300}] [expr {22.0*$fixedWidth/300}]] \
+ 300x50+[expr {[bo .t2.t]-2*$fixedWidth}]+[yline 2 .t2.t] \
+ {}]
+ lequal [list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]] $expected
+} -cleanup {
+ destroy .t2
+} -result {1}
+test textDisp-29.2.3 {miscellaneous: lines wrap but are still too long} -setup {
catch {destroy .t2}
+} -body {
toplevel .t2
wm geometry .t2 +0+0
text .t2.t -width 20 -height 10 -font $fixedFont \
@@ -3871,13 +4347,19 @@ test textDisp-29.2.3 {miscellaneous: lines wrap but are still too long} {textfon
.t2.t insert end 123
frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
.t2.t window create 1.1 -window .t2.t.f
- updateText
+ update
.t2.t xview scroll 7 pixels
- updateText
- list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]
-} [list [list [expr {7.0/300}] [expr {(20.0*$fixedWidth + 7)/300}]] 300x50+[expr {$twbw + $twht + 1 - 7}]+[expr {$twbw + $twht + $fixedHeight + 1}] [list [expr {$twbw + $twht + $fixedWidth + 1 - 7}] [expr {$twbw + $twht + $fixedHeight + 50 + 1}] $fixedWidth $fixedHeight]]
-test textDisp-29.2.4 {miscellaneous: lines wrap but are still too long} {textfonts} {
+ update
+ set expected [list [list [expr {7.0/300}] [expr {(20.0*$fixedWidth+7)/300}]] \
+ 300x50+[expr {[bo .t2.t]-7}]+[yline 2 .t2.t] \
+ [list [expr {[bo .t2.t]+$fixedWidth-7}] [expr {[yline 2 .t2.t]+50}] $fixedWidth $fixedHeight]]
+ lequal [list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]] $expected
+} -cleanup {
+ destroy .t2
+} -result {1}
+test textDisp-29.2.4 {miscellaneous: lines wrap but are still too long} -setup {
catch {destroy .t2}
+} -body {
toplevel .t2
wm geometry .t2 +0+0
text .t2.t -width 20 -height 10 -font $fixedFont \
@@ -3888,13 +4370,19 @@ test textDisp-29.2.4 {miscellaneous: lines wrap but are still too long} {textfon
.t2.t insert end 123
frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
.t2.t window create 1.1 -window .t2.t.f
- updateText
+ update
.t2.t xview scroll 17 pixels
- updateText
- list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]
-} [list [list [expr {17.0/300}] [expr {(20.0*$fixedWidth + 17)/300}]] 300x50+[expr {$twbw + $twht + 1 - 17}]+[expr {$twbw + $twht + $fixedHeight + 1}] {}]
-test textDisp-29.2.5 {miscellaneous: can show last character} {
+ update
+ set expected [list [list [expr {17.0/300}] [expr {(20.0*$fixedWidth+17)/300}]] \
+ 300x50+[expr {[bo .t2.t]-17}]+[yline 2 .t2.t] \
+ {}]
+ lequal [list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]] $expected
+} -cleanup {
+ destroy .t2
+} -result {1}
+test textDisp-29.2.5 {miscellaneous: can show last character} -setup {
catch {destroy .t2}
+} -body {
toplevel .t2
wm geometry .t2 121x141+200+200
text .t2.t -width 5 -height 5 -font {Arial 10} \
@@ -3907,22 +4395,24 @@ test textDisp-29.2.5 {miscellaneous: can show last character} {
grid columnconfigure .t2 0 -weight 1
grid rowconfigure .t2 0 -weight 1
grid rowconfigure .t2 1 -weight 0
- updateText
+ update
set xv [.t2.t xview]
set xd [expr {[lindex $xv 1] - [lindex $xv 0]}]
.t2.t xview moveto [expr {1.0-$xd}]
set iWidth [lindex [.t2.t bbox end-2c] 2]
.t2.t xview scroll 2 units
set iWidth2 [lindex [.t2.t bbox end-2c] 2]
-
if {($iWidth == $iWidth2) && $iWidth >= 2} {
set result "correct"
} else {
set result "last character is not completely visible when it should be"
}
-} {correct}
-test textDisp-29.3 {miscellaneous: lines wrap but are still too long} {textfonts} {
+} -cleanup {
+ destroy .t2
+} -result {correct}
+test textDisp-29.3 {miscellaneous: lines wrap but are still too long} -setup {
catch {destroy .t2}
+} -body {
toplevel .t2
wm geometry .t2 +0+0
text .t2.t -width 20 -height 10 -font $fixedFont \
@@ -3933,47 +4423,69 @@ test textDisp-29.3 {miscellaneous: lines wrap but are still too long} {textfonts
.t2.t insert end 123
frame .t2.t.f -width 300 -height 50 -bd 2 -relief raised
.t2.t window create 1.1 -window .t2.t.f
- updateText
+ update
.t2.t xview scroll 200 units
- updateText
- list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]
-} [list [list [expr {16.0/30}] 1.0] 300x50+-155+[expr {$fixedDiff + 18}] {}]
-test textDisp-30.1 {elidden text joining multiple logical lines} {
+ update
+ set expected [list [list [expr {double(300-20*$fixedWidth)/300}] 1.0] \
+ 300x50+[expr {-(300-20*$fixedWidth-[bo .t2.t])}]+[yline 2 .t2.t] \
+ {}]
+ lequal [list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]] $expected
+} -cleanup {
+ destroy .t2
+} -result {1}
+
+test textDisp-30.1 {elided text joining multiple logical lines} -setup {
+ catch {destroy .t2}
+} -body {
+ toplevel .t2
+ text .t2.t -width 20 -height 10 -font $fixedFont
+ pack .t2.t -side top
.t2.t delete 1.0 end
.t2.t insert 1.0 "1111\n2222\n3333"
- .t2.t tag configure elidden -elide 1 -background red
- .t2.t tag add elidden 1.2 3.2
- .t2.t count -displaylines 1.0 end
-} {1}
-test textDisp-30.2 {elidden text joining multiple logical lines} {
+ .t2.t tag configure elided -elide 1 -background red
+ .t2.t tag add elided 1.2 3.2
+ update
+ .t2.t count -update -displaylines 1.0 end
+} -cleanup {
+ destroy .t2
+} -result {1}
+test textDisp-30.2 {elided text joining multiple logical lines} -setup {
+ catch {destroy .t2}
+} -body {
+ toplevel .t2
+ text .t2.t -width 20 -height 10 -font $fixedFont
+ pack .t2.t -side top
.t2.t delete 1.0 end
.t2.t insert 1.0 "1111\n2222\n3333"
- .t2.t tag configure elidden -elide 1 -background red
- .t2.t tag add elidden 1.2 2.2
- .t2.t count -displaylines 1.0 end
-} {2}
+ .t2.t tag configure elided -elide 1 -background red
+ .t2.t tag add elided 1.2 2.2
+ update
+ .t2.t count -update -displaylines 1.0 end
+} -cleanup {
+ destroy .t2
+} -result {2}
catch {destroy .t2}
.t configure -height 1
-updateText
+update
-test textDisp-31.1 {line embedded window height update} failsOnUbuntu {
+test textDisp-31.1 {line embedded window height update} {
set res {}
.t delete 1.0 end
.t insert end "abcd\nefgh\nijkl\nmnop\nqrst\nuvwx\nyx"
- frame .t.f -background red -width 100 -height 100
+ frame .t.f -background red -width 50 -height 100
.t window create 3.0 -window .t.f
lappend res [.t count -update -ypixels 1.0 end]
.t.f configure -height 10
lappend res [.t count -ypixels 1.0 end]
lappend res [.t count -update -ypixels 1.0 end]
- set res
-} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 6}] [expr {$fixedHeight * 7}]]
-
-test textDisp-31.2 {line update index shifting} failsOnUbuntu {
+} [list [expr {100+$fixedHeight*6}] \
+ [expr {100+$fixedHeight*6}] \
+ [expr {$fixedHeight*7}]]
+test textDisp-31.2 {line update index shifting} {
set res {}
.t.f configure -height 100
- updateText
+ update
lappend res [.t count -update -ypixels 1.0 end]
.t.f configure -height 10
.t insert 1.0 "abc\n"
@@ -3984,10 +4496,12 @@ test textDisp-31.2 {line update index shifting} failsOnUbuntu {
.t delete 1.0 3.0
lappend res [.t count -ypixels 1.0 end]
lappend res [.t count -update -ypixels 1.0 end]
- set res
-} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]]
-
-test textDisp-31.3 {line update index shifting} failsOnUbuntu {
+} [list [expr {100+$fixedHeight*6}] \
+ [expr {100+$fixedHeight*8}] \
+ [expr {$fixedHeight*9}] \
+ [expr {$fixedHeight*7}] \
+ [expr {100+$fixedHeight*6}]]
+test textDisp-31.3 {line update index shifting} {
# Should do exactly the same as the above, as long
# as we are correctly tagging the correct lines for
# recalculation. The 'update' and 'delay' must be
@@ -3995,7 +4509,7 @@ test textDisp-31.3 {line update index shifting} failsOnUbuntu {
# have been performed.
set res {}
.t.f configure -height 100
- updateText
+ update
lappend res [.t count -update -ypixels 1.0 end]
.t.f configure -height 10
.t insert 1.0 "abc\n"
@@ -4009,25 +4523,29 @@ test textDisp-31.3 {line update index shifting} failsOnUbuntu {
delay
lappend res [.t count -ypixels 1.0 end]
set res
-} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]]
-
+} [list [expr {100+$fixedHeight*6}] \
+ [expr {100+$fixedHeight*8}] \
+ [expr {$fixedHeight*9}] \
+ [expr {$fixedHeight*7}] \
+ [expr {100+$fixedHeight*6}]]
test textDisp-31.4 {line embedded image height update} {
set res {}
image create photo textest -height 100 -width 10
.t delete 3.0
.t image create 3.0 -image textest
- updateText
+ update
lappend res [.t count -update -ypixels 1.0 end]
textest configure -height 10
lappend res [.t count -ypixels 1.0 end]
lappend res [.t count -update -ypixels 1.0 end]
set res
-} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 6}] [expr {$fixedHeight * 7}]]
-
-test textDisp-31.5 {line update index shifting} failsOnUbuntu {
+} [list [expr {100+$fixedHeight*6}] \
+ [expr {100+$fixedHeight*6}] \
+ [expr {$fixedHeight*7}]]
+test textDisp-31.5 {line update index shifting} {
set res {}
textest configure -height 100
- updateText
+ update
lappend res [.t count -update -ypixels 1.0 end]
textest configure -height 10
.t insert 1.0 "abc\n"
@@ -4039,9 +4557,12 @@ test textDisp-31.5 {line update index shifting} failsOnUbuntu {
lappend res [.t count -ypixels 1.0 end]
lappend res [.t count -update -ypixels 1.0 end]
set res
-} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]]
-
-test textDisp-31.6 {line update index shifting} failsOnUbuntu {
+} [list [expr {100+$fixedHeight*6}] \
+ [expr {100+$fixedHeight*8}] \
+ [expr {$fixedHeight*9}] \
+ [expr {$fixedHeight*7}] \
+ [expr {100+$fixedHeight*6}]]
+test textDisp-31.6 {line update index shifting} {
# Should do exactly the same as the above, as long
# as we are correctly tagging the correct lines for
# recalculation. The 'update' and 'delay' must be
@@ -4062,8 +4583,11 @@ test textDisp-31.6 {line update index shifting} failsOnUbuntu {
delay
lappend res [.t count -ypixels 1.0 end]
set res
-} [list [expr {100 + $fixedHeight * 6}] [expr {100 + $fixedHeight * 8}] [expr {$fixedHeight * 9}] [expr {$fixedHeight * 7}] [expr {100 + $fixedHeight * 6}]]
-
+} [list [expr {100+$fixedHeight*6}] \
+ [expr {100+$fixedHeight*8}] \
+ [expr {$fixedHeight*9}] \
+ [expr {$fixedHeight*7}] \
+ [expr {100+$fixedHeight*6}]]
test textDisp-31.7 {line update index shifting, elided} {
# The 'update' and 'delay' must be long enough to ensure all
# asynchronous updates have been performed.
@@ -4083,7 +4607,12 @@ test textDisp-31.7 {line update index shifting, elided} {
delay
lappend res [.t count -ypixels 1.0 end]
set res
-} [list [expr {$fixedHeight * 1}] [expr {$fixedHeight * 3}] [expr {$fixedHeight * 3}] [expr {$fixedHeight * 2}] [expr {$fixedHeight * 1}] [expr {$fixedHeight * 1}]]
+} [list [expr {$fixedHeight*1}] \
+ [expr {$fixedHeight*3}] \
+ [expr {$fixedHeight*3}] \
+ [expr {$fixedHeight*2}] \
+ [expr {$fixedHeight*1}] \
+ [expr {$fixedHeight*1}]]
test textDisp-32.0 {everything elided} {
# Must not crash
@@ -4091,19 +4620,19 @@ test textDisp-32.0 {everything elided} {
.tt insert 0.0 HELLO
.tt tag configure HIDE -elide 1
.tt tag add HIDE 0.0 end
- updateText
+ update
destroy .tt
} {}
test textDisp-32.1 {everything elided} {
# Must not crash
pack [text .tt]
- updateText
+ update
.tt insert 0.0 HELLO
- updateText
+ update
.tt tag configure HIDE -elide 1
- updateText
+ update
.tt tag add HIDE 0.0 end
- updateText
+ update
destroy .tt
} {}
test textDisp-32.2 {elide and tags} {
@@ -4114,11 +4643,11 @@ test textDisp-32.2 {elide and tags} {
{testtag1 testtag3} \
{[this bit here uses tags 2 and 3]} \
{testtag2 testtag3}
- updateText
+ update
# indent left margin of tag 1 by 20 pixels
# text should be indented
.tt tag configure testtag1 -lmargin1 20
- updateText
+ update
#1
set res {}
lappend res [list [.tt index "1.0 + 0 displaychars"] \
@@ -4127,7 +4656,7 @@ test textDisp-32.2 {elide and tags} {
# hide tag 1, remaining text should not be indented, since
# the indented tag and character is hidden.
.tt tag configure testtag1 -elide 1
- updateText
+ update
#2
lappend res [list [.tt index "1.0 + 0 displaychars"] \
[lindex [.tt bbox 1.0] 0] \
@@ -4138,7 +4667,7 @@ test textDisp-32.2 {elide and tags} {
# indent left margin of tag 2 by 20 pixels
# text should not be indented, since tag1 has lmargin1 of 0.
.tt tag configure testtag2 -lmargin1 20
- updateText
+ update
#3
lappend res [list [.tt index "1.0 + 0 displaychars"] \
[lindex [.tt bbox 1.0] 0] \
@@ -4147,7 +4676,7 @@ test textDisp-32.2 {elide and tags} {
# the bbox of 1.0 should have zero width and zero indent,
# since it is elided at that position.
.tt tag configure testtag1 -elide 1
- updateText
+ update
#4
lappend res [list [.tt index "1.0 + 0 displaychars"] \
[lindex [.tt bbox 1.0] 0] \
@@ -4160,7 +4689,7 @@ test textDisp-32.2 {elide and tags} {
# precedence over testtag1, and is applied to the
# start of the text.
.tt tag configure testtag3 -lmargin1 20
- updateText
+ update
#5
lappend res [list [.tt index "1.0 + 0 displaychars"] \
[lindex [.tt bbox 1.0] 0] \
@@ -4169,7 +4698,7 @@ test textDisp-32.2 {elide and tags} {
# since it still has testtag3 on it. Again the
# bbox of 1.0 should have 0.
.tt tag configure testtag1 -elide 1
- updateText
+ update
#6
lappend res [list [.tt index "1.0 + 0 displaychars"] \
[lindex [.tt bbox 1.0] 0] \
@@ -4207,7 +4736,7 @@ test textDisp-32.3 "NULL undisplayProc problems: #1791052" -setup {
.tt insert end ":)" emoticon
.tt image create end -image $img
pack .tt
- updateText
+ update
} -cleanup {
image delete $img
destroy .tt
@@ -4229,19 +4758,20 @@ test textDisp-32.4 {Button-1 click with elided lines - Bug 18371b7ce7} -setup {
test textDisp-33.0 {one line longer than fits in the widget} {
pack [text .tt -wrap char]
- updateText
+ update
.tt insert 1.0 [string repeat "more wrap + " 300]
- updateText
+ update
.tt see 1.0
lindex [.tt yview] 0
} {0.0}
test textDisp-33.1 {one line longer than fits in the widget} {
destroy .tt
pack [text .tt -wrap char]
- updateText
+ update
.tt insert 1.0 [string repeat "more wrap + " 300]
- updateText
+ update
.tt yview "1.0 +1 displaylines"
+ update
if {[lindex [.tt yview] 0] > 0.1} {
set result "window should be scrolled to the top"
} else {
@@ -4252,7 +4782,7 @@ test textDisp-33.2 {one line longer than fits in the widget} {
destroy .tt
pack [text .tt -wrap char]
.tt debug 1
- updateText
+ update
set tk_textHeightCalc ""
set timer [after 200 lappend tk_textHeightCalc "Timed out"]
.tt insert 1.0 [string repeat "more wrap + " 1]
@@ -4263,23 +4793,18 @@ test textDisp-33.2 {one line longer than fits in the widget} {
test textDisp-33.3 {one line longer than fits in the widget} {
destroy .tt
pack [text .tt -wrap char]
- .tt debug 1
set tk_textHeightCalc ""
.tt insert 1.0 [string repeat "more wrap + " 300]
- updateText
- .tt count -update -ypixels 1.0 end
- updateText
+ update
+ .tt sync
# Each line should have been recalculated just once
- .tt debug 0
expr {[llength $tk_textHeightCalc] == [.tt count -displaylines 1.0 end]}
} {1}
test textDisp-33.4 {one line longer than fits in the widget} {
destroy .tt
pack [text .tt -wrap char]
- .tt debug 1
- set tk_textHeightCalc ""
.tt insert 1.0 [string repeat "more wrap + " 300]
- updateText
+ update
set idx [.tt index "1.0 + 1 displaylines"]
.tt yview $idx
if {[lindex [.tt yview] 0] > 0.1} {
@@ -4288,7 +4813,6 @@ test textDisp-33.4 {one line longer than fits in the widget} {
set result "ok"
}
set idx [.tt index "1.0 + 1 displaylines"]
- .tt debug 0
set result
} {ok}
destroy .tt
@@ -4301,7 +4825,7 @@ test textDisp-33.5 {bold or italic fonts} win {
.tt tag configure bi -font bi
.tt tag configure no -font no
.tt insert end abcd no efgh bi ijkl\n no
- updateText
+ update
set bb {}
for {set i 0} {$i < 12} {incr i 4} {
lappend bb [lindex [.tt bbox 1.$i] 0]
@@ -4325,10 +4849,9 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup {
set result {}
} -body {
.t1 insert end $txt
- .t1 debug 1
set ge [winfo geometry .]
scan $ge "%dx%d+%d+%d" width height left top
- updateText
+ update
.t1 sync
set negative 0
bind .t1 <<WidgetViewSync>> { if {%d < 0} {set negative 1} }
@@ -4338,7 +4861,7 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup {
# Thus we use this way to check for regression regarding bug 2677890,
# i.e. to check that the fix for this bug really is still in.
wm geometry . "[expr {$width * 2}]x$height+$left+$top"
- updateText
+ update
.t1 sync
set negative
} -cleanup {
@@ -4347,6 +4870,11 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup {
test textDisp-35.1 {Init value of charHeight - Dancing scrollbar bug 1499165} -setup {
pack [text .t1] -fill both -expand y -side left
+ # We don't want debug for this test case, because it takes some hours
+ # if valgrind check is fully enabled. In this test case only the scrollbar
+ # behavior is relevant, all other involved functions (insert, see, ...) are
+ # already tested with debug mode in other test cases.
+ .t debug off
.t insert end "[string repeat a\nb\nc\n 500000]THE END\n"
set res {}
} -body {
@@ -4358,9 +4886,26 @@ test textDisp-35.1 {Init value of charHeight - Dancing scrollbar bug 1499165} -s
lappend res [expr {[lindex $fr1 0] == [lindex $fr2 0]}]
lappend res [expr {[lindex $fr1 1] == [lindex $fr2 1]}]
} -cleanup {
+ .t debug on ;# re-enable debugging
destroy .t1
} -result {1 1}
+test textDisp-36.1 {Display bug with 'yview insert'} -constraints {knownBug} -setup {
+ text .t1 -font $fixedFont -width 20 -height 3 -wrap word
+ pack .t1
+ .t1 delete 1.0 end
+ .t1 tag configure elide -elide 1
+ .t1 insert end "Line 1\nThis line is wrapping around two times."
+} -body {
+ .t1 tag add elide 1.3 2.0
+ .t1 yview insert
+ update
+ # wish now panics: "CalculateDisplayLineHeight called with bad indexPtr"
+ .t1 yview scroll -1 pixels
+} -cleanup {
+ destroy .t1
+} -result {}
+
deleteWindows
option clear
diff --git a/tests/textImage.test b/tests/textImage.test
index 2666ec5..0d82bb4 100644
--- a/tests/textImage.test
+++ b/tests/textImage.test
@@ -386,18 +386,20 @@ test textImage-4.2 {alignment checking - baseline} -setup {
.t image create end -image large
.t image create end -image small -align baseline
.t insert end test
+ update
# Sizes larger than 25 can be too big and lead to a negative 'norm',
# at least on Windows XP with certain settings.
foreach size {10 15 20 25} {
- font configure test_font2 -size $size
- array set Metrics [font metrics test_font2]
- update
- foreach {x y w h} [.t bbox small] {}
- set norm [expr {
- (([image height large] - $Metrics(-linespace))/2
- + $Metrics(-ascent) - [image height small] - $y)
+ font configure test_font2 -size $size
+ array set Metrics [font metrics test_font2]
+ update ; # services the idle "TheWorldHasChanged" event, queues "TkWorldChanged" events
+ update ; # services the queued "TkWorldChanged" events
+ foreach {x y w h} [.t bbox small] {}
+ set norm [expr {
+ (([image height large] - $Metrics(-linespace))/2
+ + $Metrics(-ascent) - [image height small] - $y)
}]
- lappend result "$size $norm"
+ lappend result "$size $norm"
}
return $result
} -cleanup {
diff --git a/tests/textIndex.test b/tests/textIndex.test
index a337cda..a191e27 100644
--- a/tests/textIndex.test
+++ b/tests/textIndex.test
@@ -754,6 +754,7 @@ set str [string repeat "hello " 20]
.t insert end "$str one two three four five six seven height nine ten\n"
.t insert end "$str one two three four five six seven height nine ten\n"
.t insert end "$str one two three four five six seven height nine ten\n"
+update
test textIndex-19.1 {Display lines} {
.t index "2.7 displaylinestart"
diff --git a/tests/textWind.test b/tests/textWind.test
index bf9ed41..260ba66 100644
--- a/tests/textWind.test
+++ b/tests/textWind.test
@@ -11,18 +11,6 @@ namespace import ::tcltest::*
tcltest::configure {*}$argv
tcltest::loadTestedCommands
-# Platform specific procedure for updating the text widget.
-
-if {[tk windowingsystem] == "aqua"} {
- proc updateText {} {
- update idletasks
- }
-} else {
- proc updateText {} {
- update
- }
-}
-
deleteWindows
set fixedFont {"Courier" -12}
@@ -36,7 +24,7 @@ set tHeight 6
text .t -width $tWidth -height $tHeight -bd 2 -highlightthickness 2 \
-font $fixedFont
pack .t -expand 1 -fill both
-updateText
+update
.t debug on
set color [expr {[winfo depth .t] > 1 ? "green" : "black"}]
@@ -72,7 +60,7 @@ test textWind-1.1 {basic tests of options} -setup {
.t insert end "\nAnd this is a second line, which wraps around"
frame .f -width 3 -height 3 -bg $color
.t window create 2.2 -window .f
- updateText
+ update
list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] \
[.t window configure .f -window]
} -result [list \
@@ -88,7 +76,7 @@ test textWind-1.2 {basic tests of options} -setup {
.t insert end "\nAnd this is a second line, which wraps around"
frame .f -width 3 -height 3 -bg $color
.t window create 2.2 -window .f -align top
- updateText
+ update
list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] \
[.t window configure .f -align]
} -result [list \
@@ -114,7 +102,7 @@ test textWind-1.4 {basic tests of options} -setup {
# the window .f should be wider than the fixed width
frame .f -width 10 -height 20 -bg $color
.t window create 2.2 -window .f -padx 5
- updateText
+ update
list [winfo geom .f] [.t window configure .f -padx] [.t bbox 2.3]
} -result [list \
10x20+[expr {$padx+2*$fixedWidth+5}]+[expr {$pady+$fixedHeight}] \
@@ -128,7 +116,7 @@ test textWind-1.5 {basic tests of options} -setup {
.t insert end "\nAnd this is a second line, which wraps around"
frame .f -width 10 -height 20 -bg $color
.t window create 2.2 -window .f -pady 4
- updateText
+ update
list [winfo geom .f] [.t window configure .f -pady] [.t bbox 2.31]
} -result [list \
10x20+[expr {$padx+2*$fixedWidth}]+[expr {$pady+$fixedHeight+4}] \
@@ -142,7 +130,7 @@ test textWind-1.6 {basic tests of options} -setup {
.t insert end "\nAnd this is a second line, which wraps around"
frame .f -width 5 -height 5 -bg $color
.t window create 2.2 -window .f -stretch 1
- updateText
+ update
list [winfo geom .f] [.t window configure .f -stretch]
} -result [list \
5x$fixedHeight+[expr {$padx+2*$fixedWidth}]+[expr {$pady+$fixedHeight}] \
@@ -205,7 +193,7 @@ test textWind-2.11 {TkTextWindowCmd procedure} -setup {
.t insert end "\nAnd this is a second line, which wraps around"
frame .f -width 10 -height 6 -bg $color
.t window create 2.2 -window .f -align baseline -padx 1 -pady 2 -create foo
- updateText
+ update
.t window configure .f
} -cleanup {
destroy .f
@@ -221,7 +209,7 @@ test textWind-2.12 {TkTextWindowCmd procedure} -setup {
.t insert end "\nAnd this is a second line, which wraps around"
frame .f -width 10 -height 6 -bg $color
.t window create 2.2 -window .f -align baseline -padx 1 -pady 2 -create foo
- updateText
+ update
list [.t window configure .f -padx 33] [.t window configure .f -padx]
} -cleanup {
destroy .f
@@ -237,7 +225,7 @@ test textWind-2.13 {TkTextWindowCmd procedure} -setup {
.t insert end "\nAnd this is a second line, which wraps around"
frame .f -width 10 -height 6 -bg $color
.t window create 2.2 -window .f -align baseline -padx 1 -pady 2
- updateText
+ update
list [.t window configure .f -padx 14 -pady 15] \
[.t window configure .f -padx] [.t window configure .f -pady]
} -cleanup {
@@ -367,13 +355,13 @@ test textWind-3.3 {EmbWinConfigure procedure} -setup {
frame .f -width 10 -height 20 -bg $color
.t window create 1.3 -window .f
update
+ set res [winfo ismapped .f]
.t window configure 1.3 -window {}
update
- catch {.t index .f}
- list [winfo ismapped .f] [.t bbox 1.4]
+ lappend res [winfo ismapped .f] [.t bbox 1.4]
} -cleanup {
destroy .f
-} -result [list 0 \
+} -result [list 1 0 \
[list [expr {$padx+3*$fixedWidth}] $pady $fixedWidth $fixedHeight]]
test textWind-3.4 {EmbWinConfigure procedure} -setup {
@@ -397,13 +385,13 @@ test textWind-3.5 {EmbWinConfigure procedure} -setup {
frame .t.f -width 10 -height 20 -bg $color
.t window create 1.3 -window .t.f
update
+ set res [winfo ismapped .t.f]
.t window configure 1.3 -window {}
update
- catch {.t index .t.f}
- list [winfo ismapped .t.f] [.t bbox 1.4]
+ lappend res [winfo ismapped .t.f] [.t bbox 1.4]
} -cleanup {
destroy .t.f
-} -result [list 0 \
+} -result [list 1 0 \
[list [expr {$padx+3*$fixedWidth}] $pady $fixedWidth $fixedHeight]]
test textWind-3.6 {EmbWinConfigure procedure} -setup {
@@ -432,6 +420,7 @@ test textWind-3.7 {EmbWinConfigure procedure} -setup {
} -cleanup {
destroy .f
} -returnCodes error -result {can't embed .f.f in .t}
+
test textWind-3.8 {EmbWinConfigure procedure} -setup {
destroy .t2
} -body {
@@ -442,6 +431,7 @@ test textWind-3.8 {EmbWinConfigure procedure} -setup {
} -cleanup {
destroy .t2
} -returnCodes error -result {can't embed .t2 in .t}
+
test textWind-3.9 {EmbWinConfigure procedure} -setup {
destroy .t2
} -body {
@@ -453,6 +443,7 @@ test textWind-3.9 {EmbWinConfigure procedure} -setup {
} -cleanup {
destroy .t2
} -result {-window {} {} {} {}}
+
test textWind-3.10 {EmbWinConfigure procedure} -setup {
.t delete 1.0 end
} -body {
@@ -460,6 +451,7 @@ test textWind-3.10 {EmbWinConfigure procedure} -setup {
.t window create 1.3
.t window configure 1.3 -window .t
} -returnCodes error -result {can't embed .t in .t}
+
test textWind-3.11 {EmbWinConfigure procedure} -setup {
.t delete 1.0 end
} -body {
@@ -469,7 +461,7 @@ test textWind-3.11 {EmbWinConfigure procedure} -setup {
button .t.b -text "Hello!"
.t window create 1.4 -window .t.b
.t window create 1.6 -window .t.b
- updateText
+ update
.t index .t.b
} -result {1.6}
@@ -510,7 +502,7 @@ test textWind-5.1 {EmbWinStructureProc procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 10 -height 20 -bg $color
.t window create 1.2 -window .f
- updateText
+ update
destroy .f
.t index .f
} -returnCodes error -result {bad text index ".f"}
@@ -522,7 +514,7 @@ test textWind-5.2 {EmbWinStructureProc procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 10 -height 20 -bg $color
.t window create 1.2 -window .f
- updateText
+ update
destroy .f
catch {.t index .f}
list [.t bbox 1.2] [.t bbox 1.3]
@@ -538,7 +530,7 @@ test textWind-5.3 {EmbWinStructureProc procedure} -setup {
frame .f -width 10 -height 20 -bg $color
.t window create 1.2 -align bottom
.t window configure 1.2 -window .f
- updateText
+ update
destroy .f
.t index .f
} -returnCodes error -result {bad text index ".f"}
@@ -550,7 +542,7 @@ test textWind-5.4 {EmbWinStructureProc procedure} -setup {
frame .f -width 10 -height 20 -bg $color
.t window create 1.2 -align bottom
.t window configure 1.2 -window .f
- updateText
+ update
destroy .f
catch {.t index .f}
list [.t bbox 1.2] [.t bbox 1.3]
@@ -564,10 +556,10 @@ test textWind-5.5 {EmbWinStructureProc procedure} -setup {
} -body {
.t insert 1.0 "Some sample text"
.t window create 1.2 -create {frame .f -width 10 -height 20 -bg $color}
- updateText
+ update
.t window configure 1.2 -create {frame .f -width 20 -height 10 -bg $color}
destroy .f
- updateText
+ update
list [catch {.t index .f} msg] $msg [.t bbox 1.2] [.t bbox 1.3]
} -result [list 0 1.2 \
[list [expr {$padx+2*$fixedWidth}] [expr {$pady+(($fixedHeight-10)/2)}] 20 10] \
@@ -601,9 +593,9 @@ test textWind-7.1 {EmbWinLostContentProc procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 10 -height 20 -bg $color
.t window create 1.2 -window .f
- updateText
+ update
place .f -in .t -x 100 -y 50
- updateText
+ update
list [winfo geom .f] [.t bbox 1.2]
} -cleanup {
destroy .f
@@ -618,9 +610,9 @@ test textWind-7.2 {EmbWinLostContentProc procedure} -setup {
.t insert 1.0 "Some sample text"
frame .t.f -width 10 -height 20 -bg $color
.t window create 1.2 -window .t.f
- updateText
+ update
place .t.f -x 100 -y 50
- updateText
+ update
list [winfo geom .t.f] [.t bbox 1.2]
} -cleanup {
destroy .t.f
@@ -680,7 +672,7 @@ test textWind-10.1 {EmbWinLayoutProc procedure} -setup {
.t window create 1.5 -create {
frame .f -width 10 -height 20 -bg $color
}
- updateText
+ update
list [winfo exists .f] [winfo width .f] [winfo height .f] [.t index .f]
} -cleanup {
destroy .f
@@ -698,7 +690,7 @@ test textWind-10.2 {EmbWinLayoutProc procedure, error in creating window} -setup
error "couldn't create window"
}
set msg xyzzy
- updateText
+ update
list $msg [.t bbox 1.5]
} -cleanup {
rename bgerror {}
@@ -718,7 +710,7 @@ test textWind-10.3 {EmbWinLayoutProc procedure, error in creating window} -setup
concat gorp
}
set msg xyzzy
- updateText
+ update
list $msg [.t bbox 1.5]
} -cleanup {
rename bgerror {}
@@ -744,7 +736,7 @@ test textWind-10.4 {EmbWinLayoutProc procedure, error in creating window} -setup
}
set count 0
while {([llength $msg] < 2) && ($count < 100)} {
- updateText
+ update
incr count
.t bbox 1.5
after 10
@@ -774,7 +766,7 @@ test textWind-10.5 {EmbWinLayoutProc procedure, error in creating window} -setup
frame .t.f
frame .t.f.f -width 10 -height 20 -bg $color
}
- updateText
+ update
lappend msg [winfo exists .t.f.f]
} -cleanup {
destroy .t.f
@@ -791,12 +783,12 @@ test textWind-10.6 {EmbWinLayoutProc procedure, error in creating window} -setup
}
} -body {
.t insert 1.0 "Some sample text"
- updateText
+ update
.t window create 1.5 -create {
concat .t
}
set msg {}
- updateText
+ update
lappend msg [.t bbox 1.5]
} -cleanup {
rename bgerror {}
@@ -842,9 +834,9 @@ test textWind-10.8 {EmbWinLayoutProc procedure, error in creating window} -setup
concat .t2
}
set msg {}
- updateText
+ update
set i 0
- while {[llength $msg] == 1 && [incr i] < 200} { updateText }
+ while {[llength $msg] == 1 && [incr i] < 200} { update }
return $msg
} -cleanup {
destroy .t2
@@ -858,9 +850,9 @@ test textWind-10.9 {EmbWinLayoutProc procedure, steal window from self} -setup {
.t insert 1.0 ABCDEFGHIJKLMNOP
button .t.b -text "Hello!"
.t window create 1.5 -window .t.b
- updateText
+ update
.t window create 1.3 -create {concat .t.b}
- updateText
+ update
.t index .t.b
} -cleanup {
destroy .t.b
@@ -889,7 +881,7 @@ test textWind-10.11 {EmbWinLayoutProc procedure, doesn't fit on line} -setup {
.t insert 1.0 "Some sample text"
frame .f -width [expr {($tWidth-12)*$fixedWidth}] -height 20 -bg $color -bd 2 -relief raised
.t window create 1.12 -window .f
- updateText
+ update
list [.t bbox .f] [.t bbox 1.13]
} -cleanup {
destroy .f
@@ -905,7 +897,7 @@ test textWind-10.12 {EmbWinLayoutProc procedure, doesn't fit on line} -setup {
.t insert 1.0 "Some sample text"
frame .f -width [expr {($tWidth-12)*$fixedWidth+1}] -height 20 -bg $color -bd 2 -relief raised
.t window create 1.12 -window .f
- updateText
+ update
list [.t bbox .f] [.t bbox 1.13]
} -cleanup {
destroy .f
@@ -921,7 +913,7 @@ test textWind-10.13 {EmbWinLayoutProc procedure, doesn't fit on line} -setup {
.t insert 1.0 "Some sample text"
frame .f -width [expr {($tWidth-12)*$fixedWidth+5}] -height 20 -bg $color -bd 2 -relief raised
.t window create 1.12 -window .f
- updateText
+ update
list [.t bbox .f] [.t bbox 1.13]
} -cleanup {
destroy .f
@@ -937,7 +929,7 @@ test textWind-10.14 {EmbWinLayoutProc procedure, doesn't fit on line} -setup {
.t insert 1.0 "Some sample text"
frame .f -width [expr {($tWidth-12)*$fixedWidth+5}] -height 220 -bg $color -bd 2 -relief raised
.t window create 1.12 -window .f
- updateText
+ update
list [.t bbox .f] [.t bbox 1.13]
} -cleanup {
destroy .f
@@ -953,7 +945,7 @@ test textWind-10.15 {EmbWinLayoutProc procedure, doesn't fit on line} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 250 -height 220 -bg $color -bd 2 -relief raised
.t window create 1.12 -window .f
- updateText
+ update
list [.t bbox .f] [.t bbox 1.13]
} -cleanup {
destroy .f
@@ -966,12 +958,13 @@ test textWind-11.1 {EmbWinDisplayProc procedure, geometry transforms} -setup {
destroy .f
place forget .t
pack .t
-# Make sure the Text is mapped before we start
+ # Make sure the Text is mapped before we start
update
} -body {
.t insert 1.0 "Some sample text"
pack forget .t
place .t -x 30 -y 50
+ update
frame .f -width 30 -height 20 -bg $color
.t window create 1.12 -window .f
update
@@ -986,12 +979,13 @@ test textWind-11.2 {EmbWinDisplayProc procedure, geometry transforms} -setup {
destroy .t.f
place forget .t
pack .t
-# Make sure the Text is mapped before we start
+ # Make sure the Text is mapped before we start
update
} -body {
.t insert 1.0 "Some sample text"
pack forget .t
place .t -x 30 -y 50
+ update
frame .t.f -width 30 -height 20 -bg $color
.t window create 1.12 -window .t.f
update
@@ -1007,7 +1001,7 @@ test textWind-11.3 {EmbWinDisplayProc procedure, configuration optimization} -se
destroy .f
place forget .t
pack .t
-# Make sure the Text is mapped before we start
+ # Make sure the Text is mapped before we start
update
} -body {
.t insert 1.0 "Some sample text"
@@ -1040,7 +1034,7 @@ test textWind-11.4 {EmbWinDisplayProc procedure, horizontal scrolling} -setup {
.t insert end " with junk after it."
.t xview moveto 0
.t xview scroll 5 units
- updateText
+ update
list [winfo ismapped .f] [winfo geom .f] [.t bbox .f] [winfo ismapped .f2]
} -cleanup {
destroy .f .f2
@@ -1061,10 +1055,10 @@ test textWind-11.5 {EmbWinDisplayProc procedure, horizontal scrolling} -setup {
frame .f2 -width 40 -height 10 -bg $color
.t window create end -window .f2
.t insert end " with junk after it."
- updateText
+ update
.t xview moveto 0
.t xview scroll 25 units
- updateText
+ update
list [winfo ismapped .f] [winfo ismapped .f2] [winfo geom .f2] [.t bbox .f2]
} -cleanup {
destroy .f .f2
@@ -1083,19 +1077,20 @@ test textWind-12.1 {EmbWinUndisplayProc procedure, mapping/unmapping} -setup {
bind .f <Map> {lappend x mapped}
bind .f <Unmap> {lappend x unmapped}
set x created
- updateText
+ update
lappend x modified
.t delete 1.0
- updateText
+ update
lappend x replaced
.t window configure .f -window {}
.t delete 1.1
+ update
.t window create 1.4 -window .f
- updateText
+ update
lappend x off-screen
.t configure -wrap none
.t insert 1.0 "Enough text to make the line run off-screen"
- updateText
+ update
return $x
} -cleanup {
destroy .f
@@ -1109,7 +1104,7 @@ test textWind-13.1 {EmbWinBboxProc procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align top -padx 2 -pady 1
- updateText
+ update
list [winfo geom .f] [.t bbox .f]
} -cleanup {
destroy .f
@@ -1124,7 +1119,7 @@ test textWind-13.2 {EmbWinBboxProc procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align center -padx 2 -pady 1
- updateText
+ update
list [winfo geom .f] [.t bbox .f]
} -cleanup {
destroy .f
@@ -1139,7 +1134,7 @@ test textWind-13.3 {EmbWinBboxProc procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align baseline -padx 2 -pady 1
- updateText
+ update
list [winfo geom .f] [.t bbox .f]
} -cleanup {
destroy .f
@@ -1154,7 +1149,7 @@ test textWind-13.4 {EmbWinBboxProc procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align bottom -padx 2 -pady 1
- updateText
+ update
list [winfo geom .f] [.t bbox .f]
} -cleanup {
destroy .f
@@ -1169,7 +1164,7 @@ test textWind-13.5 {EmbWinBboxProc procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align top -padx 2 -pady 1 -stretch 1
- updateText
+ update
list [winfo geom .f] [.t bbox .f]
} -cleanup {
destroy .f
@@ -1184,7 +1179,7 @@ test textWind-13.6 {EmbWinBboxProc procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align center -padx 2 -pady 1 -stretch 1
- updateText
+ update
list [winfo geom .f] [.t bbox .f]
} -cleanup {
destroy .f
@@ -1199,7 +1194,7 @@ test textWind-13.7 {EmbWinBboxProc procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align baseline -padx 2 -pady 1 -stretch 1
- updateText
+ update
list [winfo geom .f] [.t bbox .f]
} -cleanup {
destroy .f
@@ -1214,7 +1209,7 @@ test textWind-13.8 {EmbWinBboxProc procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align bottom -padx 2 -pady 1 -stretch 1
- updateText
+ update
list [winfo geom .f] [.t bbox .f]
} -cleanup {
destroy .f
@@ -1231,7 +1226,7 @@ test textWind-13.9 {EmbWinBboxProc procedure, spacing options} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 5 -height 5 -bg $color
.t window create 1.2 -window .f -align center -padx 2 -pady 1
- updateText
+ update
list [winfo geom .f] [.t bbox .f]
} -cleanup {
.t configure -spacing1 0 -spacing3 0
@@ -1248,14 +1243,14 @@ test textWind-14.1 {EmbWinDelayedUnmap procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 30 -height 20 -bg $color
.t window create 1.2 -window .f
- updateText
+ update
bind .f <Unmap> {lappend x unmapped}
set x modified
.t insert 1.0 x
lappend x removed
.t window configure .f -window {}
lappend x updated
- updateText
+ update
return $x
} -cleanup {
destroy .f
@@ -1268,14 +1263,14 @@ test textWind-14.2 {EmbWinDelayedUnmap procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 30 -height 20 -bg $color
.t window create 1.2 -window .f
- updateText
+ update
bind .f <Unmap> {lappend x unmapped}
set x modified
.t insert 1.0 x
lappend x deleted
.t delete .f
lappend x updated
- updateText
+ update
return $x
} -cleanup {
destroy .f
@@ -1288,10 +1283,10 @@ test textWind-14.3 {EmbWinDelayedUnmap procedure} -setup {
.t insert 1.0 "Some sample text\nAnother line\n3\n4\n5\n6\n7\n8\n9"
frame .f -width 30 -height 20 -bg $color
.t window create 1.2 -window .f
- updateText
+ update
.t yview 2.0
set result [winfo ismapped .f]
- updateText ; after 10
+ update ; after 10
list $result [winfo ismapped .f]
} -cleanup {
destroy .f
@@ -1304,10 +1299,10 @@ test textWind-14.4 {EmbWinDelayedUnmap procedure} -setup {
.t insert 1.0 "Some sample text\nAnother line\n3\n4\n5\n6\n7\n8\n9"
frame .t.f -width 30 -height 20 -bg $color
.t window create 1.2 -window .t.f
- updateText
+ update
.t yview 2.0
set result [winfo ismapped .t.f]
- updateText
+ update
list $result [winfo ismapped .t.f]
} -cleanup {
destroy .t.f
@@ -1345,9 +1340,9 @@ test textWind-16.1 {EmbWinTextStructureProc procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 30 -height 20 -bg $color
.t window create 1.6 -window .f
- updateText
+ update
pack forget .t
- updateText
+ update
winfo ismapped .f
} -cleanup {
pack .t
@@ -1362,12 +1357,12 @@ test textWind-16.2 {EmbWinTextStructureProc procedure} -setup {
.t insert 1.0 "Some sample text"
frame .f -width 30 -height 20 -bg $color
.t window create 1.6 -window .f
- updateText
+ update
set result {}
lappend result [winfo geom .f] [.t bbox .f]
frame .f2 -width 150 -height 30 -bd 2 -relief raised
pack .f2 -before .t
- updateText
+ update
lappend result [winfo geom .f] [.t bbox .f]
} -cleanup {
destroy .f .f2
@@ -1383,9 +1378,9 @@ test textWind-16.3 {EmbWinTextStructureProc procedure} -setup {
.t configure -wrap none
.t insert 1.0 "Some sample text"
.t window create 1.6
- updateText
+ update
pack forget .t
- updateText
+ update
} -cleanup {
pack .t
} -result {}
@@ -1398,9 +1393,9 @@ test textWind-16.4 {EmbWinTextStructureProc procedure} -setup {
.t insert 1.0 "Some sample text"
frame .t.f -width 30 -height 20 -bg $color
.t window create 1.6 -window .t.f
- updateText
+ update
pack forget .t
- updateText
+ update
list [winfo ismapped .t.f] [.t bbox .t.f]
} -cleanup {
pack .t
@@ -1416,7 +1411,7 @@ test textWind-17.1 {peer widgets and embedded windows} -setup {
.t window create 1.3 -window .f
toplevel .tt
pack [.t peer create .tt.t]
- updateText
+ update
destroy .t .tt
winfo exists .f
} -result {0}
@@ -1430,10 +1425,10 @@ test textWind-17.2 {peer widgets and embedded windows} -setup {
.t window create 1.4 -window .f
toplevel .tt
pack [.t peer create .tt.t]
- updateText
+ update
destroy .t
.tt.t insert 1.0 "foo"
- updateText
+ update
destroy .tt
} -result {}
@@ -1445,9 +1440,9 @@ test textWind-17.3 {peer widget and -create} -setup {
.t insert 1.0 "Some sample text"
toplevel .tt
pack [.t peer create .tt.t]
- updateText
+ update
.t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue}
- updateText
+ update
destroy .t .tt
} -result {}
@@ -1461,10 +1456,10 @@ test textWind-17.4 {peer widget deleted one window shouldn't delete others} -set
toplevel .tt
pack [.t peer create .tt.t]
.t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue}
- updateText
+ update
destroy .tt
lappend res [.t get 1.2]
- updateText
+ update
lappend res [.t get 1.2]
} -cleanup {
destroy .t
@@ -1479,7 +1474,7 @@ test textWind-17.5 {peer widget window configuration} -setup {
toplevel .tt
pack [.t peer create .tt.t]
.t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue}
- updateText
+ update
list [.t window cget 1.2 -window] [.tt.t window cget 1.2 -window]
} -cleanup {
destroy .tt .t
@@ -1494,7 +1489,7 @@ test textWind-17.6 {peer widget window configuration} -setup {
toplevel .tt
pack [.t peer create .tt.t]
.t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue}
- updateText
+ update
list [.t window configure 1.2 -window] \
[.tt.t window configure 1.2 -window]
} -cleanup {
@@ -1510,7 +1505,7 @@ test textWind-17.7 {peer widget window configuration} -setup {
toplevel .tt
pack [.t peer create .tt.t]
.t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue]
- updateText
+ update
list [.t window cget 1.2 -window] [.tt.t window cget 1.2 -window]
} -cleanup {
destroy .tt .t
@@ -1525,7 +1520,7 @@ test textWind-17.8 {peer widget window configuration} -setup {
toplevel .tt
pack [.t peer create .tt.t]
.t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue]
- updateText
+ update
list [.t window configure 1.2 -window] \
[.tt.t window configure 1.2 -window]
} -cleanup {
@@ -1541,7 +1536,7 @@ test textWind-17.9 {peer widget window configuration} -setup {
toplevel .tt
pack [.t peer create .tt.t]
.t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue]
- updateText
+ update
.tt.t window configure 1.2 -window [frame .tt.t.f -width 10 -height 20 -bg red]
list [.t window configure 1.2 -window] [.tt.t window configure 1.2 -window]
} -cleanup {
@@ -1557,9 +1552,9 @@ test textWind-17.10 {peer widget window configuration} -setup {
.t insert 1.0 "Some sample text"
toplevel .tt
pack [.t peer create .tt.t]
- updateText
+ update
.t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue]
- updateText
+ update
# There is a blue window in the main widget .t but not in the peer .tt.t
lappend res [.t window cget 1.2 -window]
lappend res [.tt.t window cget 1.2 -window]
@@ -1567,7 +1562,7 @@ test textWind-17.10 {peer widget window configuration} -setup {
# inserted in .t at index 1.2 will now be found in .t at index 1.3
# The underlying linked segments are common in a text widget and its peers.
.tt.t window create 1.2 -window [frame .tt.t.f -width 25 -height 20 -bg green]
- updateText
+ update
lappend res [.t window cget 1.2 -window]
lappend res [.t window cget 1.3 -window]
# In the peer, the green window still is at 1.2, and there is no window at 1.3
@@ -1578,7 +1573,7 @@ test textWind-17.10 {peer widget window configuration} -setup {
# the embedded window found at index 1.2 in .t is the one originally at 1.2 in .t, i.e.
# the blue one
.t window configure 1.2 -create {destroy %W.f ; update ; frame %W.f -width 50 -height 7 -bg red}
- updateText
+ update
# The main widget .t still has a window named .t.f at 1.2. This is NOT the blue
# frame but the red frame from the -create script, which bears the same name.
lappend res [.t window cget 1.2 -window]
@@ -1587,7 +1582,7 @@ test textWind-17.10 {peer widget window configuration} -setup {
# When removing the -window option the create script plays, therefore .t still has
# the red frame .t.f at 1.2
.t window configure 1.2 -window {}
- updateText
+ update
lappend res [.t window cget 1.2 -window]
# The -create script associated to index 1.2 applies to all peers (that's the reason
# why the manual states that "If multiple peer widgets are in use, it is usually simpler
@@ -1595,7 +1590,7 @@ test textWind-17.10 {peer widget window configuration} -setup {
# when removing the -window option in the peer, the -create script is run, which replaces
# the green frame by the red one named as per the -create script, i.e. .tt.t.f
.tt.t window configure 1.2 -window {}
- updateText
+ update
lappend res [.tt.t window cget 1.2 -window]
} -cleanup {
destroy .tt .t
@@ -1609,12 +1604,12 @@ test textWind-18.1 {embedded window deletion triggered by a script bound to <Map
.t window create end -window [frame .f -background red -width 80 -height 80]
.t window create end -window [frame .f2 -background blue -width 80 -height 80]
bind .f <Map> {.t delete .f}
- updateText
+ update
# this shall not crash (bug 1501749)
after 100 {.t yview end}
tkwait visibility .f2
after 200
- updateText
+ update
} -cleanup {
destroy .t .f .f2
} -result {}
@@ -1626,7 +1621,7 @@ test textWind-18.2 {text widget deletion triggered by a script bound to embedded
for {set i 1} {$i < 100} {incr i} {.t insert end "Line $i\n"}
.t window create end -window [frame .f -background red -width 80 -height 80]
bind .f <Map> {destroy .t}
- updateText
+ update
# this shall not crash (bug 1501749)
after 100 {.t yview end}
tkwait window .t
@@ -1644,7 +1639,7 @@ test textWind-18.3 {embedded window destruction in cascade} -setup {
bind .t.b1 <Destroy> {destroy .t.b2 ; set x 1}
button .t.b2
.t window create 2.0 -window .t.b2
- updateText
+ update
# this shall not crash (bug 54fe7a5e71)
after 100 {.t delete 1.0 end}
tkwait variable x
diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test
index e58812a..2b9870e 100644
--- a/tests/ttk/notebook.test
+++ b/tests/ttk/notebook.test
@@ -96,11 +96,11 @@ test notebook-5.1 "Virtual events" -body {
bind .t <<NotebookTabChanged>> { lappend events changed %W }
pack [set nb [ttk::notebook .t.nb]] -expand true -fill both; update
- $nb add [frame $nb.f1]
+ $nb add [frame $nb.f1] ; # triggers <<NotebookTabChanged>> (first tab gets autoselected)
$nb add [frame $nb.f2]
$nb add [frame $nb.f3]
-
- $nb select $nb.f1
+ update
+ $nb select $nb.f1 ; # does not trigger <<NotebookTabChanged>> (tab to select is already selected)
update; set events
} -result [list changed .t.nb]
@@ -156,8 +156,9 @@ test notebook-6.1 "Hide selected tab" -setup {
set result [list]
lappend result [$nb index current] [winfo ismapped $nb.f2]
$nb hide $nb.f2
+ update idletasks
lappend result [$nb index current] [winfo ismapped $nb.f2]
- update idletasks; lappend result [winfo ismapped $nb.f3]
+ lappend result [winfo ismapped $nb.f3]
} -result [list 1 1 2 0 1]
# See 1370833
@@ -187,6 +188,7 @@ test notebook-6.3 "Hide first tab when it's the current" -setup {
set result [list]
lappend result [$nb index current] [winfo ismapped $nb.f1]
$nb hide $nb.f1
+ update idletasks
lappend result [$nb index current] [winfo ismapped $nb.f1]
} -result [list 0 1 1 0]
@@ -202,6 +204,7 @@ test notebook-6.4 "Forget first tab when it's the current" -setup {
set result [list]
lappend result [$nb index current] [winfo ismapped $nb.f1]
$nb forget $nb.f1
+ update idletasks
lappend result [$nb index current] [winfo ismapped $nb.f1]
} -result [list 0 1 0 0]
@@ -217,6 +220,7 @@ test notebook-6.5 "Hide last tab when it's the current" -setup {
set result [list]
lappend result [$nb index current] [winfo ismapped $nb.f3]
$nb hide $nb.f3
+ update idletasks
lappend result [$nb index current] [winfo ismapped $nb.f3]
} -result [list 2 1 1 0]
@@ -232,6 +236,7 @@ test notebook-6.6 "Forget a middle tab when it's the current" -setup {
set result [list]
lappend result [$nb index current] [winfo ismapped $nb.f2]
$nb forget $nb.f2
+ update idletasks
lappend result [$nb index current] [winfo ismapped $nb.f2]
} -result [list 1 1 1 0]
@@ -247,6 +252,7 @@ test notebook-6.7 "Hide a middle tab when it's the current" -setup {
set result [list]
lappend result [$nb index current] [winfo ismapped $nb.f2]
$nb hide $nb.f2
+ update idletasks
lappend result [$nb index current] [winfo ismapped $nb.f2]
} -result [list 1 1 2 0]
@@ -262,6 +268,7 @@ test notebook-6.8 "Forget a non-current tab < current" -setup {
set result [list]
lappend result [$nb index current] [winfo ismapped $nb.f2]
$nb forget $nb.f1
+ update idletasks
lappend result [$nb index current] [winfo ismapped $nb.f2]
} -result [list 1 1 0 1]
@@ -277,6 +284,7 @@ test notebook-6.9 "Hide a non-current tab < current" -setup {
set result [list]
lappend result [$nb index current] [winfo ismapped $nb.f2]
$nb hide $nb.f1
+ update idletasks
lappend result [$nb index current] [winfo ismapped $nb.f2]
} -result [list 1 1 1 1]
@@ -292,6 +300,7 @@ test notebook-6.10 "Forget a non-current tab > current" -setup {
set result [list]
lappend result [$nb index current] [winfo ismapped $nb.f2]
$nb forget $nb.f3
+ update idletasks
lappend result [$nb index current] [winfo ismapped $nb.f2]
} -result [list 1 1 1 1]
@@ -307,6 +316,7 @@ test notebook-6.11 "Hide a non-current tab > current" -setup {
set result [list]
lappend result [$nb index current] [winfo ismapped $nb.f2]
$nb hide $nb.f3
+ update idletasks
lappend result [$nb index current] [winfo ismapped $nb.f2]
} -result [list 1 1 1 1]
@@ -322,8 +332,10 @@ test notebook-6.12 "Hide and re-add a tab" -setup {
set result [list]
lappend result [$nb index current] [$nb tab $nb.f2 -state]
$nb hide $nb.f2
+ update idletasks
lappend result [$nb index current] [$nb tab $nb.f2 -state]
$nb add $nb.f2
+ update idletasks
lappend result [$nb index current] [$nb tab $nb.f2 -state]
} -result [list 1 normal 2 hidden 2 normal]
diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test
index 6a1964b..6059a6f 100644
--- a/tests/ttk/treeview.test
+++ b/tests/ttk/treeview.test
@@ -923,4 +923,27 @@ test treeview-ce470f20fd-4 "changing -stretch resizes columns" -setup {
destroy .tv
} -result {60 50 60 50 60 50 1}
+test treeview-bc602049ab "treeview with custom background does not change size when switching themes" -setup {
+ image create photo tvbg -data {
+ iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAnXAAAJ1wG
+ xbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAACJJREFUOI
+ 1jPLF9+38GKgImaho2auCogaMGjho4auBQMhAAyR0DXUEyypsAAAAASUVORK5CYII=
+ }
+ ttk::style theme create foo-bc602049ab -parent clam -settings {
+ ttk::style element create Treeview.field image tvbg -width 0 -height 0
+ }
+ ttk::style theme use foo-bc602049ab
+ pack [ttk::treeview .tv]
+ update idletasks
+} -body {
+ set g1 [winfo geometry .tv]
+ ttk::style theme use foo-bc602049ab
+ update idletasks
+ set g2 [winfo geometry .tv]
+ expr {$g1 eq $g2 ? 1 : "$g1 --> $g2"}
+} -cleanup {
+ destroy .tv
+ image delete tvbg
+} -result {1}
+
tcltest::cleanupTests
diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test
index ad4c2d5..7e4753a 100644
--- a/tests/ttk/ttk.test
+++ b/tests/ttk/ttk.test
@@ -211,7 +211,7 @@ test ttk-2.8 "bug 3223850: button state disabled during click" -setup {
} -body {
bind .b <ButtonPress-1> {after 0 {.b configure -state disabled}}
after 1 {event generate .b <ButtonPress-1>}
- after 20 {event generate .b <ButtonRelease-1>}
+ after 50 {event generate .b <ButtonRelease-1>}
set aid [after 100 {set ::ttk28 [.b instate {disabled !pressed}]}]
vwait ::ttk28
after cancel $aid
diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test
index d5f6ee3..0981668 100644
--- a/tests/unixEmbed.test
+++ b/tests/unixEmbed.test
@@ -91,23 +91,23 @@ proc colorsFree {w {red 31} {green 245} {blue 192}} {
testConstraint pressbutton [llength [info commands pressbutton]]
test unixEmbed-1.1 {TkpUseWindow procedure, bad window identifier} -constraints {
- unix
+ unix
} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -use xyz
} -returnCodes error -result {expected integer but got "xyz"}
test unixEmbed-1.2 {TkpUseWindow procedure, bad window identifier} -constraints {
- unix
+ unix
} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -use 47
} -returnCodes error -result {couldn't create child of window "47"}
test unixEmbed-1.3 {TkpUseWindow procedure, inheriting colormap} -constraints {
- unix nonPortable
+ unix nonPortable
} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -colormap new
wm geometry .t +0+0
@@ -116,12 +116,12 @@ test unixEmbed-1.3 {TkpUseWindow procedure, inheriting colormap} -constraints {
toplevel .x -use [winfo id .t.f]
colorsFree .x
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {0}
test unixEmbed-1.4 {TkpUseWindow procedure, inheriting colormap} -constraints {
- unix nonPortable
+ unix nonPortable
} -setup {
- deleteWindows
+ deleteWindows
} -body {
toplevel .t -container 1 -colormap new
wm geometry .t +0+0
@@ -129,13 +129,13 @@ test unixEmbed-1.4 {TkpUseWindow procedure, inheriting colormap} -constraints {
toplevel .x -use [winfo id .t]
colorsFree .x
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {1}
test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} -constraints {
- unix testembed notAqua
+ unix testembed notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
@@ -147,7 +147,7 @@ test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} -constra
list [testembed] [expr [lindex [lindex [testembed all] 0] 0] - $w]
}
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {{{XXX {} {} .t}} 0}
test unixEmbed-1.5a {TkpUseWindow procedure, creating Container records} -constraints {
unix testembed
@@ -171,9 +171,9 @@ test unixEmbed-1.5a {TkpUseWindow procedure, creating Container records} -constr
deleteWindows
} -result {{{XXX {} {} .t}} 0}
test unixEmbed-1.6 {TkpUseWindow procedure, creating Container records} -constraints {
- unix testembed notAqua
+ unix testembed notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
@@ -181,13 +181,13 @@ test unixEmbed-1.6 {TkpUseWindow procedure, creating Container records} -constra
dobg "set w1 [winfo id .f1]"
dobg "set w2 [winfo id .f2]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- toplevel .t2 -use $w2
- testembed
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ toplevel .t2 -use $w2
+ testembed
}
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {{XXX {} {} .t2} {XXX {} {} .t1}}
test unixEmbed-1.6a {TkpUseWindow procedure, creating Container records} -constraints {
unix testembed
@@ -213,9 +213,9 @@ test unixEmbed-1.6a {TkpUseWindow procedure, creating Container records} -constr
deleteWindows
} -result {{XXX {} {} .t2} {XXX {} {} .t1}}
test unixEmbed-1.7 {TkpUseWindow procedure, container and embedded in same app} -constraints {
- unix testembed
+ unix testembed
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
@@ -224,7 +224,7 @@ test unixEmbed-1.7 {TkpUseWindow procedure, container and embedded in same app}
toplevel .t2 -use [winfo id .f2]
testembed
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {{XXX .f2 {} .t2} {XXX .f1 {} .t1}}
# Can't think of any way to test the procedures TkpMakeWindow,
@@ -232,25 +232,25 @@ test unixEmbed-1.7 {TkpUseWindow procedure, container and embedded in same app}
test unixEmbed-2.1 {EmbeddedEventProc procedure} -constraints {
- unix testembed notAqua
+ unix testembed notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- testembed
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ testembed
}
destroy .f1
update
dobg {
- testembed
+ testembed
}
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {}
test unixEmbed-2.1a {EmbeddedEventProc procedure} -constraints {
unix testembed
@@ -277,22 +277,22 @@ test unixEmbed-2.1a {EmbeddedEventProc procedure} -constraints {
deleteWindows
} -result {}
test unixEmbed-2.2 {EmbeddedEventProc procedure} -constraints {
- unix testembed notAqua
+ unix testembed notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- testembed
- destroy .t1
- testembed
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ testembed
+ destroy .t1
+ testembed
}
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {}
test unixEmbed-2.2a {EmbeddedEventProc procedure} -constraints {
unix testembed
@@ -317,9 +317,9 @@ test unixEmbed-2.2a {EmbeddedEventProc procedure} -constraints {
deleteWindows
} -result {}
test unixEmbed-2.3 {EmbeddedEventProc procedure} -constraints {
- unix testembed notAqua
+ unix testembed notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
@@ -329,9 +329,9 @@ test unixEmbed-2.3 {EmbeddedEventProc procedure} -constraints {
testembed
} -result {}
test unixEmbed-2.4 {EmbeddedEventProc procedure} -constraints {
- unix testembed
+ unix testembed
} -setup {
- deleteWindows
+ deleteWindows
} -body {
pack [frame .f1 -container 1 -width 200 -height 50]
toplevel .t1 -use [winfo id .f1]
@@ -341,7 +341,7 @@ test unixEmbed-2.4 {EmbeddedEventProc procedure} -constraints {
update
list $x [winfo exists .t1] [winfo exists .f1] [testembed]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result "{{XXX .f1 {} .t1}} 0 0 {}"
@@ -353,13 +353,13 @@ test unixEmbed-3.1 {ContainerEventProc procedure, detect creation} -constraints
dobg "set w1 [winfo id .f1]"
set x [testembed]
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- wm withdraw .t1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ wm withdraw .t1
}
list $x [testembed]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {{{XXX .f1 {} {}}} {{XXX .f1 XXX {}}}}
test unixEmbed-3.1a {ContainerEventProc procedure, detect creation} -constraints {
unix testembed
@@ -383,9 +383,9 @@ test unixEmbed-3.1a {ContainerEventProc procedure, detect creation} -constraints
deleteWindows
} -result {{{XXX .f1 {} {}}} {{XXX .f1 {} {}}}}
test unixEmbed-3.2 {ContainerEventProc procedure, set size on creation} -constraints {
- unix
+ unix
} -setup {
- deleteWindows
+ deleteWindows
update
} -body {
toplevel .t1 -container 1
@@ -394,28 +394,28 @@ test unixEmbed-3.2 {ContainerEventProc procedure, set size on creation} -constra
update
wm geometry .t2
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {200x200+0+0}
test unixEmbed-3.3 {ContainerEventProc procedure, disallow position changes} -constraints {
- unix notAqua
+ unix notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1 -bd 2 -relief raised
- update
- wm geometry .t1 +30+40
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1 -bd 2 -relief raised
+ update
+ wm geometry .t1 +30+40
}
update
dobg {
- wm geometry .t1
+ wm geometry .t1
}
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {200x200+0+0}
test unixEmbed-3.3a {ContainerEventProc procedure, disallow position changes} -constraints {
unix
@@ -441,25 +441,25 @@ test unixEmbed-3.3a {ContainerEventProc procedure, disallow position changes} -c
deleteWindows
} -result {200x200+0+0}
test unixEmbed-3.4 {ContainerEventProc procedure, disallow position changes} -constraints {
- unix notAqua
+ unix notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- update
- wm geometry .t1 300x100+30+40
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ update
+ wm geometry .t1 300x100+30+40
}
update
dobg {
- wm geometry .t1
+ wm geometry .t1
}
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {300x100+0+0}
test unixEmbed-3.4a {ContainerEventProc procedure, disallow position changes} -constraints {
unix
@@ -485,25 +485,25 @@ test unixEmbed-3.4a {ContainerEventProc procedure, disallow position changes} -c
deleteWindows
} -result {300x100+0+0}
test unixEmbed-3.5 {ContainerEventProc procedure, geometry requests} -constraints {
- unix notAqua
+ unix notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
}
update
dobg {
- .t1 configure -width 300 -height 80
+ .t1 configure -width 300 -height 80
}
update
list [winfo width .f1] [winfo height .f1] [dobg {wm geometry .t1}]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {300 80 300x80+0+0}
test unixEmbed-3.5a {ContainerEventProc procedure, geometry requests} -constraints {
unix
@@ -528,27 +528,27 @@ test unixEmbed-3.5a {ContainerEventProc procedure, geometry requests} -constrain
deleteWindows
} -result {300 80 300x80+0+0}
test unixEmbed-3.6 {ContainerEventProc procedure, map requests} -constraints {
- unix notAqua
+ unix notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- set x unmapped
- bind .t1 <Map> {set x mapped}
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ set x unmapped
+ bind .t1 <Map> {set x mapped}
}
update
dobg {
- after 100
- update
- set x
+ after 100
+ update
+ set x
}
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {mapped}
test unixEmbed-3.6a {ContainerEventProc procedure, map requests} -constraints {
unix
@@ -576,9 +576,9 @@ test unixEmbed-3.6a {ContainerEventProc procedure, map requests} -constraints {
deleteWindows
} -result {mapped}
test unixEmbed-3.7 {ContainerEventProc procedure, destroy events} -constraints {
- unix notAqua
+ unix notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
@@ -586,17 +586,17 @@ test unixEmbed-3.7 {ContainerEventProc procedure, destroy events} -constraints {
bind .f1 <Destroy> {set x dead}
set x alive
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
}
update
dobg {
- destroy .t1
+ destroy .t1
}
update
list $x [winfo exists .f1]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {dead 0}
test unixEmbed-3.7a {ContainerEventProc procedure, destroy events} -constraints {
unix
@@ -625,27 +625,27 @@ test unixEmbed-3.7a {ContainerEventProc procedure, destroy events} -constraints
} -result {dead 0}
test unixEmbed-4.1 {EmbedStructureProc procedure, configure events} -constraints {
- unix notAqua
+ unix notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
}
update
dobg {
- .t1 configure -width 180 -height 100
+ .t1 configure -width 180 -height 100
}
update
dobg {
- winfo geometry .t1
+ winfo geometry .t1
}
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {180x100+0+0}
test unixEmbed-4.1a {EmbedStructureProc procedure, configure events} -constraints {
unix
@@ -671,16 +671,16 @@ test unixEmbed-4.1a {EmbedStructureProc procedure, configure events} -constraint
deleteWindows
} -result {180x100+0+0}
test unixEmbed-4.2 {EmbedStructureProc procedure, destroy events} -constraints {
- unix testembed notAqua
+ unix testembed notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
}
update
set x [testembed]
@@ -688,7 +688,7 @@ test unixEmbed-4.2 {EmbedStructureProc procedure, destroy events} -constraints {
update
list $x [testembed]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {{{XXX .f1 XXX {}}} {}}
test unixEmbed-4.2a {EmbedStructureProc procedure, destroy events} -constraints {
unix testembed
@@ -716,25 +716,26 @@ test unixEmbed-4.2a {EmbedStructureProc procedure, destroy events} -constraints
test unixEmbed-5.1 {EmbedFocusProc procedure, FocusIn events} -constraints {
- unix notAqua
+ unix notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
+ update
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- bind .t1 <FocusIn> {lappend x "focus in %W"}
- bind .t1 <FocusOut> {lappend x "focus out %W"}
- set x {}
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ bind .t1 <FocusIn> {lappend x "focus in %W"}
+ bind .t1 <FocusOut> {lappend x "focus out %W"}
+ set x {}
}
focus -force .f1
update
dobg {set x}
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {{focus in .t1}}
test unixEmbed-5.1a {EmbedFocusProc procedure, FocusIn events} -constraints {
unix
@@ -746,6 +747,7 @@ test unixEmbed-5.1a {EmbedFocusProc procedure, FocusIn events} -constraints {
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
+ update
child alias w1 winfo id .f1
child eval {
destroy [winfo child .]
@@ -763,12 +765,13 @@ test unixEmbed-5.1a {EmbedFocusProc procedure, FocusIn events} -constraints {
deleteWindows
} -result {{focus in .t1}}
test unixEmbed-5.2 {EmbedFocusProc procedure, focusing on dead window} -constraints {
- unix notAqua
+ unix notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
+ update
dobg "set w1 [winfo id .f1]"
dobg {
eval destroy [winfo child .]
@@ -776,13 +779,13 @@ test unixEmbed-5.2 {EmbedFocusProc procedure, focusing on dead window} -constrai
}
update
dobg {
- after 200 {destroy .t1}
+ after 200 {destroy .t1}
}
after 400
focus -force .f1
update
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {}
test unixEmbed-5.2a {EmbedFocusProc procedure, focusing on dead window} -constraints {
unix
@@ -794,6 +797,7 @@ test unixEmbed-5.2a {EmbedFocusProc procedure, focusing on dead window} -constra
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
+ update
child alias w1 winfo id .f1
child eval {
destroy [winfo child .]
@@ -809,19 +813,20 @@ test unixEmbed-5.2a {EmbedFocusProc procedure, focusing on dead window} -constra
deleteWindows
} -result {}
test unixEmbed-5.3 {EmbedFocusProc procedure, FocusOut events} -constraints {
- unix notAqua
+ unix notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
+ update
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- bind .t1 <FocusIn> {lappend x "focus in %W"}
- bind .t1 <FocusOut> {lappend x "focus out %W"}
- set x {}
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ bind .t1 <FocusIn> {lappend x "focus in %W"}
+ bind .t1 <FocusOut> {lappend x "focus out %W"}
+ set x {}
}
focus -force .f1
update
@@ -830,7 +835,7 @@ test unixEmbed-5.3 {EmbedFocusProc procedure, FocusOut events} -constraints {
update
list $x [dobg {update; set x}]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {{{focus in .t1}} {{focus in .t1} {focus out .t1}}}
test unixEmbed-5.3a {EmbedFocusProc procedure, FocusOut events} -constraints {
unix
@@ -842,6 +847,7 @@ test unixEmbed-5.3a {EmbedFocusProc procedure, FocusOut events} -constraints {
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
+ update
child alias w1 winfo id .f1
child eval {
destroy [winfo child .]
@@ -864,25 +870,25 @@ test unixEmbed-5.3a {EmbedFocusProc procedure, FocusOut events} -constraints {
test unixEmbed-6.1 {EmbedGeometryRequest procedure, window changes size} -constraints {
- unix notAqua
+ unix notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- update
- bind .t1 <Configure> {lappend x {configure .t1 %w %h}}
- set x {}
- .t1 configure -width 300 -height 120
- update
- list $x [winfo geom .t1]
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ update
+ bind .t1 <Configure> {lappend x {configure .t1 %w %h}}
+ set x {}
+ .t1 configure -width 300 -height 120
+ update
+ list $x [winfo geom .t1]
}
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {{{configure .t1 300 120}} 300x120+0+0}
test unixEmbed-6.1a {EmbedGeometryRequest procedure, window changes size} -constraints {
unix
@@ -910,25 +916,25 @@ test unixEmbed-6.1a {EmbedGeometryRequest procedure, window changes size} -const
deleteWindows
} -result {{configure .t1 300 120} 300x120+0+0}
test unixEmbed-6.2 {EmbedGeometryRequest procedure, window changes size} -constraints {
- unix notAqua
+ unix notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
place .f1 -width 200 -height 200
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
- update
- bind .t1 <Configure> {lappend x {configure .t1 %w %h}}
- set x {}
- .t1 configure -width 300 -height 120
- update
- list $x [winfo geom .t1]
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
+ update
+ bind .t1 <Configure> {lappend x {configure .t1 %w %h}}
+ set x {}
+ .t1 configure -width 300 -height 120
+ update
+ list $x [winfo geom .t1]
}
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {{{configure .t1 200 200}} 200x200+0+0}
test unixEmbed-6.2a {EmbedGeometryRequest procedure, window changes size} -constraints {
unix
@@ -960,32 +966,32 @@ test unixEmbed-6.2a {EmbedGeometryRequest procedure, window changes size} -const
# Can't think up any tests for TkpGetOtherWindow procedure.
test unixEmbed-7.1 {TkpRedirectKeyEvent procedure, forward keystroke} -constraints {
- unix notAqua
+ unix notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
}
focus -force .
bind . <KeyPress> {lappend x {key %A %E}}
set x {}
set y [dobg {
- update
- bind .t1 <KeyPress> {lappend y {key %A}}
- set y {}
- event generate .t1 <KeyPress> -keysym a
- set y
+ update
+ bind .t1 <KeyPress> {lappend y {key %A}}
+ set y {}
+ event generate .t1 <KeyPress> -keysym a
+ set y
}]
update
list $x $y
} -cleanup {
- deleteWindows
+ deleteWindows
bind . <KeyPress> {}
} -result {{{key a 1}} {}}
# TkpRedirectKeyEvent is not implemented in win or aqua. If someone
@@ -1024,16 +1030,16 @@ test unixEmbed-7.1a {TkpRedirectKeyEvent procedure, forward keystroke} -constrai
bind . <KeyPress> {}
} -result {{{key a 1}} {}}
test unixEmbed-7.2 {TkpRedirectKeyEvent procedure, don't forward keystroke width} -constraints {
- unix notAqua
+ unix notAqua
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1
}
update
focus -force .f1
@@ -1041,16 +1047,16 @@ test unixEmbed-7.2 {TkpRedirectKeyEvent procedure, don't forward keystroke width
bind . <KeyPress> {lappend x {key %A}}
set x {}
set y [dobg {
- update
- bind .t1 <KeyPress> {lappend y {key %A}}
- set y {}
- event generate .t1 <KeyPress> -keysym b
- set y
+ update
+ bind .t1 <KeyPress> {lappend y {key %A}}
+ set y {}
+ event generate .t1 <KeyPress> -keysym b
+ set y
}]
update
list $x $y
} -cleanup {
- deleteWindows
+ deleteWindows
bind . <KeyPress> {}
} -result {{} {{key b}}}
test unixEmbed-7.2a {TkpRedirectKeyEvent procedure, don't forward keystroke width} -constraints {
@@ -1091,28 +1097,28 @@ test unixEmbed-7.2a {TkpRedirectKeyEvent procedure, don't forward keystroke widt
test unixEmbed-8.1 {TkpClaimFocus procedure} -constraints {
unix notAqua failsOnUbuntu failsOnXQuarz
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
frame .f2 -width 200 -height 50
pack .f1 .f2
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken
}
focus -force .f2
update
list [dobg {
- focus .t1
- set x [list [focus]]
- update
- after 500
- update
- lappend x [focus]
+ focus .t1
+ set x [list [focus]]
+ update
+ after 500
+ update
+ lappend x [focus]
}] [focus]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {{{} .t1} .f1}
test unixEmbed-8.1a {TkpClaimFocus procedure} -constraints unix -setup {
deleteWindows
@@ -1155,25 +1161,25 @@ test unixEmbed-8.2 {TkpClaimFocus procedure} -constraints unix -setup {
child eval "set argv {-use [winfo id .f1]}"
load {} Tk child
child eval {
- . configure -bd 2 -highlightthickness 2 -relief sunken
+ . configure -bd 2 -highlightthickness 2 -relief sunken
}
focus -force .f2
update
list [child eval {
- focus .
- set x [list [focus]]
- update
- lappend x [focus]
+ focus .
+ set x [list [focus]]
+ update
+ lappend x [focus]
}] [focus]
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {{{} .} .f1}
catch {interp delete child}
test unixEmbed-9.1 {EmbedWindowDeleted procedure, check parentPtr} -constraints {
- unix testembed
+ unix testembed
} -setup {
- deleteWindows
+ deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
@@ -1183,12 +1189,12 @@ test unixEmbed-9.1 {EmbedWindowDeleted procedure, check parentPtr} -constraints
set x {}
lappend x [testembed]
foreach w {.f3 .f4 .f1 .f2} {
- destroy $w
- lappend x [testembed]
+ destroy $w
+ lappend x [testembed]
}
set x
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {{{XXX .f4 {} {}} {XXX .f3 {} {}} {XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f4 {} {}} {XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f2 {} {}}} {}}
test unixEmbed-9.2 {EmbedWindowDeleted procedure, check embeddedPtr} -constraints {
unix testembed notAqua
@@ -1200,15 +1206,15 @@ test unixEmbed-9.2 {EmbedWindowDeleted procedure, check embeddedPtr} -constraint
update
dobg "set w1 [winfo id .f1]"
dobg {
- eval destroy [winfo child .]
- toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken
- set x {}
- lappend x [testembed]
- destroy .t1
- lappend x [testembed]
+ eval destroy [winfo child .]
+ toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken
+ set x {}
+ lappend x [testembed]
+ destroy .t1
+ lappend x [testembed]
}
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {{{XXX {} {} .t1}} {}}
test unixEmbed-9.2a {EmbedWindowDeleted procedure, check embeddedPtr} -constraints {
unix testembed
@@ -1236,36 +1242,35 @@ test unixEmbed-9.2a {EmbedWindowDeleted procedure, check embeddedPtr} -constrain
test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -constraints {
- unix failsOnUbuntu failsOnXQuarz
+ unix
} -setup {
deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
- update idletasks
toplevel .t1 -use [winfo id .f1] -width 150 -height 80
- update idletasks
+ update
wm geometry .t1 +40+50
- update idletasks
+ update
wm geometry .t1
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {150x80+0+0}
test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -constraints {
- unix failsOnUbuntu failsOnXQuarz
+ unix
} -setup {
deleteWindows
} -body {
frame .f1 -container 1 -width 200 -height 50
pack .f1
- update idletasks
+ update
toplevel .t1 -use [winfo id .f1] -width 150 -height 80
- update idletasks
+ update
wm geometry .t1 70x300+10+20
- update idletasks
+ update
wm geometry .t1
} -cleanup {
- deleteWindows
+ deleteWindows
} -result {70x300+0+0}
test unixEmbed-11.1 {focus -force works for embedded toplevels} -constraints {
@@ -1275,9 +1280,9 @@ test unixEmbed-11.1 {focus -force works for embedded toplevels} -constraints {
} -body {
toplevel .t
pack [frame .t.f -container 1 -width 200 -height 200] -fill both
- update idletasks
+ update
toplevel .embed -use [winfo id .t.f] -bg green
- update idletasks
+ update
focus -force .t
focus -force .embed
focus
@@ -1289,34 +1294,35 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints {
} -setup {
deleteWindows
} -body {
- toplevel .main
set result {}
- pack [button .main.b -text "Main Button" \
- -command {lappend result ".main.b"}] -padx 30 -pady 30
- pack [frame .main.f -container 1 -width 200 -height 200] -fill both
- update idletasks
- toplevel .embed -use [winfo id .main.f] -bg green
- pack [button .embed.b -text "Emb Button" \
- -command {lappend result ".embed.b"}] -padx 30 -pady 30
+ toplevel .main
+ update
+ frame .main.f -container 1 -width 200 -height 200
+ button .main.b -text "Main Button" -command {lappend result "pushed .main.b"}
wm geometry .main 200x400+100+100
- update idletasks
+ pack .main.f -fill both
+ pack .main.b -padx 30 -pady 30
+ update
+ toplevel .embed -use [winfo id .main.f] -bg green
+ button .embed.b -text "Emb Button" -command {lappend result "pushed .embed.b"}
+ pack .embed.b -padx 30 -pady 30
+ update
focus -force .main
- after 100
- set x [expr {[winfo x .main ] + [winfo x .main.b] + 40}]
- set y [expr {[winfo y .main ] + [winfo y .main.b] + 38}]
+ update
+ set x [expr {[winfo rootx .main.b] + [winfo width .main.b]/2}]
+ set y [expr {[winfo rooty .main.b] + [winfo height .main.b]/2}]
lappend result [winfo containing $x $y]
- after 200
pressbutton $x $y
update
- set y [expr {$y + 80}]
+ set x [expr {[winfo rootx .embed.b] + [winfo width .embed.b]/2}]
+ set y [expr {[winfo rooty .embed.b] + [winfo height .embed.b]/2}]
lappend result [winfo containing $x $y]
- after 200
pressbutton $x $y
update
set result
} -cleanup {
deleteWindows
-} -result {.main.b .main.b .embed.b .embed.b}
+} -result {.main.b {pushed .main.b} .embed.b {pushed .embed.b}}
# cleanup
diff --git a/tests/unixWm.test b/tests/unixWm.test
index 4f94cc1..e17607d 100644
--- a/tests/unixWm.test
+++ b/tests/unixWm.test
@@ -16,6 +16,17 @@ namespace import -force ::tk::test:loadTkCommand
testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}]
testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
+# Starting with macOS Ventura it became necessary to wait for windows to be restacked
+# or to be raised after creation.
+
+if {[tk windowingsystem] eq "aqua"} {
+ proc restackDelay {} {
+ after 100;
+ }
+} else {
+ proc restackDelay {} {}
+}
+
proc sleep ms {
global x
after $ms {set x 1}
@@ -818,7 +829,7 @@ test unixWm-22.2 {Tk_WmCmd procedure, "iconbitmap" option} {unix testwrapper} {
WM_HINTS] 0]]]
lappend result [wm iconbitmap .t] $bit
} {{} questhead 0x4 {} 0x0}
-if {[tk windowingsystem] == "aqua"} {
+if {[tk windowingsystem] eq "aqua"} {
set result_22_3 {0 {}}
} else {
set result_22_3 {1 {bitmap "bad-bitmap" not defined}}
@@ -1229,7 +1240,7 @@ test unixWm-34.2 {Tk_WmCmd procedure, "sizefrom" option} {unix testwrapper} {
test unixWm-34.3 {Tk_WmCmd procedure, "sizefrom" option} unix {
list [catch {wm sizefrom .t none} msg] $msg
} {1 {bad argument "none": must be program or user}}
-if {[tk windowingsystem] == "aqua"} {
+if {[tk windowingsystem] eq "aqua"} {
set result_35_1 {1 {bad argument "1": must be normal, iconic, withdrawn, or zoomed}}
} else {
set result_35_1 {1 {bad argument "1": must be normal, iconic, or withdrawn}}
@@ -1791,7 +1802,7 @@ test unixWm-49.2 {Tk_GetRootCoords procedure, menubars} {unix testmenubar} {
deleteWindows
wm withdraw .
-if {[tk windowingsystem] == "aqua"} {
+if {[tk windowingsystem] eq "aqua"} {
# Modern mac windows have no border.
set result_50_1 {{} {} .t .t .t2 {} .t2 .t .t}
} else {
@@ -1823,13 +1834,17 @@ test unixWm-50.1 {Tk_CoordsToWindow procedure, finding a toplevel, x-coords, tit
test unixWm-50.2 {Tk_CoordsToWindow procedure, finding a toplevel, y-coords and overrideredirect} unix {
deleteWindows
toplevel .t -width 400 -height 300 -bg yellow
- wm geom .t +100+100
tkwait visibility .t
+ wm geom .t +100+100
+ update
+ restackDelay
toplevel .t2 -width 200 -height 100 -bg blue
+ tkwait visibility .t2
wm overrideredirect .t2 1
wm geom .t2 +200+200
- tkwait visibility .t2
+ update
raise .t2
+ restackDelay
set x [winfo rootx .t]
set y [winfo rooty .t]
set y2 [winfo rooty .t2]
@@ -1879,12 +1894,13 @@ test unixWm-50.4 {Tk_CoordsToWindow procedure, window in other application} unix
catch {interp delete child}
toplevel .t -width 200 -height 200 -bg green
- wm geometry .t +100+100
tkwait visibility .t
+ wm geometry .t +100+100
update
interp create child
load {} Tk child
- child eval {wm geometry . 200x200+100+100; tkwait visibility . ; update}
+ child eval {wm geometry . 200x200+100+100; update}
+ restackDelay
set result [list [winfo containing 200 200] \
[child eval {winfo containing 200 200}]]
interp delete child
@@ -1967,14 +1983,19 @@ test unixWm-50.9 {Tk_CoordsToWindow procedure, unmapped windows} {unix failsOnUb
destroy .t
destroy .t2
toplevel .t -width 200 -height 200 -bg green
- wm geometry .t +0+0
tkwait visibility .t
+ update
+ wm geometry .t +0+0
+ update
toplevel .t2 -width 200 -height 200 -bg red
- wm geometry .t2 +0+0
tkwait visibility .t2
+ update
+ wm geometry .t2 +0+0
+ update
+ restackDelay
set result [list [winfo containing 100 100]]
wm iconify .t2
- update idletasks
+ update
lappend result [winfo containing 100 100]
} {.t2 .t}
test unixWm-50.10 {Tk_CoordsToWindow procedure, unmapped windows} unix {
@@ -2048,24 +2069,28 @@ deleteWindows
test unixWm-51.6 {TkWmRestackToplevel procedure, window to be stacked isn't mapped} unix {
destroy .t
toplevel .t -width 200 -height 200 -bg green
- wm geometry .t +0+0
tkwait visibility .t
+ wm geometry .t +0+0
+ update
+ restackDelay
destroy .t2
toplevel .t2 -width 200 -height 200 -bg red
- wm geometry .t2 +0+0
+ # This test assumes that .t2 is not mapped yet, but that is not really guaranteed.
winfo containing 100 100
} {.t}
test unixWm-51.7 {TkWmRestackToplevel procedure, other window isn't mapped} {unix failsOnXQuarz} {
foreach w {.t .t2 .t3} {
destroy $w
- update
toplevel $w -width 200 -height 200 -bg green
wm geometry $w +0+0
+ update
}
raise .t .t2
+ restackDelay
update
set result [list [winfo containing 100 100]]
lower .t3
+ restackDelay
lappend result [winfo containing 100 100]
} {.t3 .t}
test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix {
@@ -2079,6 +2104,7 @@ test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix
wm overrideredirect .t2 1
wm geometry .t2 +0+0
tkwait visibility .t2
+ restackDelay
# Need to use vrootx and vrooty to make tests work correctly with
# virtual root window measures managers: overrideredirect windows
@@ -2089,12 +2115,14 @@ test unixWm-51.8 {TkWmRestackToplevel procedure, overrideredirect windows} unix
set y [expr 100-[winfo vrooty .]]
set result [list [winfo containing $x $y]]
raise .t
+ restackDelay
lappend result [winfo containing $x $y]
raise .t2
+ restackDelay
lappend result [winfo containing $x $y]
} {.t2 .t .t2}
# The mac won't put an overrideredirect window above the root,
-if {[tk windowingsystem] == "aqua"} {
+if {[tk windowingsystem] eq "aqua"} {
wm withdraw .
}
test unixWm-51.9 {TkWmRestackToplevel procedure, other window overrideredirect} unix {
@@ -2108,6 +2136,7 @@ test unixWm-51.9 {TkWmRestackToplevel procedure, other window overrideredirect}
update
}
lower .t3 .t2
+ restackDelay
update
# Need to use vrootx and vrooty to make tests work correctly with
@@ -2119,9 +2148,10 @@ test unixWm-51.9 {TkWmRestackToplevel procedure, other window overrideredirect}
set y [expr 100-[winfo vrooty .]]
set result [list [winfo containing $x $y]]
lower .t2
+ restackDelay
lappend result [winfo containing $x $y]
} {.t2 .t3}
-if {[tk windowingsystem] == "aqua"} {
+if {[tk windowingsystem] eq "aqua"} {
wm deiconify .
}
test unixWm-51.10 {TkWmRestackToplevel procedure, don't move window that's already in the right place} unix {
@@ -2499,7 +2529,7 @@ test unixWm-59.3 {exit processing} unix {
# NOTE: since [wm attributes] is not guaranteed to have any effect,
# the only thing we can really test here is the syntax.
#
-if {[tk windowingsystem] == "aqua"} {
+if {[tk windowingsystem] eq "aqua"} {
set result_60_1 {-alpha 1.0 -fullscreen 0 -modified 0 -notify 0\
-titlepath {} -topmost 0 -transparent 0\
-type unsupported}
diff --git a/tests/winfo.test b/tests/winfo.test
index 750444f..045696d 100644
--- a/tests/winfo.test
+++ b/tests/winfo.test
@@ -399,7 +399,7 @@ test winfo-13.1 {root coordinates of embedded toplevel} -setup {
# Windows does not destroy the container when an embedded window is
# destroyed. Unix and macOS do destroy it. See ticket [67384bce7d].
-if {[tk windowingsystem] == "win32"} {
+if {[tk windowingsystem] eq "win32"} {
set result_13_2 {embedded 0 container 1}
} else {
set result_13_2 {embedded 0 container 0}
diff --git a/tests/wm.test b/tests/wm.test
index 52a2422..cce4ee4 100644
--- a/tests/wm.test
+++ b/tests/wm.test
@@ -1347,6 +1347,7 @@ deleteWindows
test wm-stackorder-2.1 {stacking order} -body {
toplevel .t ; update
+ raiseDelay
wm stackorder .
} -cleanup {
destroy .t
@@ -1399,6 +1400,7 @@ test wm-stackorder-2.5 {stacking order} -setup {
} -result {.parent.child2 .parent.child1 .parent}
test wm-stackorder-2.6 {stacking order: non-toplevel widgets ignored} -body {
toplevel .t1
+ raiseDelay
button .t1.b
pack .t1.b
update
@@ -1418,6 +1420,7 @@ test wm-stackorder-3.1 {unmapped toplevel} -constraints {failsOnUbuntu failsOnXQ
toplevel .t1 ; update
toplevel .t2 ; update
wm iconify .t1
+ raiseDelay
wm stackorder .
} -cleanup {
destroy .t1 .t2
@@ -1426,6 +1429,7 @@ test wm-stackorder-3.2 {unmapped toplevel} -body {
toplevel .t1 ; update
toplevel .t2 ; update
wm withdraw .t2
+ raiseDelay
wm stackorder .
} -cleanup {
destroy .t1 .t2
@@ -1459,6 +1463,7 @@ test wm-stackorder-3.6 {unmapped toplevel} -body {
toplevel .t1.t2 ; update
toplevel .t1.t2.t3 ; update
wm withdraw .t1.t2
+ raiseDelay
wm stackorder .t1
} -cleanup {
destroy .t1
@@ -1561,10 +1566,11 @@ test wm-stackorder-5.3 {An overrideredirect window\
} -result 1
test wm-stackorder-6.1 {An embedded toplevel does not appear in the \
- stacking order} -body {
+ stacking order} -body {
toplevel .real -container 1
+ raiseDelay
toplevel .embd -bg blue -use [winfo id .real]
- update
+ raiseDelay
wm stackorder .
} -cleanup {
deleteWindows
@@ -1936,7 +1942,7 @@ test wm-transient-8.1 {transient to withdrawn window, Bug 1163496} -constraints
lappend result [winfo ismapped .t1] [winfo ismapped .t2]
wm deiconify .t1; update
lappend result [winfo ismapped .t1] [winfo ismapped .t2]
- raise .t1; update
+ raise .t1; raiseDelay; update
lappend result [lsearch -all -inline -glob [wm stackorder .] ".t?"]
} -cleanup {
deleteWindows
@@ -2311,7 +2317,7 @@ test wm-forget-1.4 "pack into unmapped toplevel causes crash" -body {
test wm-forget-2 {bug [e9112ef96e] - [wm forget] doesn't completely} -setup {
catch {destroy .l .f.b .f}
set res {}
- if {[tk windowingsystem] == "aqua"} {
+ if {[tk windowingsystem] eq "aqua"} {
proc doUpdate {} {update idletasks}
} else {
proc doUpdate {} {update}
diff --git a/unix/Makefile.in b/unix/Makefile.in
index f3055fb..e98070e 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -396,15 +396,14 @@ X11_OBJS = tkUnix.o tkUnix3d.o tkUnixButton.o tkUnixColor.o tkUnixConfig.o \
AQUA_OBJS = tkMacOSXBitmap.o tkMacOSXButton.o tkMacOSXClipboard.o \
tkMacOSXColor.o tkMacOSXConfig.o tkMacOSXCursor.o tkMacOSXDebug.o \
tkMacOSXDialog.o tkMacOSXDraw.o tkMacOSXEmbed.o tkMacOSXEntry.o \
- tkMacOSXEvent.o tkMacOSXFont.o tkMacOSXHLEvents.o tkMacOSXImage.o \
- tkMacOSXInit.o tkMacOSXKeyboard.o tkMacOSXKeyEvent.o \
- tkMacOSXMenu.o \
- tkMacOSXMenubutton.o tkMacOSXMenus.o tkMacOSXMouseEvent.o \
- tkMacOSXNotify.o tkMacOSXRegion.o tkMacOSXScrlbr.o tkMacOSXSend.o \
- tkMacOSXServices.o tkMacOSXSubwindows.o tkMacOSXWindowEvent.o \
- tkMacOSXWm.o tkMacOSXXStubs.o \
- tkFileFilter.o tkMacWinMenu.o tkPointer.o tkUnix3d.o tkUnixScale.o \
- xcolors.o xdraw.o xgc.o ximage.o xutil.o \
+ tkMacOSXEvent.o tkMacOSXFileTypes.o tkMacOSXFont.o tkMacOSXHLEvents.o \
+ tkMacOSXImage.o tkMacOSXInit.o tkMacOSXKeyboard.o tkMacOSXKeyEvent.o \
+ tkMacOSXMenu.o tkMacOSXMenubutton.o tkMacOSXMenus.o \
+ tkMacOSXMouseEvent.o tkMacOSXNotify.o tkMacOSXRegion.o \
+ tkMacOSXScrlbr.o tkMacOSXSend.o tkMacOSXServices.o \
+ tkMacOSXSubwindows.o tkMacOSXWindowEvent.o tkMacOSXWm.o \
+ tkMacOSXXStubs.o tkFileFilter.o tkMacWinMenu.o tkPointer.o tkUnix3d.o \
+ tkUnixScale.o xcolors.o xdraw.o xgc.o ximage.o xutil.o \
ttkMacOSXTheme.o
AQUA_TKTEST_OBJS = tkMacOSXTest.o
@@ -521,8 +520,8 @@ AQUA_SRCS = \
$(MAC_OSX_DIR)/tkMacOSXDebug.c $(MAC_OSX_DIR)/tkMacOSXDialog.c \
$(MAC_OSX_DIR)/tkMacOSXDraw.c $(MAC_OSX_DIR)/tkMacOSXEmbed.c \
$(MAC_OSX_DIR)/tkMacOSXEntry.c $(MAC_OSX_DIR)/tkMacOSXEvent.c \
- $(MAC_OSX_DIR)/tkMacOSXFont.c $(MAC_OSX_DIR)/tkMacOSXHLEvents.c \
- $(MAC_OSX_DIR)/tkMacOSXImage.c \
+ $(MAC_OSX_DIR)/tkMacOSXFont.c $(MAC_OSX_DIR)/tkMacOSXFileTypes.c\
+ $(MAC_OSX_DIR)/tkMacOSXHLEvents.c $(MAC_OSX_DIR)/tkMacOSXImage.c \
$(MAC_OSX_DIR)/tkMacOSXInit.c $(MAC_OSX_DIR)/tkMacOSXKeyboard.c \
$(MAC_OSX_DIR)/tkMacOSXKeyEvent.c \
$(MAC_OSX_DIR)/tkMacOSXMenu.c \
@@ -553,7 +552,8 @@ AQUA_XLIB_HDRS = $(XLIB_DIR)/X11/*.h $(XLIB_DIR)/xbytes.h
AQUA_PRIVATE_HDRS = $(MAC_OSX_DIR)/tkMacOSXPort.h $(MAC_OSX_DIR)/tkMacOSXInt.h
-X11_PRIVATE_HDRS = $(UNIX_DIR)/tkUnixPort.h $(UNIX_DIR)/tkUnixInt.h $(GENERIC_DIR)/tkIntXlibDecls.h
+X11_PRIVATE_HDRS = $(UNIX_DIR)/tkUnixPort.h $(UNIX_DIR)/tkUnixInt.h $(GENERIC_DIR)/tkIntXlibDecls.h \
+ $(UNIX_DIR)/tkUnixDefault.h
# Currently private, eventually public
TTK_HDRS = $(TTK_DIR)/ttkTheme.h $(TTK_DIR)/ttkDecls.h
@@ -911,7 +911,7 @@ clean:
distclean: clean
rm -rf Makefile config.status config.cache config.log tkConfig.sh \
- tkConfig.h *.plist Tk.framework tk.pc
+ tkConfig.h *.plist Tk.framework tk.pc tkUuid.h
depend:
makedepend -- $(DEPEND_SWITCHES) -- $(SRCS)
@@ -1274,6 +1274,9 @@ tkMacOSXEntry.o: $(MAC_OSX_DIR)/tkMacOSXEntry.c
tkMacOSXEvent.o: $(MAC_OSX_DIR)/tkMacOSXEvent.c
$(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXEvent.c
+tkMacOSXFileTypes.o: $(MAC_OSX_DIR)/tkMacOSXFileTypes.c
+ $(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXFileTypes.c
+
tkMacOSXFont.o: $(MAC_OSX_DIR)/tkMacOSXFont.c
$(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXFont.c
diff --git a/unix/configure b/unix/configure
index 035c1f8..a1eea6f 100755
--- a/unix/configure
+++ b/unix/configure
@@ -9437,6 +9437,9 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit -framework QuartzCore"
+ if test -d "/System/Library/Frameworks/UniformTypeIdentifiers.framework"; then
+ LIBS="$LIBS -framework UniformTypeIdentifiers"
+ fi
EXTRA_CC_SWITCHES='-std=gnu99 -x objective-c'
TK_WINDOWINGSYSTEM=AQUA
if test -n "${enable_symbols}" -a "${enable_symbols}" != no; then
diff --git a/unix/configure.in b/unix/configure.in
index 6805020..b483ce0 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -352,6 +352,9 @@ fi
if test $tk_aqua = yes; then
AC_DEFINE(MAC_OSX_TK, 1, [Are we building TkAqua?])
LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit -framework QuartzCore"
+ if test -d "/System/Library/Frameworks/UniformTypeIdentifiers.framework"; then
+ LIBS="$LIBS -framework UniformTypeIdentifiers"
+ fi
EXTRA_CC_SWITCHES='-std=gnu99 -x objective-c'
TK_WINDOWINGSYSTEM=AQUA
if test -n "${enable_symbols}" -a "${enable_symbols}" != no; then
diff --git a/unix/tkUnixDialog.c b/unix/tkUnixDialog.c
index afe443f..a149610 100644
--- a/unix/tkUnixDialog.c
+++ b/unix/tkUnixDialog.c
@@ -166,7 +166,7 @@ Tk_GetSaveFileObjCmd(
* See user documentation.
*
* Side effects:
- * None. The MessageBox window will be destroy before this procedure
+ * None. The MessageBox window will be destroyed before this procedure
* returns.
*
*----------------------------------------------------------------------
diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h
index 27be5b9..156eb04 100644
--- a/unix/tkUnixPort.h
+++ b/unix/tkUnixPort.h
@@ -194,10 +194,4 @@
sprintf((buf), "0x%08lx", (unsigned long) (w))
#endif
-/*
- * Used by tkWindow.c
- */
-
-#define TkpHandleMapOrUnmap(tkwin, event) Tk_HandleEvent(event)
-
#endif /* _UNIXPORT */
diff --git a/win/Makefile.in b/win/Makefile.in
index 7903efc..2b7c2f1 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -732,7 +732,7 @@ clean: cleanhelp
distclean: clean
$(RM) Makefile config.status config.cache config.log tkConfig.sh \
- wish.exe.manifest
+ wish.exe.manifest tkUuid.h
Makefile: $(SRC_DIR)/Makefile.in
./config.status
diff --git a/win/configure b/win/configure
index ade169b..3ee0b4b 100755
--- a/win/configure
+++ b/win/configure
@@ -5371,7 +5371,7 @@ TK_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}"
TK_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
TK_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
-eval "TK_SRC_DIR=\"`cd $srcdir/..; pwd`\""
+eval "TK_SRC_DIR=\"`cd $srcdir/..; $CYGPATH $(pwd)`\""
eval "TK_DLL_FILE=tk$VER${DLLSUFFIX}"
if test ${SHARED_BUILD} = 0 -o "$GCC" != "yes" ; then
@@ -5386,14 +5386,14 @@ eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}"
# we also need to double check about spaces in path names
eval "TK_LIB_FLAG=\"-ltk${VER}${LIBFLAGSUFFIX}\""
TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}"
-TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}"
+eval "TK_BUILD_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TK_LIB_FLAG}\""
eval "TK_STUB_LIB_FLAG=\"-ltkstub${VER}${LIBFLAGSUFFIX}\""
-TK_BUILD_STUB_LIB_SPEC="-L`pwd` ${TK_STUB_LIB_FLAG}"
+eval "TK_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TK_STUB_LIB_FLAG}\""
TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}"
TK_STUB_LIB_PATH="${libdir}/${TK_STUB_LIB_FILE}"
-TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}"
+eval "TK_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TK_STUB_LIB_FILE}\""
eval "DLLSUFFIX=${DLLSUFFIX}"
eval "LIBPREFIX=${LIBPREFIX}"
diff --git a/win/configure.in b/win/configure.in
index 57bc8ec..53bf9a8 100644
--- a/win/configure.in
+++ b/win/configure.in
@@ -195,7 +195,7 @@ TK_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}"
TK_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
TK_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
-eval "TK_SRC_DIR=\"`cd $srcdir/..; pwd`\""
+eval "TK_SRC_DIR=\"`cd $srcdir/..; $CYGPATH $(pwd)`\""
eval "TK_DLL_FILE=tk$VER${DLLSUFFIX}"
if test ${SHARED_BUILD} = 0 -o "$GCC" != "yes" ; then
@@ -210,14 +210,14 @@ eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}"
# we also need to double check about spaces in path names
eval "TK_LIB_FLAG=\"-ltk${VER}${LIBFLAGSUFFIX}\""
TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}"
-TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}"
+eval "TK_BUILD_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TK_LIB_FLAG}\""
eval "TK_STUB_LIB_FLAG=\"-ltkstub${VER}${LIBFLAGSUFFIX}\""
-TK_BUILD_STUB_LIB_SPEC="-L`pwd` ${TK_STUB_LIB_FLAG}"
+eval "TK_BUILD_STUB_LIB_SPEC=\"-L`$CYGPATH $(pwd)` ${TK_STUB_LIB_FLAG}\""
TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}"
TK_STUB_LIB_PATH="${libdir}/${TK_STUB_LIB_FILE}"
-TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}"
+eval "TK_BUILD_STUB_LIB_PATH=\"`$CYGPATH $(pwd)`/${TK_STUB_LIB_FILE}\""
eval "DLLSUFFIX=${DLLSUFFIX}"
eval "LIBPREFIX=${LIBPREFIX}"
diff --git a/win/rules.vc b/win/rules.vc
index 47c0742..fdc68e0 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -693,7 +693,7 @@ LINKERFLAGS = $(LINKERFLAGS) -ltcg
!if [echo REM = This file is generated from rules.vc > versions.vc]
!endif
!if [echo TCL_MAJOR_VERSION = \>> versions.vc] \
- && [nmakehlp -V "$(_TCL_H)" TCL_MAJOR_VERSION >> versions.vc]
+ && [nmakehlp -V "$(_TCL_H)" "define TCL_MAJOR_VERSION" >> versions.vc]
!endif
!if [echo TCL_MINOR_VERSION = \>> versions.vc] \
&& [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc]
@@ -1418,7 +1418,7 @@ OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_DO64BIT
OPTDEFINES = $(OPTDEFINES) /DNO_STRTOI64=1
!endif
-!if "$(TCL_MAJOR_VERSION)" == "8"
+!if $(TCL_MAJOR_VERSION) == 8
!if "$(_USE_64BIT_TIME_T)" == "1"
OPTDEFINES = $(OPTDEFINES) /D_USE_64BIT_TIME_T=1
!endif
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 176ba88..da13e48 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -1900,7 +1900,7 @@ GetFileName(
*
* OFNHookProc --
*
- * Dialog box hook function. This is used to sets the "tk_dialog"
+ * Dialog box hook function. This is used to set the "tk_dialog"
* variable for test/debugging when the dialog is ready to receive
* messages. When multiple file selection is enabled this function
* is used to process the list of names.
@@ -2779,7 +2779,7 @@ ChooseDirectoryValidateProc(
* See user documentation.
*
* Side effects:
- * None. The MessageBox window will be destroy before this function
+ * None. The MessageBox window will be destroyed before this function
* returns.
*
*----------------------------------------------------------------------
diff --git a/win/tkWinPort.h b/win/tkWinPort.h
index 7978730..e5e9e6c 100644
--- a/win/tkWinPort.h
+++ b/win/tkWinPort.h
@@ -126,12 +126,6 @@
| ((p)->green & 0xff00) | (((p)->blue << 8) & 0xff0000)) | 0x20000000)
/*
- * Used by tkWindow.c
- */
-
-#define TkpHandleMapOrUnmap(tkwin, event) Tk_HandleEvent(event)
-
-/*
* These calls implement native bitmaps which are not currently
* supported under Windows. The macros eliminate the calls.
*/
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 9495f7d..f27a965 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -131,7 +131,7 @@ typedef struct {
} ICONDIR, *LPICONDIR;
/*
- * A pointer to one of these strucutures is associated with each toplevel.
+ * A pointer to one of these structures is associated with each toplevel.
* This allows us to free up all memory associated with icon resources when a
* window is deleted or if the window's icon is changed. They are simply
* reference counted according to:
@@ -7978,7 +7978,7 @@ WmProc(
winPtr = GetTopLevel(hwnd);
if (winPtr && (TkGrabState(winPtr) == TK_GRAB_EXCLUDED)) {
/*
- * This window is outside the grab heirarchy, so don't let any of
+ * This window is outside the grab hierarchy, so don't let any of
* the normal non-client processing occur. Note that this
* implementation is not strictly correct because the grab might
* change between now and when the event would have been processed
diff --git a/xlib/X11/HPkeysym.h b/xlib/X11/HPkeysym.h
index 4a0655a..d41ed38 100644
--- a/xlib/X11/HPkeysym.h
+++ b/xlib/X11/HPkeysym.h
@@ -46,7 +46,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD
-TO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+TO THIS SOFTWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. Hewlett-Packard shall not be liable for errors
contained herein or direct, indirect, special, incidental or
diff --git a/xlib/X11/XF86keysym.h b/xlib/X11/XF86keysym.h
index dd287e2..e8a9fb8 100755
--- a/xlib/X11/XF86keysym.h
+++ b/xlib/X11/XF86keysym.h
@@ -3,8 +3,10 @@
*
* The XFree86 keysym range is 0x10080001 - 0x1008FFFF.
*
- * X.Org will not be adding to the XF86 set of keysyms, though they have
- * been adopted and are considered a "standard" part of X keysym definitions.
+ * The XF86 set of keysyms is a catch-all set of defines for keysyms found
+ * on various multimedia keyboards. Originally specific to XFree86 they have
+ * been been adopted over time and are considered a "standard" part of X
+ * keysym definitions.
* XFree86 never properly commented these keysyms, so we have done our
* best to explain the semantic meaning of these keys.
*
@@ -207,6 +209,8 @@
#define XF86XK_RotationLockToggle 0x1008FFB7 /* Toggle screen rotation lock on/off */
+#define XF86XK_FullScreen 0x1008FFB8 /* Toggle fullscreen */
+
/* Keys for special action keys (hot keys) */
/* Virtual terminals on some operating systems */
#define XF86XK_Switch_VT_1 0x1008FE01
@@ -228,3 +232,238 @@
#define XF86XK_Prev_VMode 0x1008FE23 /* prev. video mode available */
#define XF86XK_LogWindowTree 0x1008FE24 /* print window tree to log */
#define XF86XK_LogGrabInfo 0x1008FE25 /* print all active grabs to log */
+
+
+/*
+ * Reserved range for evdev symbols: 0x10081000-0x10081FFF
+ *
+ * Key syms within this range must match the Linux kernel
+ * input-event-codes.h file in the format:
+ * XF86XK_CamelCaseKernelName _EVDEVK(kernel value)
+ * For example, the kernel
+ * #define KEY_MACRO_RECORD_START 0x2b0
+ * effectively ends up as:
+ * #define XF86XK_MacroRecordStart 0x100812b0
+ *
+ * For historical reasons, some keysyms within the reserved range will be
+ * missing, most notably all "normal" keys that are mapped through default
+ * XKB layouts (e.g. KEY_Q).
+ *
+ * CamelCasing is done with a human control as last authority, e.g. see VOD
+ * instead of Vod for the Video on Demand key.
+ *
+ * The format for #defines is strict:
+ *
+ * #define XF86XK_FOO<tab...>_EVDEVK(0xABC)<tab><tab> |* kver KEY_FOO *|
+ *
+ * Where
+ * - alignment by tabs
+ * - the _EVDEVK macro must be used
+ * - the hex code must be in uppercase hex
+ * - the kernel version (kver) is in the form v5.10
+ * - kver and key name are within a slash-star comment (a pipe is used in
+ * this example for technical reasons)
+ * These #defines are parsed by scripts. Do not stray from the given format.
+ *
+ * Where the evdev keycode is mapped to a different symbol, please add a
+ * comment line starting with Use: but otherwise the same format, e.g.
+ * Use: XF86XK_RotationLockToggle _EVDEVK(0x231) v4.16 KEY_ROTATE_LOCK_TOGGLE
+ *
+ */
+#define _EVDEVK(_v) (0x10081000 + _v)
+/* Use: XF86XK_Eject _EVDEVK(0x0A2) KEY_EJECTCLOSECD */
+/* Use: XF86XK_New _EVDEVK(0x0B5) v2.6.14 KEY_NEW */
+/* Use: XK_Redo _EVDEVK(0x0B6) v2.6.14 KEY_REDO */
+/* KEY_DASHBOARD has been mapped to LaunchB in xkeyboard-config since 2011 */
+/* Use: XF86XK_LaunchB _EVDEVK(0x0CC) v2.6.28 KEY_DASHBOARD */
+/* Use: XF86XK_Display _EVDEVK(0x0E3) v2.6.12 KEY_SWITCHVIDEOMODE */
+/* Use: XF86XK_KbdLightOnOff _EVDEVK(0x0E4) v2.6.12 KEY_KBDILLUMTOGGLE */
+/* Use: XF86XK_KbdBrightnessDown _EVDEVK(0x0E5) v2.6.12 KEY_KBDILLUMDOWN */
+/* Use: XF86XK_KbdBrightnessUp _EVDEVK(0x0E6) v2.6.12 KEY_KBDILLUMUP */
+/* Use: XF86XK_Send _EVDEVK(0x0E7) v2.6.14 KEY_SEND */
+/* Use: XF86XK_Reply _EVDEVK(0x0E8) v2.6.14 KEY_REPLY */
+/* Use: XF86XK_MailForward _EVDEVK(0x0E9) v2.6.14 KEY_FORWARDMAIL */
+/* Use: XF86XK_Save _EVDEVK(0x0EA) v2.6.14 KEY_SAVE */
+/* Use: XF86XK_Documents _EVDEVK(0x0EB) v2.6.14 KEY_DOCUMENTS */
+/* Use: XF86XK_Battery _EVDEVK(0x0EC) v2.6.17 KEY_BATTERY */
+/* Use: XF86XK_Bluetooth _EVDEVK(0x0ED) v2.6.19 KEY_BLUETOOTH */
+/* Use: XF86XK_WLAN _EVDEVK(0x0EE) v2.6.19 KEY_WLAN */
+/* Use: XF86XK_UWB _EVDEVK(0x0EF) v2.6.24 KEY_UWB */
+/* Use: XF86XK_Next_VMode _EVDEVK(0x0F1) v2.6.23 KEY_VIDEO_NEXT */
+/* Use: XF86XK_Prev_VMode _EVDEVK(0x0F2) v2.6.23 KEY_VIDEO_PREV */
+/* Use: XF86XK_MonBrightnessCycle _EVDEVK(0x0F3) v2.6.23 KEY_BRIGHTNESS_CYCLE */
+#define XF86XK_BrightnessAuto _EVDEVK(0x0F4) /* v3.16 KEY_BRIGHTNESS_AUTO */
+#define XF86XK_DisplayOff _EVDEVK(0x0F5) /* v2.6.23 KEY_DISPLAY_OFF */
+/* Use: XF86XK_WWAN _EVDEVK(0x0F6) v3.13 KEY_WWAN */
+/* Use: XF86XK_RFKill _EVDEVK(0x0F7) v2.6.33 KEY_RFKILL */
+/* Use: XF86XK_AudioMicMute _EVDEVK(0x0F8) v3.1 KEY_MICMUTE */
+#define XF86XK_Info _EVDEVK(0x166) /* KEY_INFO */
+/* Use: XF86XK_CycleAngle _EVDEVK(0x173) KEY_ANGLE */
+/* Use: XF86XK_FullScreen _EVDEVK(0x174) v5.1 KEY_FULL_SCREEN */
+#define XF86XK_AspectRatio _EVDEVK(0x177) /* v5.1 KEY_ASPECT_RATIO */
+#define XF86XK_DVD _EVDEVK(0x185) /* KEY_DVD */
+#define XF86XK_Audio _EVDEVK(0x188) /* KEY_AUDIO */
+/* Use: XF86XK_Video _EVDEVK(0x189) KEY_VIDEO */
+/* Use: XF86XK_Calendar _EVDEVK(0x18D) KEY_CALENDAR */
+#define XF86XK_ChannelUp _EVDEVK(0x192) /* KEY_CHANNELUP */
+#define XF86XK_ChannelDown _EVDEVK(0x193) /* KEY_CHANNELDOWN */
+/* Use: XF86XK_AudioRandomPlay _EVDEVK(0x19A) KEY_SHUFFLE */
+#define XF86XK_Break _EVDEVK(0x19B) /* KEY_BREAK */
+#define XF86XK_VideoPhone _EVDEVK(0x1A0) /* v2.6.20 KEY_VIDEOPHONE */
+/* Use: XF86XK_Game _EVDEVK(0x1A1) v2.6.20 KEY_GAMES */
+/* Use: XF86XK_ZoomIn _EVDEVK(0x1A2) v2.6.20 KEY_ZOOMIN */
+/* Use: XF86XK_ZoomOut _EVDEVK(0x1A3) v2.6.20 KEY_ZOOMOUT */
+#define XF86XK_ZoomReset _EVDEVK(0x1A4) /* v2.6.20 KEY_ZOOMRESET */
+/* Use: XF86XK_Word _EVDEVK(0x1A5) v2.6.20 KEY_WORDPROCESSOR */
+#define XF86XK_Editor _EVDEVK(0x1A6) /* v2.6.20 KEY_EDITOR */
+/* Use: XF86XK_Excel _EVDEVK(0x1A7) v2.6.20 KEY_SPREADSHEET */
+#define XF86XK_GraphicsEditor _EVDEVK(0x1A8) /* v2.6.20 KEY_GRAPHICSEDITOR */
+#define XF86XK_Presentation _EVDEVK(0x1A9) /* v2.6.20 KEY_PRESENTATION */
+#define XF86XK_Database _EVDEVK(0x1AA) /* v2.6.20 KEY_DATABASE */
+/* Use: XF86XK_News _EVDEVK(0x1AB) v2.6.20 KEY_NEWS */
+#define XF86XK_Voicemail _EVDEVK(0x1AC) /* v2.6.20 KEY_VOICEMAIL */
+#define XF86XK_Addressbook _EVDEVK(0x1AD) /* v2.6.20 KEY_ADDRESSBOOK */
+/* Use: XF86XK_Messenger _EVDEVK(0x1AE) v2.6.20 KEY_MESSENGER */
+#define XF86XK_DisplayToggle _EVDEVK(0x1AF) /* v2.6.20 KEY_DISPLAYTOGGLE */
+#define XF86XK_SpellCheck _EVDEVK(0x1B0) /* v2.6.24 KEY_SPELLCHECK */
+/* Use: XF86XK_LogOff _EVDEVK(0x1B1) v2.6.24 KEY_LOGOFF */
+/* Use: XK_dollar _EVDEVK(0x1B2) v2.6.24 KEY_DOLLAR */
+/* Use: XK_EuroSign _EVDEVK(0x1B3) v2.6.24 KEY_EURO */
+/* Use: XF86XK_FrameBack _EVDEVK(0x1B4) v2.6.24 KEY_FRAMEBACK */
+/* Use: XF86XK_FrameForward _EVDEVK(0x1B5) v2.6.24 KEY_FRAMEFORWARD */
+#define XF86XK_ContextMenu _EVDEVK(0x1B6) /* v2.6.24 KEY_CONTEXT_MENU */
+#define XF86XK_MediaRepeat _EVDEVK(0x1B7) /* v2.6.26 KEY_MEDIA_REPEAT */
+#define XF86XK_10ChannelsUp _EVDEVK(0x1B8) /* v2.6.38 KEY_10CHANNELSUP */
+#define XF86XK_10ChannelsDown _EVDEVK(0x1B9) /* v2.6.38 KEY_10CHANNELSDOWN */
+#define XF86XK_Images _EVDEVK(0x1BA) /* v2.6.39 KEY_IMAGES */
+#define XF86XK_NotificationCenter _EVDEVK(0x1BC) /* v5.10 KEY_NOTIFICATION_CENTER */
+#define XF86XK_PickupPhone _EVDEVK(0x1BD) /* v5.10 KEY_PICKUP_PHONE */
+#define XF86XK_HangupPhone _EVDEVK(0x1BE) /* v5.10 KEY_HANGUP_PHONE */
+#define XF86XK_Fn _EVDEVK(0x1D0) /* KEY_FN */
+#define XF86XK_Fn_Esc _EVDEVK(0x1D1) /* KEY_FN_ESC */
+#define XF86XK_FnRightShift _EVDEVK(0x1E5) /* v5.10 KEY_FN_RIGHT_SHIFT */
+/* Use: XK_braille_dot_1 _EVDEVK(0x1F1) v2.6.17 KEY_BRL_DOT1 */
+/* Use: XK_braille_dot_2 _EVDEVK(0x1F2) v2.6.17 KEY_BRL_DOT2 */
+/* Use: XK_braille_dot_3 _EVDEVK(0x1F3) v2.6.17 KEY_BRL_DOT3 */
+/* Use: XK_braille_dot_4 _EVDEVK(0x1F4) v2.6.17 KEY_BRL_DOT4 */
+/* Use: XK_braille_dot_5 _EVDEVK(0x1F5) v2.6.17 KEY_BRL_DOT5 */
+/* Use: XK_braille_dot_6 _EVDEVK(0x1F6) v2.6.17 KEY_BRL_DOT6 */
+/* Use: XK_braille_dot_7 _EVDEVK(0x1F7) v2.6.17 KEY_BRL_DOT7 */
+/* Use: XK_braille_dot_8 _EVDEVK(0x1F8) v2.6.17 KEY_BRL_DOT8 */
+/* Use: XK_braille_dot_9 _EVDEVK(0x1F9) v2.6.23 KEY_BRL_DOT9 */
+/* Use: XK_braille_dot_1 _EVDEVK(0x1FA) v2.6.23 KEY_BRL_DOT10 */
+#define XF86XK_Numeric0 _EVDEVK(0x200) /* v2.6.28 KEY_NUMERIC_0 */
+#define XF86XK_Numeric1 _EVDEVK(0x201) /* v2.6.28 KEY_NUMERIC_1 */
+#define XF86XK_Numeric2 _EVDEVK(0x202) /* v2.6.28 KEY_NUMERIC_2 */
+#define XF86XK_Numeric3 _EVDEVK(0x203) /* v2.6.28 KEY_NUMERIC_3 */
+#define XF86XK_Numeric4 _EVDEVK(0x204) /* v2.6.28 KEY_NUMERIC_4 */
+#define XF86XK_Numeric5 _EVDEVK(0x205) /* v2.6.28 KEY_NUMERIC_5 */
+#define XF86XK_Numeric6 _EVDEVK(0x206) /* v2.6.28 KEY_NUMERIC_6 */
+#define XF86XK_Numeric7 _EVDEVK(0x207) /* v2.6.28 KEY_NUMERIC_7 */
+#define XF86XK_Numeric8 _EVDEVK(0x208) /* v2.6.28 KEY_NUMERIC_8 */
+#define XF86XK_Numeric9 _EVDEVK(0x209) /* v2.6.28 KEY_NUMERIC_9 */
+#define XF86XK_NumericStar _EVDEVK(0x20A) /* v2.6.28 KEY_NUMERIC_STAR */
+#define XF86XK_NumericPound _EVDEVK(0x20B) /* v2.6.28 KEY_NUMERIC_POUND */
+#define XF86XK_NumericA _EVDEVK(0x20C) /* v4.1 KEY_NUMERIC_A */
+#define XF86XK_NumericB _EVDEVK(0x20D) /* v4.1 KEY_NUMERIC_B */
+#define XF86XK_NumericC _EVDEVK(0x20E) /* v4.1 KEY_NUMERIC_C */
+#define XF86XK_NumericD _EVDEVK(0x20F) /* v4.1 KEY_NUMERIC_D */
+#define XF86XK_CameraFocus _EVDEVK(0x210) /* v2.6.33 KEY_CAMERA_FOCUS */
+#define XF86XK_WPSButton _EVDEVK(0x211) /* v2.6.34 KEY_WPS_BUTTON */
+/* Use: XF86XK_TouchpadToggle _EVDEVK(0x212) v2.6.37 KEY_TOUCHPAD_TOGGLE */
+/* Use: XF86XK_TouchpadOn _EVDEVK(0x213) v2.6.37 KEY_TOUCHPAD_ON */
+/* Use: XF86XK_TouchpadOff _EVDEVK(0x214) v2.6.37 KEY_TOUCHPAD_OFF */
+#define XF86XK_CameraZoomIn _EVDEVK(0x215) /* v2.6.39 KEY_CAMERA_ZOOMIN */
+#define XF86XK_CameraZoomOut _EVDEVK(0x216) /* v2.6.39 KEY_CAMERA_ZOOMOUT */
+#define XF86XK_CameraUp _EVDEVK(0x217) /* v2.6.39 KEY_CAMERA_UP */
+#define XF86XK_CameraDown _EVDEVK(0x218) /* v2.6.39 KEY_CAMERA_DOWN */
+#define XF86XK_CameraLeft _EVDEVK(0x219) /* v2.6.39 KEY_CAMERA_LEFT */
+#define XF86XK_CameraRight _EVDEVK(0x21A) /* v2.6.39 KEY_CAMERA_RIGHT */
+#define XF86XK_AttendantOn _EVDEVK(0x21B) /* v3.10 KEY_ATTENDANT_ON */
+#define XF86XK_AttendantOff _EVDEVK(0x21C) /* v3.10 KEY_ATTENDANT_OFF */
+#define XF86XK_AttendantToggle _EVDEVK(0x21D) /* v3.10 KEY_ATTENDANT_TOGGLE */
+#define XF86XK_LightsToggle _EVDEVK(0x21E) /* v3.10 KEY_LIGHTS_TOGGLE */
+#define XF86XK_ALSToggle _EVDEVK(0x230) /* v3.13 KEY_ALS_TOGGLE */
+/* Use: XF86XK_RotationLockToggle _EVDEVK(0x231) v4.16 KEY_ROTATE_LOCK_TOGGLE */
+#define XF86XK_Buttonconfig _EVDEVK(0x240) /* v3.16 KEY_BUTTONCONFIG */
+#define XF86XK_Taskmanager _EVDEVK(0x241) /* v3.16 KEY_TASKMANAGER */
+#define XF86XK_Journal _EVDEVK(0x242) /* v3.16 KEY_JOURNAL */
+#define XF86XK_ControlPanel _EVDEVK(0x243) /* v3.16 KEY_CONTROLPANEL */
+#define XF86XK_AppSelect _EVDEVK(0x244) /* v3.16 KEY_APPSELECT */
+#define XF86XK_Screensaver _EVDEVK(0x245) /* v3.16 KEY_SCREENSAVER */
+#define XF86XK_VoiceCommand _EVDEVK(0x246) /* v3.16 KEY_VOICECOMMAND */
+#define XF86XK_Assistant _EVDEVK(0x247) /* v4.13 KEY_ASSISTANT */
+/* Use: XK_ISO_Next_Group _EVDEVK(0x248) v5.2 KEY_KBD_LAYOUT_NEXT */
+#define XF86XK_EmojiPicker _EVDEVK(0x249) /* v5.13 KEY_EMOJI_PICKER */
+#define XF86XK_Dictate _EVDEVK(0x24A) /* v5.17 KEY_DICTATE */
+#define XF86XK_BrightnessMin _EVDEVK(0x250) /* v3.16 KEY_BRIGHTNESS_MIN */
+#define XF86XK_BrightnessMax _EVDEVK(0x251) /* v3.16 KEY_BRIGHTNESS_MAX */
+#define XF86XK_KbdInputAssistPrev _EVDEVK(0x260) /* v3.18 KEY_KBDINPUTASSIST_PREV */
+#define XF86XK_KbdInputAssistNext _EVDEVK(0x261) /* v3.18 KEY_KBDINPUTASSIST_NEXT */
+#define XF86XK_KbdInputAssistPrevgroup _EVDEVK(0x262) /* v3.18 KEY_KBDINPUTASSIST_PREVGROUP */
+#define XF86XK_KbdInputAssistNextgroup _EVDEVK(0x263) /* v3.18 KEY_KBDINPUTASSIST_NEXTGROUP */
+#define XF86XK_KbdInputAssistAccept _EVDEVK(0x264) /* v3.18 KEY_KBDINPUTASSIST_ACCEPT */
+#define XF86XK_KbdInputAssistCancel _EVDEVK(0x265) /* v3.18 KEY_KBDINPUTASSIST_CANCEL */
+#define XF86XK_RightUp _EVDEVK(0x266) /* v4.7 KEY_RIGHT_UP */
+#define XF86XK_RightDown _EVDEVK(0x267) /* v4.7 KEY_RIGHT_DOWN */
+#define XF86XK_LeftUp _EVDEVK(0x268) /* v4.7 KEY_LEFT_UP */
+#define XF86XK_LeftDown _EVDEVK(0x269) /* v4.7 KEY_LEFT_DOWN */
+#define XF86XK_RootMenu _EVDEVK(0x26A) /* v4.7 KEY_ROOT_MENU */
+#define XF86XK_MediaTopMenu _EVDEVK(0x26B) /* v4.7 KEY_MEDIA_TOP_MENU */
+#define XF86XK_Numeric11 _EVDEVK(0x26C) /* v4.7 KEY_NUMERIC_11 */
+#define XF86XK_Numeric12 _EVDEVK(0x26D) /* v4.7 KEY_NUMERIC_12 */
+#define XF86XK_AudioDesc _EVDEVK(0x26E) /* v4.7 KEY_AUDIO_DESC */
+#define XF86XK_3DMode _EVDEVK(0x26F) /* v4.7 KEY_3D_MODE */
+#define XF86XK_NextFavorite _EVDEVK(0x270) /* v4.7 KEY_NEXT_FAVORITE */
+#define XF86XK_StopRecord _EVDEVK(0x271) /* v4.7 KEY_STOP_RECORD */
+#define XF86XK_PauseRecord _EVDEVK(0x272) /* v4.7 KEY_PAUSE_RECORD */
+#define XF86XK_VOD _EVDEVK(0x273) /* v4.7 KEY_VOD */
+#define XF86XK_Unmute _EVDEVK(0x274) /* v4.7 KEY_UNMUTE */
+#define XF86XK_FastReverse _EVDEVK(0x275) /* v4.7 KEY_FASTREVERSE */
+#define XF86XK_SlowReverse _EVDEVK(0x276) /* v4.7 KEY_SLOWREVERSE */
+#define XF86XK_Data _EVDEVK(0x277) /* v4.7 KEY_DATA */
+#define XF86XK_OnScreenKeyboard _EVDEVK(0x278) /* v4.12 KEY_ONSCREEN_KEYBOARD */
+#define XF86XK_PrivacyScreenToggle _EVDEVK(0x279) /* v5.5 KEY_PRIVACY_SCREEN_TOGGLE */
+#define XF86XK_SelectiveScreenshot _EVDEVK(0x27A) /* v5.6 KEY_SELECTIVE_SCREENSHOT */
+#define XF86XK_Macro1 _EVDEVK(0x290) /* v5.5 KEY_MACRO1 */
+#define XF86XK_Macro2 _EVDEVK(0x291) /* v5.5 KEY_MACRO2 */
+#define XF86XK_Macro3 _EVDEVK(0x292) /* v5.5 KEY_MACRO3 */
+#define XF86XK_Macro4 _EVDEVK(0x293) /* v5.5 KEY_MACRO4 */
+#define XF86XK_Macro5 _EVDEVK(0x294) /* v5.5 KEY_MACRO5 */
+#define XF86XK_Macro6 _EVDEVK(0x295) /* v5.5 KEY_MACRO6 */
+#define XF86XK_Macro7 _EVDEVK(0x296) /* v5.5 KEY_MACRO7 */
+#define XF86XK_Macro8 _EVDEVK(0x297) /* v5.5 KEY_MACRO8 */
+#define XF86XK_Macro9 _EVDEVK(0x298) /* v5.5 KEY_MACRO9 */
+#define XF86XK_Macro10 _EVDEVK(0x299) /* v5.5 KEY_MACRO10 */
+#define XF86XK_Macro11 _EVDEVK(0x29A) /* v5.5 KEY_MACRO11 */
+#define XF86XK_Macro12 _EVDEVK(0x29B) /* v5.5 KEY_MACRO12 */
+#define XF86XK_Macro13 _EVDEVK(0x29C) /* v5.5 KEY_MACRO13 */
+#define XF86XK_Macro14 _EVDEVK(0x29D) /* v5.5 KEY_MACRO14 */
+#define XF86XK_Macro15 _EVDEVK(0x29E) /* v5.5 KEY_MACRO15 */
+#define XF86XK_Macro16 _EVDEVK(0x29F) /* v5.5 KEY_MACRO16 */
+#define XF86XK_Macro17 _EVDEVK(0x2A0) /* v5.5 KEY_MACRO17 */
+#define XF86XK_Macro18 _EVDEVK(0x2A1) /* v5.5 KEY_MACRO18 */
+#define XF86XK_Macro19 _EVDEVK(0x2A2) /* v5.5 KEY_MACRO19 */
+#define XF86XK_Macro20 _EVDEVK(0x2A3) /* v5.5 KEY_MACRO20 */
+#define XF86XK_Macro21 _EVDEVK(0x2A4) /* v5.5 KEY_MACRO21 */
+#define XF86XK_Macro22 _EVDEVK(0x2A5) /* v5.5 KEY_MACRO22 */
+#define XF86XK_Macro23 _EVDEVK(0x2A6) /* v5.5 KEY_MACRO23 */
+#define XF86XK_Macro24 _EVDEVK(0x2A7) /* v5.5 KEY_MACRO24 */
+#define XF86XK_Macro25 _EVDEVK(0x2A8) /* v5.5 KEY_MACRO25 */
+#define XF86XK_Macro26 _EVDEVK(0x2A9) /* v5.5 KEY_MACRO26 */
+#define XF86XK_Macro27 _EVDEVK(0x2AA) /* v5.5 KEY_MACRO27 */
+#define XF86XK_Macro28 _EVDEVK(0x2AB) /* v5.5 KEY_MACRO28 */
+#define XF86XK_Macro29 _EVDEVK(0x2AC) /* v5.5 KEY_MACRO29 */
+#define XF86XK_Macro30 _EVDEVK(0x2AD) /* v5.5 KEY_MACRO30 */
+#define XF86XK_MacroRecordStart _EVDEVK(0x2B0) /* v5.5 KEY_MACRO_RECORD_START */
+#define XF86XK_MacroRecordStop _EVDEVK(0x2B1) /* v5.5 KEY_MACRO_RECORD_STOP */
+#define XF86XK_MacroPresetCycle _EVDEVK(0x2B2) /* v5.5 KEY_MACRO_PRESET_CYCLE */
+#define XF86XK_MacroPreset1 _EVDEVK(0x2B3) /* v5.5 KEY_MACRO_PRESET1 */
+#define XF86XK_MacroPreset2 _EVDEVK(0x2B4) /* v5.5 KEY_MACRO_PRESET2 */
+#define XF86XK_MacroPreset3 _EVDEVK(0x2B5) /* v5.5 KEY_MACRO_PRESET3 */
+#define XF86XK_KbdLcdMenu1 _EVDEVK(0x2B8) /* v5.5 KEY_KBD_LCD_MENU1 */
+#define XF86XK_KbdLcdMenu2 _EVDEVK(0x2B9) /* v5.5 KEY_KBD_LCD_MENU2 */
+#define XF86XK_KbdLcdMenu3 _EVDEVK(0x2BA) /* v5.5 KEY_KBD_LCD_MENU3 */
+#define XF86XK_KbdLcdMenu4 _EVDEVK(0x2BB) /* v5.5 KEY_KBD_LCD_MENU4 */
+#define XF86XK_KbdLcdMenu5 _EVDEVK(0x2BC) /* v5.5 KEY_KBD_LCD_MENU5 */
+#undef _EVDEVK
diff --git a/xlib/X11/Xfuncproto.h b/xlib/X11/Xfuncproto.h
index 6d63002..f689073 100644
--- a/xlib/X11/Xfuncproto.h
+++ b/xlib/X11/Xfuncproto.h
@@ -1,16 +1,26 @@
-/* $XConsortium: Xfuncproto.h,v 1.7 91/05/13 20:49:21 rws Exp $ */
/*
- * Copyright 1989, 1991 by the Massachusetts Institute of Technology
*
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission. M.I.T. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
+Copyright 1989, 1991, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
*
*/
@@ -24,7 +34,7 @@
#endif /* NeedFunctionPrototypes */
#ifndef NeedVarargsPrototypes
-#define NeedVarargsPrototypes 0
+#define NeedVarargsPrototypes 1
#endif /* NeedVarargsPrototypes */
#if NeedFunctionPrototypes
@@ -37,6 +47,15 @@
#define _Xconst const
#endif /* _Xconst */
+/* Function prototype configuration (see configure for more info) */
+#if !defined(NARROWPROTO) && \
+ (defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__))
+#define NARROWPROTO
+#endif
+#ifndef FUNCPROTO
+#define FUNCPROTO 15
+#endif
+
#ifndef NeedWidePrototypes
#ifdef NARROWPROTO
#define NeedWidePrototypes 0
@@ -47,14 +66,164 @@
#endif /* NeedFunctionPrototypes */
-#ifdef __cplusplus
-#define _XFUNCPROTOBEGIN extern "C" {
-#define _XFUNCPROTOEND }
-#endif
-
#ifndef _XFUNCPROTOBEGIN
+#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
+#define _XFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
+#define _XFUNCPROTOEND }
+#else
#define _XFUNCPROTOBEGIN
#define _XFUNCPROTOEND
+#endif
#endif /* _XFUNCPROTOBEGIN */
+/* http://clang.llvm.org/docs/LanguageExtensions.html#has-attribute */
+#ifndef __has_attribute
+# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
+#endif
+#ifndef __has_feature
+# define __has_feature(x) 0 /* Compatibility with non-clang compilers. */
+#endif
+#ifndef __has_extension
+# define __has_extension(x) 0 /* Compatibility with non-clang compilers. */
+#endif
+
+/* Added in X11R6.9, so available in any version of modular xproto */
+#if __has_attribute(__sentinel__) || (defined(__GNUC__) && (__GNUC__ >= 4))
+# define _X_SENTINEL(x) __attribute__ ((__sentinel__(x)))
+#else
+# define _X_SENTINEL(x)
+#endif /* GNUC >= 4 */
+
+/* Added in X11R6.9, so available in any version of modular xproto */
+#if (__has_attribute(visibility) || (defined(__GNUC__) && (__GNUC__ >= 4))) \
+ && !defined(__CYGWIN__) && !defined(__MINGW32__)
+# define _X_EXPORT __attribute__((visibility("default")))
+# define _X_HIDDEN __attribute__((visibility("hidden")))
+# define _X_INTERNAL __attribute__((visibility("internal")))
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+# define _X_EXPORT __global
+# define _X_HIDDEN __hidden
+# define _X_INTERNAL __hidden
+#else /* not gcc >= 4 and not Sun Studio >= 8 */
+# define _X_EXPORT
+# define _X_HIDDEN
+# define _X_INTERNAL
+#endif /* GNUC >= 4 */
+
+/* Branch prediction hints for individual conditionals */
+/* requires xproto >= 7.0.9 */
+#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
+# define _X_LIKELY(x) __builtin_expect(!!(x), 1)
+# define _X_UNLIKELY(x) __builtin_expect(!!(x), 0)
+#else /* not gcc >= 3.3 */
+# define _X_LIKELY(x) (x)
+# define _X_UNLIKELY(x) (x)
+#endif
+
+/* Bulk branch prediction hints via marking error path functions as "cold" */
+/* requires xproto >= 7.0.25 */
+#if __has_attribute(__cold__) || \
+ (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403)) /* 4.3+ */
+# define _X_COLD __attribute__((__cold__))
+#else
+# define _X_COLD /* nothing */
+#endif
+
+/* Added in X11R6.9, so available in any version of modular xproto */
+#if __has_attribute(deprecated) \
+ || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)) \
+ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5130))
+# define _X_DEPRECATED __attribute__((deprecated))
+#else /* not gcc >= 3.1 */
+# define _X_DEPRECATED
+#endif
+
+/* requires xproto >= 7.0.30 */
+#if __has_extension(attribute_deprecated_with_message) || \
+ (defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5))))
+# define _X_DEPRECATED_MSG(_msg) __attribute__((deprecated(_msg)))
+#else
+# define _X_DEPRECATED_MSG(_msg) _X_DEPRECATED
+#endif
+
+/* requires xproto >= 7.0.17 */
+#if __has_attribute(noreturn) \
+ || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \
+ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define _X_NORETURN __attribute((noreturn))
+#else
+# define _X_NORETURN
+#endif /* GNUC */
+
+/* Added in X11R6.9, so available in any version of modular xproto */
+#if __has_attribute(__format__) \
+ || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203)
+# define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y)))
+#else /* not gcc >= 2.3 */
+# define _X_ATTRIBUTE_PRINTF(x,y)
+#endif
+
+/* requires xproto >= 7.0.22 - since this uses either gcc or C99 variable
+ argument macros, must be only used inside #ifdef _X_NONNULL guards, as
+ many legacy X clients are compiled in C89 mode still. */
+#if __has_attribute(nonnull) \
+ && defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */
+#define _X_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
+#elif __has_attribute(nonnull) \
+ || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
+#define _X_NONNULL(args...) __attribute__((nonnull(args)))
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */
+#define _X_NONNULL(...) /* */
+#endif
+
+/* requires xproto >= 7.0.22 */
+#if __has_attribute(__unused__) \
+ || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)
+#define _X_UNUSED __attribute__((__unused__))
+#else
+#define _X_UNUSED /* */
+#endif
+
+/* C99 keyword "inline" or equivalent extensions in pre-C99 compilers */
+/* requires xproto >= 7.0.9
+ (introduced in 7.0.8 but didn't support all compilers until 7.0.9) */
+#if defined(inline) /* assume autoconf set it correctly */ || \
+ (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */ || \
+ (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550))
+# define _X_INLINE inline
+#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */
+# define _X_INLINE __inline__
+#else
+# define _X_INLINE
+#endif
+
+/* C99 keyword "restrict" or equivalent extensions in pre-C99 compilers */
+/* requires xproto >= 7.0.21 */
+#ifndef _X_RESTRICT_KYWD
+# if defined(restrict) /* assume autoconf set it correctly */ || \
+ (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */ \
+ && !defined(__cplusplus)) /* Workaround g++ issue on Solaris */
+# define _X_RESTRICT_KYWD restrict
+# elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */
+# define _X_RESTRICT_KYWD __restrict__
+# else
+# define _X_RESTRICT_KYWD
+# endif
+#endif
+
+/* requires xproto >= 7.0.30 */
+#if __has_attribute(no_sanitize_thread)
+# define _X_NOTSAN __attribute__((no_sanitize_thread))
+#else
+# define _X_NOTSAN
+#endif
+
+/* Mark a char array/pointer as not containing a NUL-terminated string */
+/* requires xproto >= 7.0.33 */
+#if __has_attribute(nonstring)
+# define _X_NONSTRING __attribute__((nonstring))
+#else
+# define _X_NONSTRING
+#endif
+
#endif /* _XFUNCPROTO_H_ */
diff --git a/xlib/X11/Xutil.h b/xlib/X11/Xutil.h
index bf372fb..f377e2b 100644
--- a/xlib/X11/Xutil.h
+++ b/xlib/X11/Xutil.h
@@ -1,8 +1,30 @@
-/* $XConsortium: Xutil.h,v 11.73 91/07/30 16:21:37 rws Exp $ */
/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
@@ -10,7 +32,7 @@ Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or MIT not be
+supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
@@ -24,10 +46,20 @@ SOFTWARE.
******************************************************************/
-#ifndef _XUTIL_H_
-#define _XUTIL_H_
+#ifndef _X11_XUTIL_H_
+#define _X11_XUTIL_H_
/* You must include <X11/Xlib.h> before including this file */
+#include <X11/Xlib.h>
+#include <X11/keysym.h>
+
+/* The Xlib structs are full of implicit padding to properly align members.
+ We can't clean that up without breaking ABI, so tell clang not to bother
+ complaining about it. */
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpadded"
+#endif
#if defined(MAC_OSX_TK)
# define Region XRegion
@@ -112,6 +144,7 @@ typedef struct {
#define WindowGroupHint (1L << 6)
#define AllHints (InputHint|StateHint|IconPixmapHint|IconWindowHint| \
IconPositionHint|IconMaskHint|WindowGroupHint)
+#define XUrgencyHint (1L << 8)
/* definitions for initial window state */
#define WithdrawnState 0 /* for windows that are not mapped */
@@ -146,7 +179,9 @@ typedef enum {
XStringStyle, /* STRING */
XCompoundTextStyle, /* COMPOUND_TEXT */
XTextStyle, /* text in owner's encoding (current locale)*/
- XStdICCTextStyle /* STRING, else COMPOUND_TEXT */
+ XStdICCTextStyle, /* STRING, else COMPOUND_TEXT */
+ /* The following is an XFree86 extension, introduced in November 2000 */
+ XUTF8StringStyle /* UTF8_STRING */
} XICCEncodingStyle;
typedef struct {
@@ -160,6 +195,24 @@ typedef struct {
char *res_class;
} XClassHint;
+#ifdef XUTIL_DEFINE_FUNCTIONS
+extern int XDestroyImage(
+ XImage *ximage);
+extern unsigned long XGetPixel(
+ XImage *ximage,
+ int x, int y);
+extern int XPutPixel(
+ XImage *ximage,
+ int x, int y,
+ unsigned long pixel);
+extern XImage *XSubImage(
+ XImage *ximage,
+ int x, int y,
+ unsigned int width, unsigned int height);
+extern int XAddPixel(
+ XImage *ximage,
+ long value);
+#else
/*
* These macros are used to give some sugar to the image routines so that
* naive people are more comfortable with them.
@@ -174,6 +227,7 @@ typedef struct {
((*((ximage)->f.sub_image))((ximage), (x), (y), (width), (height)))
#define XAddPixel(ximage, value) \
((*((ximage)->f.add_pixel))((ximage), (value)))
+#endif
/*
* Compose sequence status structure, used in calling XLookupString.
@@ -189,6 +243,9 @@ typedef struct _XComposeStatus {
#define IsKeypadKey(keysym) \
(((unsigned)(keysym) >= XK_KP_Space) && ((unsigned)(keysym) <= XK_KP_Equal))
+#define IsPrivateKeypadKey(keysym) \
+ (((unsigned)(keysym) >= 0x11000000) && ((unsigned)(keysym) <= 0x1100FFFF))
+
#define IsCursorKey(keysym) \
(((unsigned)(keysym) >= XK_Home) && ((unsigned)(keysym) < XK_Select))
@@ -201,10 +258,19 @@ typedef struct _XComposeStatus {
#define IsMiscFunctionKey(keysym) \
(((unsigned)(keysym) >= XK_Select) && ((unsigned)(keysym) <= XK_Break))
+#ifdef XK_XKB_KEYS
+#define IsModifierKey(keysym) \
+ ((((unsigned)(keysym) >= XK_Shift_L) && ((unsigned)(keysym) <= XK_Hyper_R)) \
+ || (((unsigned)(keysym) >= XK_ISO_Lock) && \
+ ((unsigned)(keysym) <= XK_ISO_Level5_Lock)) \
+ || ((unsigned)(keysym) == XK_Mode_switch) \
+ || ((unsigned)(keysym) == XK_Num_Lock))
+#else
#define IsModifierKey(keysym) \
((((unsigned)(keysym) >= XK_Shift_L) && ((unsigned)(keysym) <= XK_Hyper_R)) \
|| ((unsigned)(keysym) == XK_Mode_switch) \
|| ((unsigned)(keysym) == XK_Num_Lock))
+#endif
/*
* opaque reference to Region data type
*/
@@ -302,328 +368,250 @@ _XFUNCPROTOBEGIN
/* The following declarations are alphabetized. */
extern XClassHint *XAllocClassHint (
-#if NeedFunctionPrototypes
void
-#endif
);
extern XIconSize *XAllocIconSize (
-#if NeedFunctionPrototypes
void
-#endif
);
extern XSizeHints *XAllocSizeHints (
-#if NeedFunctionPrototypes
void
-#endif
);
extern XStandardColormap *XAllocStandardColormap (
-#if NeedFunctionPrototypes
void
-#endif
);
extern XWMHints *XAllocWMHints (
-#if NeedFunctionPrototypes
void
-#endif
);
-extern void XClipBox(
-#if NeedFunctionPrototypes
+extern int XClipBox(
Region /* r */,
XRectangle* /* rect_return */
-#endif
);
extern Region XCreateRegion(
-#if NeedFunctionPrototypes
void
-#endif
);
-extern char *XDefaultString(
-#if NeedFunctionPrototypes
- void
-#endif
-);
+extern const char *XDefaultString (void);
extern int XDeleteContext(
-#if NeedFunctionPrototypes
Display* /* display */,
XID /* rid */,
XContext /* context */
-#endif
);
-extern void XDestroyRegion(
-#if NeedFunctionPrototypes
+extern int XDestroyRegion(
Region /* r */
-#endif
);
-extern Bool XEmptyRegion(
-#if NeedFunctionPrototypes
+extern int XEmptyRegion(
Region /* r */
-#endif
);
-extern Bool XEqualRegion(
-#if NeedFunctionPrototypes
+extern int XEqualRegion(
Region /* r1 */,
Region /* r2 */
-#endif
);
extern int XFindContext(
-#if NeedFunctionPrototypes
Display* /* display */,
XID /* rid */,
XContext /* context */,
XPointer* /* data_return */
-#endif
);
extern Status XGetClassHint(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XClassHint* /* class_hints_return */
-#endif
);
extern Status XGetIconSizes(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XIconSize** /* size_list_return */,
int* /* count_return */
-#endif
);
extern Status XGetNormalHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* hints_return */
-#endif
);
extern Status XGetRGBColormaps(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XStandardColormap** /* stdcmap_return */,
int* /* count_return */,
Atom /* property */
-#endif
);
extern Status XGetSizeHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* hints_return */,
Atom /* property */
-#endif
);
extern Status XGetStandardColormap(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XStandardColormap* /* colormap_return */,
Atom /* property */
-#endif
);
extern Status XGetTextProperty(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* window */,
XTextProperty* /* text_prop_return */,
Atom /* property */
-#endif
);
-
extern Status XGetWMClientMachine(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XTextProperty* /* text_prop_return */
-#endif
);
extern XWMHints *XGetWMHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */
-#endif
);
extern Status XGetWMIconName(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XTextProperty* /* text_prop_return */
-#endif
);
extern Status XGetWMName(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XTextProperty* /* text_prop_return */
-#endif
);
extern Status XGetWMNormalHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* hints_return */,
long* /* supplied_return */
-#endif
);
extern Status XGetWMSizeHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* hints_return */,
long* /* supplied_return */,
Atom /* property */
-#endif
);
extern Status XGetZoomHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* zhints_return */
-#endif
);
-extern void XIntersectRegion(
-#if NeedFunctionPrototypes
+extern int XIntersectRegion(
Region /* sra */,
Region /* srb */,
Region /* dr_return */
-#endif
+);
+
+extern void XConvertCase(
+ KeySym /* sym */,
+ KeySym* /* lower */,
+ KeySym* /* upper */
);
extern int XLookupString(
-#if NeedFunctionPrototypes
XKeyEvent* /* event_struct */,
char* /* buffer_return */,
int /* bytes_buffer */,
KeySym* /* keysym_return */,
XComposeStatus* /* status_in_out */
-#endif
);
extern Status XMatchVisualInfo(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* screen */,
int /* depth */,
int /* class */,
XVisualInfo* /* vinfo_return */
-#endif
);
extern int XOffsetRegion(
-#if NeedFunctionPrototypes
Region /* r */,
int /* dx */,
int /* dy */
-#endif
);
extern Bool XPointInRegion(
-#if NeedFunctionPrototypes
Region /* r */,
int /* x */,
int /* y */
-#endif
);
extern Region XPolygonRegion(
-#if NeedFunctionPrototypes
XPoint* /* points */,
int /* n */,
int /* fill_rule */
-#endif
);
extern int XRectInRegion(
-#if NeedFunctionPrototypes
Region /* r */,
int /* x */,
int /* y */,
unsigned int /* width */,
unsigned int /* height */
-#endif
);
extern int XSaveContext(
-#if NeedFunctionPrototypes
Display* /* display */,
XID /* rid */,
XContext /* context */,
_Xconst char* /* data */
-#endif
);
-extern void XSetClassHint(
-#if NeedFunctionPrototypes
+extern int XSetClassHint(
Display* /* display */,
Window /* w */,
XClassHint* /* class_hints */
-#endif
);
-extern void XSetIconSizes(
-#if NeedFunctionPrototypes
+extern int XSetIconSizes(
Display* /* display */,
Window /* w */,
XIconSize* /* size_list */,
int /* count */
-#endif
);
-extern void XSetNormalHints(
-#if NeedFunctionPrototypes
+extern int XSetNormalHints(
Display* /* display */,
Window /* w */,
XSizeHints* /* hints */
-#endif
);
extern void XSetRGBColormaps(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XStandardColormap* /* stdcmaps */,
int /* count */,
Atom /* property */
-#endif
);
-extern void XSetSizeHints(
-#if NeedFunctionPrototypes
+extern int XSetSizeHints(
Display* /* display */,
Window /* w */,
XSizeHints* /* hints */,
Atom /* property */
-#endif
);
-extern void XSetStandardProperties(
-#if NeedFunctionPrototypes
+extern int XSetStandardProperties(
Display* /* display */,
Window /* w */,
_Xconst char* /* window_name */,
@@ -632,52 +620,40 @@ extern void XSetStandardProperties(
char** /* argv */,
int /* argc */,
XSizeHints* /* hints */
-#endif
);
extern void XSetTextProperty(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XTextProperty* /* text_prop */,
Atom /* property */
-#endif
);
-extern void XSetWMHints(
-#if NeedFunctionPrototypes
+extern int XSetWMHints(
Display* /* display */,
Window /* w */,
XWMHints* /* wm_hints */
-#endif
);
extern void XSetWMIconName(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XTextProperty* /* text_prop */
-#endif
);
extern void XSetWMName(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XTextProperty* /* text_prop */
-#endif
);
extern void XSetWMNormalHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* hints */
-#endif
);
extern void XSetWMProperties(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XTextProperty* /* window_name */,
@@ -687,11 +663,9 @@ extern void XSetWMProperties(
XSizeHints* /* normal_hints */,
XWMHints* /* wm_hints */,
XClassHint* /* class_hints */
-#endif
);
extern void XmbSetWMProperties(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
_Xconst char* /* window_name */,
@@ -701,129 +675,126 @@ extern void XmbSetWMProperties(
XSizeHints* /* normal_hints */,
XWMHints* /* wm_hints */,
XClassHint* /* class_hints */
-#endif
+);
+
+extern void Xutf8SetWMProperties(
+ Display* /* display */,
+ Window /* w */,
+ _Xconst char* /* window_name */,
+ _Xconst char* /* icon_name */,
+ char** /* argv */,
+ int /* argc */,
+ XSizeHints* /* normal_hints */,
+ XWMHints* /* wm_hints */,
+ XClassHint* /* class_hints */
);
extern void XSetWMSizeHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* hints */,
Atom /* property */
-#endif
);
-extern void XSetRegion(
-#if NeedFunctionPrototypes
+extern int XSetRegion(
Display* /* display */,
GC /* gc */,
Region /* r */
-#endif
);
extern void XSetStandardColormap(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XStandardColormap* /* colormap */,
Atom /* property */
-#endif
);
-extern void XSetZoomHints(
-#if NeedFunctionPrototypes
+extern int XSetZoomHints(
Display* /* display */,
Window /* w */,
XSizeHints* /* zhints */
-#endif
);
-extern void XShrinkRegion(
-#if NeedFunctionPrototypes
+extern int XShrinkRegion(
Region /* r */,
int /* dx */,
int /* dy */
-#endif
);
-extern void XSubtractRegion(
-#if NeedFunctionPrototypes
+extern int XSubtractRegion(
Region /* sra */,
Region /* srb */,
Region /* dr_return */
-#endif
);
extern int XmbTextListToTextProperty(
-#if NeedFunctionPrototypes
- Display* /* display */,
- char** /* list */,
- int /* count */,
- XICCEncodingStyle /* style */,
- XTextProperty* /* text_prop_return */
-#endif
+ Display* display,
+ char** list,
+ int count,
+ XICCEncodingStyle style,
+ XTextProperty* text_prop_return
);
extern int XwcTextListToTextProperty(
-#if NeedFunctionPrototypes
- Display* /* display */,
- wchar_t** /* list */,
- int /* count */,
- XICCEncodingStyle /* style */,
- XTextProperty* /* text_prop_return */
-#endif
+ Display* display,
+ wchar_t** list,
+ int count,
+ XICCEncodingStyle style,
+ XTextProperty* text_prop_return
+);
+
+extern int Xutf8TextListToTextProperty(
+ Display* display,
+ char** list,
+ int count,
+ XICCEncodingStyle style,
+ XTextProperty* text_prop_return
);
extern void XwcFreeStringList(
-#if NeedFunctionPrototypes
- wchar_t** /* list */
-#endif
+ wchar_t** list
);
extern Status XTextPropertyToStringList(
-#if NeedFunctionPrototypes
XTextProperty* /* text_prop */,
char*** /* list_return */,
int* /* count_return */
-#endif
);
extern int XmbTextPropertyToTextList(
-#if NeedFunctionPrototypes
- Display* /* display */,
- XTextProperty* /* text_prop */,
- char*** /* list_return */,
- int* /* count_return */
-#endif
+ Display* display,
+ const XTextProperty* text_prop,
+ char*** list_return,
+ int* count_return
);
extern int XwcTextPropertyToTextList(
-#if NeedFunctionPrototypes
- Display* /* display */,
- XTextProperty* /* text_prop */,
- wchar_t*** /* list_return */,
- int* /* count_return */
-#endif
+ Display* display,
+ const XTextProperty* text_prop,
+ wchar_t*** list_return,
+ int* count_return
+);
+
+extern int Xutf8TextPropertyToTextList(
+ Display* display,
+ const XTextProperty* text_prop,
+ char*** list_return,
+ int* count_return
);
-extern void XUnionRectWithRegion(
-#if NeedFunctionPrototypes
+extern int XUnionRectWithRegion(
XRectangle* /* rectangle */,
Region /* src_region */,
Region /* dest_region_return */
-#endif
);
extern int XUnionRegion(
-#if NeedFunctionPrototypes
Region /* sra */,
Region /* srb */,
Region /* dr_return */
-#endif
);
extern int XWMGeometry(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* screen_number */,
_Xconst char* /* user_geometry */,
@@ -835,21 +806,22 @@ extern int XWMGeometry(
int* /* width_return */,
int* /* height_return */,
int* /* gravity_return */
-#endif
);
-extern void XXorRegion(
-#if NeedFunctionPrototypes
+extern int XXorRegion(
Region /* sra */,
Region /* srb */,
Region /* dr_return */
-#endif
);
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
_XFUNCPROTOEND
#if defined(MAC_OSX_TK)
# undef Region
#endif
-#endif /* _XUTIL_H_ */
+#endif /* _X11_XUTIL_H_ */
diff --git a/xlib/X11/ap_keysym.h b/xlib/X11/ap_keysym.h
index 76cbde2..601f1e5 100644
--- a/xlib/X11/ap_keysym.h
+++ b/xlib/X11/ap_keysym.h
@@ -13,7 +13,7 @@ Consortium not be used in advertising or publicity pertaining to
distribution of the software without written prior permission.
HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD
-TO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+TO THIS SOFTWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. Hewlett-Packard shall not be liable for errors
contained herein or direct, indirect, special, incidental or
diff --git a/xlib/X11/cursorfont.h b/xlib/X11/cursorfont.h
index 617274f..c69d508 100644
--- a/xlib/X11/cursorfont.h
+++ b/xlib/X11/cursorfont.h
@@ -1,4 +1,34 @@
-/* $XConsortium: cursorfont.h,v 1.2 88/09/06 16:44:27 jim Exp $ */
+/*
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+
+#ifndef _X11_CURSORFONT_H_
+#define _X11_CURSORFONT_H_
+
#define XC_num_glyphs 154
#define XC_X_cursor 0
#define XC_arrow 2
@@ -77,3 +107,5 @@
#define XC_ur_angle 148
#define XC_watch 150
#define XC_xterm 152
+
+#endif /* _X11_CURSORFONT_H_ */
diff --git a/xlib/X11/keysym.h b/xlib/X11/keysym.h
index 2547abe..0ffdde4 100644
--- a/xlib/X11/keysym.h
+++ b/xlib/X11/keysym.h
@@ -47,16 +47,28 @@ SOFTWARE.
/* default keysyms */
#define XK_MISCELLANY
+#define XK_XKB_KEYS
#define XK_LATIN1
#define XK_LATIN2
#define XK_LATIN3
#define XK_LATIN4
+#define XK_LATIN8
#define XK_LATIN9
+#define XK_CAUCASUS
#define XK_GREEK
#define XK_KATAKANA
#define XK_ARABIC
#define XK_CYRILLIC
#define XK_HEBREW
+#define XK_THAI
+#define XK_KOREAN
+#define XK_ARMENIAN
+#define XK_GEORGIAN
+#define XK_VIETNAMESE
+#define XK_CURRENCY
+#define XK_MATHEMATICAL
+#define XK_BRAILLE
+#define XK_SINHALA
#include <X11/keysymdef.h>
diff --git a/xlib/X11/keysymdef.h b/xlib/X11/keysymdef.h
index 5c13c61..31110e0 100644
--- a/xlib/X11/keysymdef.h
+++ b/xlib/X11/keysymdef.h
@@ -161,6 +161,11 @@ SOFTWARE.
#define XK_Kana_Shift 0xff2e /* Kana Shift */
#define XK_Eisu_Shift 0xff2f /* Alphanumeric Shift */
#define XK_Eisu_toggle 0xff30 /* Alphanumeric toggle */
+#define XK_Kanji_Bangou 0xff37 /* Codeinput */
+#define XK_Zen_Koho 0xff3d /* Multiple/All Candidate(s) */
+#define XK_Mae_Koho 0xff3e /* Previous Candidate */
+
+/* 0xff31 thru 0xff3f are under XK_KOREAN */
/* Cursor control & motion */
@@ -331,6 +336,212 @@ SOFTWARE.
#endif /* XK_MISCELLANY */
/*
+ * Keyboard (XKB) Extension function and modifier keys
+ * (from Appendix C of "The X Keyboard Extension: Protocol Specification")
+ * Byte 3 = 0xfe
+ */
+
+#ifdef XK_XKB_KEYS
+#define XK_ISO_Lock 0xfe01
+#define XK_ISO_Level2_Latch 0xfe02
+#define XK_ISO_Level3_Shift 0xfe03
+#define XK_ISO_Level3_Latch 0xfe04
+#define XK_ISO_Level3_Lock 0xfe05
+#define XK_ISO_Level5_Shift 0xfe11
+#define XK_ISO_Level5_Latch 0xfe12
+#define XK_ISO_Level5_Lock 0xfe13
+#define XK_ISO_Group_Shift 0xff7e /* Alias for mode_switch */
+#define XK_ISO_Group_Latch 0xfe06
+#define XK_ISO_Group_Lock 0xfe07
+#define XK_ISO_Next_Group 0xfe08
+#define XK_ISO_Next_Group_Lock 0xfe09
+#define XK_ISO_Prev_Group 0xfe0a
+#define XK_ISO_Prev_Group_Lock 0xfe0b
+#define XK_ISO_First_Group 0xfe0c
+#define XK_ISO_First_Group_Lock 0xfe0d
+#define XK_ISO_Last_Group 0xfe0e
+#define XK_ISO_Last_Group_Lock 0xfe0f
+
+#define XK_ISO_Left_Tab 0xfe20
+#define XK_ISO_Move_Line_Up 0xfe21
+#define XK_ISO_Move_Line_Down 0xfe22
+#define XK_ISO_Partial_Line_Up 0xfe23
+#define XK_ISO_Partial_Line_Down 0xfe24
+#define XK_ISO_Partial_Space_Left 0xfe25
+#define XK_ISO_Partial_Space_Right 0xfe26
+#define XK_ISO_Set_Margin_Left 0xfe27
+#define XK_ISO_Set_Margin_Right 0xfe28
+#define XK_ISO_Release_Margin_Left 0xfe29
+#define XK_ISO_Release_Margin_Right 0xfe2a
+#define XK_ISO_Release_Both_Margins 0xfe2b
+#define XK_ISO_Fast_Cursor_Left 0xfe2c
+#define XK_ISO_Fast_Cursor_Right 0xfe2d
+#define XK_ISO_Fast_Cursor_Up 0xfe2e
+#define XK_ISO_Fast_Cursor_Down 0xfe2f
+#define XK_ISO_Continuous_Underline 0xfe30
+#define XK_ISO_Discontinuous_Underline 0xfe31
+#define XK_ISO_Emphasize 0xfe32
+#define XK_ISO_Center_Object 0xfe33
+#define XK_ISO_Enter 0xfe34
+
+#define XK_dead_grave 0xfe50
+#define XK_dead_acute 0xfe51
+#define XK_dead_circumflex 0xfe52
+#define XK_dead_tilde 0xfe53
+#define XK_dead_perispomeni 0xfe53 /* alias for dead_tilde */
+#define XK_dead_macron 0xfe54
+#define XK_dead_breve 0xfe55
+#define XK_dead_abovedot 0xfe56
+#define XK_dead_diaeresis 0xfe57
+#define XK_dead_abovering 0xfe58
+#define XK_dead_doubleacute 0xfe59
+#define XK_dead_caron 0xfe5a
+#define XK_dead_cedilla 0xfe5b
+#define XK_dead_ogonek 0xfe5c
+#define XK_dead_iota 0xfe5d
+#define XK_dead_voiced_sound 0xfe5e
+#define XK_dead_semivoiced_sound 0xfe5f
+#define XK_dead_belowdot 0xfe60
+#define XK_dead_hook 0xfe61
+#define XK_dead_horn 0xfe62
+#define XK_dead_stroke 0xfe63
+#define XK_dead_abovecomma 0xfe64
+#define XK_dead_psili 0xfe64 /* alias for dead_abovecomma */
+#define XK_dead_abovereversedcomma 0xfe65
+#define XK_dead_dasia 0xfe65 /* alias for dead_abovereversedcomma */
+#define XK_dead_doublegrave 0xfe66
+#define XK_dead_belowring 0xfe67
+#define XK_dead_belowmacron 0xfe68
+#define XK_dead_belowcircumflex 0xfe69
+#define XK_dead_belowtilde 0xfe6a
+#define XK_dead_belowbreve 0xfe6b
+#define XK_dead_belowdiaeresis 0xfe6c
+#define XK_dead_invertedbreve 0xfe6d
+#define XK_dead_belowcomma 0xfe6e
+#define XK_dead_currency 0xfe6f
+
+/* extra dead elements for German T3 layout */
+#define XK_dead_lowline 0xfe90
+#define XK_dead_aboveverticalline 0xfe91
+#define XK_dead_belowverticalline 0xfe92
+#define XK_dead_longsolidusoverlay 0xfe93
+
+/* dead vowels for universal syllable entry */
+#define XK_dead_a 0xfe80
+#define XK_dead_A 0xfe81
+#define XK_dead_e 0xfe82
+#define XK_dead_E 0xfe83
+#define XK_dead_i 0xfe84
+#define XK_dead_I 0xfe85
+#define XK_dead_o 0xfe86
+#define XK_dead_O 0xfe87
+#define XK_dead_u 0xfe88
+#define XK_dead_U 0xfe89
+#define XK_dead_small_schwa 0xfe8a
+#define XK_dead_capital_schwa 0xfe8b
+
+#define XK_dead_greek 0xfe8c
+
+#define XK_First_Virtual_Screen 0xfed0
+#define XK_Prev_Virtual_Screen 0xfed1
+#define XK_Next_Virtual_Screen 0xfed2
+#define XK_Last_Virtual_Screen 0xfed4
+#define XK_Terminate_Server 0xfed5
+
+#define XK_AccessX_Enable 0xfe70
+#define XK_AccessX_Feedback_Enable 0xfe71
+#define XK_RepeatKeys_Enable 0xfe72
+#define XK_SlowKeys_Enable 0xfe73
+#define XK_BounceKeys_Enable 0xfe74
+#define XK_StickyKeys_Enable 0xfe75
+#define XK_MouseKeys_Enable 0xfe76
+#define XK_MouseKeys_Accel_Enable 0xfe77
+#define XK_Overlay1_Enable 0xfe78
+#define XK_Overlay2_Enable 0xfe79
+#define XK_AudibleBell_Enable 0xfe7a
+
+#define XK_Pointer_Left 0xfee0
+#define XK_Pointer_Right 0xfee1
+#define XK_Pointer_Up 0xfee2
+#define XK_Pointer_Down 0xfee3
+#define XK_Pointer_UpLeft 0xfee4
+#define XK_Pointer_UpRight 0xfee5
+#define XK_Pointer_DownLeft 0xfee6
+#define XK_Pointer_DownRight 0xfee7
+#define XK_Pointer_Button_Dflt 0xfee8
+#define XK_Pointer_Button1 0xfee9
+#define XK_Pointer_Button2 0xfeea
+#define XK_Pointer_Button3 0xfeeb
+#define XK_Pointer_Button4 0xfeec
+#define XK_Pointer_Button5 0xfeed
+#define XK_Pointer_DblClick_Dflt 0xfeee
+#define XK_Pointer_DblClick1 0xfeef
+#define XK_Pointer_DblClick2 0xfef0
+#define XK_Pointer_DblClick3 0xfef1
+#define XK_Pointer_DblClick4 0xfef2
+#define XK_Pointer_DblClick5 0xfef3
+#define XK_Pointer_Drag_Dflt 0xfef4
+#define XK_Pointer_Drag1 0xfef5
+#define XK_Pointer_Drag2 0xfef6
+#define XK_Pointer_Drag3 0xfef7
+#define XK_Pointer_Drag4 0xfef8
+#define XK_Pointer_Drag5 0xfefd
+
+#define XK_Pointer_EnableKeys 0xfef9
+#define XK_Pointer_Accelerate 0xfefa
+#define XK_Pointer_DfltBtnNext 0xfefb
+#define XK_Pointer_DfltBtnPrev 0xfefc
+
+/* Single-Stroke Multiple-Character N-Graph Keysyms For The X Input Method */
+
+#define XK_ch 0xfea0
+#define XK_Ch 0xfea1
+#define XK_CH 0xfea2
+#define XK_c_h 0xfea3
+#define XK_C_h 0xfea4
+#define XK_C_H 0xfea5
+
+#endif /* XK_XKB_KEYS */
+
+/*
+ * 3270 Terminal Keys
+ * Byte 3 = 0xfd
+ */
+
+#ifdef XK_3270
+#define XK_3270_Duplicate 0xfd01
+#define XK_3270_FieldMark 0xfd02
+#define XK_3270_Right2 0xfd03
+#define XK_3270_Left2 0xfd04
+#define XK_3270_BackTab 0xfd05
+#define XK_3270_EraseEOF 0xfd06
+#define XK_3270_EraseInput 0xfd07
+#define XK_3270_Reset 0xfd08
+#define XK_3270_Quit 0xfd09
+#define XK_3270_PA1 0xfd0a
+#define XK_3270_PA2 0xfd0b
+#define XK_3270_PA3 0xfd0c
+#define XK_3270_Test 0xfd0d
+#define XK_3270_Attn 0xfd0e
+#define XK_3270_CursorBlink 0xfd0f
+#define XK_3270_AltCursor 0xfd10
+#define XK_3270_KeyClick 0xfd11
+#define XK_3270_Jump 0xfd12
+#define XK_3270_Ident 0xfd13
+#define XK_3270_Rule 0xfd14
+#define XK_3270_Copy 0xfd15
+#define XK_3270_Play 0xfd16
+#define XK_3270_Setup 0xfd17
+#define XK_3270_Record 0xfd18
+#define XK_3270_ChangeScreen 0xfd19
+#define XK_3270_DeleteWord 0xfd1a
+#define XK_3270_ExSelect 0xfd1b
+#define XK_3270_CursorSelect 0xfd1c
+#define XK_3270_PrintScreen 0xfd1d
+#define XK_3270_Enter 0xfd1e
+#endif /* XK_3270 */
+
+/*
* Latin 1
* (ISO/IEC 8859-1 = Unicode U+0020..U+00FF)
* Byte 3 = 0
@@ -1282,6 +1493,246 @@ SOFTWARE.
#define XK_Hebrew_switch 0xff7e /* Alias for mode_switch */
#endif /* XK_HEBREW */
+/*
+ * Thai
+ * Byte 3 = 0x0d
+ */
+
+#ifdef XK_THAI
+#define XK_Thai_kokai 0x0da1 /* U+0E01 THAI CHARACTER KO KAI */
+#define XK_Thai_khokhai 0x0da2 /* U+0E02 THAI CHARACTER KHO KHAI */
+#define XK_Thai_khokhuat 0x0da3 /* U+0E03 THAI CHARACTER KHO KHUAT */
+#define XK_Thai_khokhwai 0x0da4 /* U+0E04 THAI CHARACTER KHO KHWAI */
+#define XK_Thai_khokhon 0x0da5 /* U+0E05 THAI CHARACTER KHO KHON */
+#define XK_Thai_khorakhang 0x0da6 /* U+0E06 THAI CHARACTER KHO RAKHANG */
+#define XK_Thai_ngongu 0x0da7 /* U+0E07 THAI CHARACTER NGO NGU */
+#define XK_Thai_chochan 0x0da8 /* U+0E08 THAI CHARACTER CHO CHAN */
+#define XK_Thai_choching 0x0da9 /* U+0E09 THAI CHARACTER CHO CHING */
+#define XK_Thai_chochang 0x0daa /* U+0E0A THAI CHARACTER CHO CHANG */
+#define XK_Thai_soso 0x0dab /* U+0E0B THAI CHARACTER SO SO */
+#define XK_Thai_chochoe 0x0dac /* U+0E0C THAI CHARACTER CHO CHOE */
+#define XK_Thai_yoying 0x0dad /* U+0E0D THAI CHARACTER YO YING */
+#define XK_Thai_dochada 0x0dae /* U+0E0E THAI CHARACTER DO CHADA */
+#define XK_Thai_topatak 0x0daf /* U+0E0F THAI CHARACTER TO PATAK */
+#define XK_Thai_thothan 0x0db0 /* U+0E10 THAI CHARACTER THO THAN */
+#define XK_Thai_thonangmontho 0x0db1 /* U+0E11 THAI CHARACTER THO NANGMONTHO */
+#define XK_Thai_thophuthao 0x0db2 /* U+0E12 THAI CHARACTER THO PHUTHAO */
+#define XK_Thai_nonen 0x0db3 /* U+0E13 THAI CHARACTER NO NEN */
+#define XK_Thai_dodek 0x0db4 /* U+0E14 THAI CHARACTER DO DEK */
+#define XK_Thai_totao 0x0db5 /* U+0E15 THAI CHARACTER TO TAO */
+#define XK_Thai_thothung 0x0db6 /* U+0E16 THAI CHARACTER THO THUNG */
+#define XK_Thai_thothahan 0x0db7 /* U+0E17 THAI CHARACTER THO THAHAN */
+#define XK_Thai_thothong 0x0db8 /* U+0E18 THAI CHARACTER THO THONG */
+#define XK_Thai_nonu 0x0db9 /* U+0E19 THAI CHARACTER NO NU */
+#define XK_Thai_bobaimai 0x0dba /* U+0E1A THAI CHARACTER BO BAIMAI */
+#define XK_Thai_popla 0x0dbb /* U+0E1B THAI CHARACTER PO PLA */
+#define XK_Thai_phophung 0x0dbc /* U+0E1C THAI CHARACTER PHO PHUNG */
+#define XK_Thai_fofa 0x0dbd /* U+0E1D THAI CHARACTER FO FA */
+#define XK_Thai_phophan 0x0dbe /* U+0E1E THAI CHARACTER PHO PHAN */
+#define XK_Thai_fofan 0x0dbf /* U+0E1F THAI CHARACTER FO FAN */
+#define XK_Thai_phosamphao 0x0dc0 /* U+0E20 THAI CHARACTER PHO SAMPHAO */
+#define XK_Thai_moma 0x0dc1 /* U+0E21 THAI CHARACTER MO MA */
+#define XK_Thai_yoyak 0x0dc2 /* U+0E22 THAI CHARACTER YO YAK */
+#define XK_Thai_rorua 0x0dc3 /* U+0E23 THAI CHARACTER RO RUA */
+#define XK_Thai_ru 0x0dc4 /* U+0E24 THAI CHARACTER RU */
+#define XK_Thai_loling 0x0dc5 /* U+0E25 THAI CHARACTER LO LING */
+#define XK_Thai_lu 0x0dc6 /* U+0E26 THAI CHARACTER LU */
+#define XK_Thai_wowaen 0x0dc7 /* U+0E27 THAI CHARACTER WO WAEN */
+#define XK_Thai_sosala 0x0dc8 /* U+0E28 THAI CHARACTER SO SALA */
+#define XK_Thai_sorusi 0x0dc9 /* U+0E29 THAI CHARACTER SO RUSI */
+#define XK_Thai_sosua 0x0dca /* U+0E2A THAI CHARACTER SO SUA */
+#define XK_Thai_hohip 0x0dcb /* U+0E2B THAI CHARACTER HO HIP */
+#define XK_Thai_lochula 0x0dcc /* U+0E2C THAI CHARACTER LO CHULA */
+#define XK_Thai_oang 0x0dcd /* U+0E2D THAI CHARACTER O ANG */
+#define XK_Thai_honokhuk 0x0dce /* U+0E2E THAI CHARACTER HO NOKHUK */
+#define XK_Thai_paiyannoi 0x0dcf /* U+0E2F THAI CHARACTER PAIYANNOI */
+#define XK_Thai_saraa 0x0dd0 /* U+0E30 THAI CHARACTER SARA A */
+#define XK_Thai_maihanakat 0x0dd1 /* U+0E31 THAI CHARACTER MAI HAN-AKAT */
+#define XK_Thai_saraaa 0x0dd2 /* U+0E32 THAI CHARACTER SARA AA */
+#define XK_Thai_saraam 0x0dd3 /* U+0E33 THAI CHARACTER SARA AM */
+#define XK_Thai_sarai 0x0dd4 /* U+0E34 THAI CHARACTER SARA I */
+#define XK_Thai_saraii 0x0dd5 /* U+0E35 THAI CHARACTER SARA II */
+#define XK_Thai_saraue 0x0dd6 /* U+0E36 THAI CHARACTER SARA UE */
+#define XK_Thai_sarauee 0x0dd7 /* U+0E37 THAI CHARACTER SARA UEE */
+#define XK_Thai_sarau 0x0dd8 /* U+0E38 THAI CHARACTER SARA U */
+#define XK_Thai_sarauu 0x0dd9 /* U+0E39 THAI CHARACTER SARA UU */
+#define XK_Thai_phinthu 0x0dda /* U+0E3A THAI CHARACTER PHINTHU */
+#define XK_Thai_maihanakat_maitho 0x0dde
+#define XK_Thai_baht 0x0ddf /* U+0E3F THAI CURRENCY SYMBOL BAHT */
+#define XK_Thai_sarae 0x0de0 /* U+0E40 THAI CHARACTER SARA E */
+#define XK_Thai_saraae 0x0de1 /* U+0E41 THAI CHARACTER SARA AE */
+#define XK_Thai_sarao 0x0de2 /* U+0E42 THAI CHARACTER SARA O */
+#define XK_Thai_saraaimaimuan 0x0de3 /* U+0E43 THAI CHARACTER SARA AI MAIMUAN */
+#define XK_Thai_saraaimaimalai 0x0de4 /* U+0E44 THAI CHARACTER SARA AI MAIMALAI */
+#define XK_Thai_lakkhangyao 0x0de5 /* U+0E45 THAI CHARACTER LAKKHANGYAO */
+#define XK_Thai_maiyamok 0x0de6 /* U+0E46 THAI CHARACTER MAIYAMOK */
+#define XK_Thai_maitaikhu 0x0de7 /* U+0E47 THAI CHARACTER MAITAIKHU */
+#define XK_Thai_maiek 0x0de8 /* U+0E48 THAI CHARACTER MAI EK */
+#define XK_Thai_maitho 0x0de9 /* U+0E49 THAI CHARACTER MAI THO */
+#define XK_Thai_maitri 0x0dea /* U+0E4A THAI CHARACTER MAI TRI */
+#define XK_Thai_maichattawa 0x0deb /* U+0E4B THAI CHARACTER MAI CHATTAWA */
+#define XK_Thai_thanthakhat 0x0dec /* U+0E4C THAI CHARACTER THANTHAKHAT */
+#define XK_Thai_nikhahit 0x0ded /* U+0E4D THAI CHARACTER NIKHAHIT */
+#define XK_Thai_leksun 0x0df0 /* U+0E50 THAI DIGIT ZERO */
+#define XK_Thai_leknung 0x0df1 /* U+0E51 THAI DIGIT ONE */
+#define XK_Thai_leksong 0x0df2 /* U+0E52 THAI DIGIT TWO */
+#define XK_Thai_leksam 0x0df3 /* U+0E53 THAI DIGIT THREE */
+#define XK_Thai_leksi 0x0df4 /* U+0E54 THAI DIGIT FOUR */
+#define XK_Thai_lekha 0x0df5 /* U+0E55 THAI DIGIT FIVE */
+#define XK_Thai_lekhok 0x0df6 /* U+0E56 THAI DIGIT SIX */
+#define XK_Thai_lekchet 0x0df7 /* U+0E57 THAI DIGIT SEVEN */
+#define XK_Thai_lekpaet 0x0df8 /* U+0E58 THAI DIGIT EIGHT */
+#define XK_Thai_lekkao 0x0df9 /* U+0E59 THAI DIGIT NINE */
+#endif /* XK_THAI */
+
+/*
+ * Korean
+ * Byte 3 = 0x0e
+ */
+
+#ifdef XK_KOREAN
+
+#define XK_Hangul 0xff31 /* Hangul start/stop(toggle) */
+#define XK_Hangul_Start 0xff32 /* Hangul start */
+#define XK_Hangul_End 0xff33 /* Hangul end, English start */
+#define XK_Hangul_Hanja 0xff34 /* Start Hangul->Hanja Conversion */
+#define XK_Hangul_Jamo 0xff35 /* Hangul Jamo mode */
+#define XK_Hangul_Romaja 0xff36 /* Hangul Romaja mode */
+#define XK_Hangul_Codeinput 0xff37 /* Hangul code input mode */
+#define XK_Hangul_Jeonja 0xff38 /* Jeonja mode */
+#define XK_Hangul_Banja 0xff39 /* Banja mode */
+#define XK_Hangul_PreHanja 0xff3a /* Pre Hanja conversion */
+#define XK_Hangul_PostHanja 0xff3b /* Post Hanja conversion */
+#define XK_Hangul_SingleCandidate 0xff3c /* Single candidate */
+#define XK_Hangul_MultipleCandidate 0xff3d /* Multiple candidate */
+#define XK_Hangul_PreviousCandidate 0xff3e /* Previous candidate */
+#define XK_Hangul_Special 0xff3f /* Special symbols */
+#define XK_Hangul_switch 0xff7e /* Alias for mode_switch */
+
+/* Hangul Consonant Characters */
+#define XK_Hangul_Kiyeog 0x0ea1 /* U+3131 HANGUL LETTER KIYEOK */
+#define XK_Hangul_SsangKiyeog 0x0ea2 /* U+3132 HANGUL LETTER SSANGKIYEOK */
+#define XK_Hangul_KiyeogSios 0x0ea3 /* U+3133 HANGUL LETTER KIYEOK-SIOS */
+#define XK_Hangul_Nieun 0x0ea4 /* U+3134 HANGUL LETTER NIEUN */
+#define XK_Hangul_NieunJieuj 0x0ea5 /* U+3135 HANGUL LETTER NIEUN-CIEUC */
+#define XK_Hangul_NieunHieuh 0x0ea6 /* U+3136 HANGUL LETTER NIEUN-HIEUH */
+#define XK_Hangul_Dikeud 0x0ea7 /* U+3137 HANGUL LETTER TIKEUT */
+#define XK_Hangul_SsangDikeud 0x0ea8 /* U+3138 HANGUL LETTER SSANGTIKEUT */
+#define XK_Hangul_Rieul 0x0ea9 /* U+3139 HANGUL LETTER RIEUL */
+#define XK_Hangul_RieulKiyeog 0x0eaa /* U+313A HANGUL LETTER RIEUL-KIYEOK */
+#define XK_Hangul_RieulMieum 0x0eab /* U+313B HANGUL LETTER RIEUL-MIEUM */
+#define XK_Hangul_RieulPieub 0x0eac /* U+313C HANGUL LETTER RIEUL-PIEUP */
+#define XK_Hangul_RieulSios 0x0ead /* U+313D HANGUL LETTER RIEUL-SIOS */
+#define XK_Hangul_RieulTieut 0x0eae /* U+313E HANGUL LETTER RIEUL-THIEUTH */
+#define XK_Hangul_RieulPhieuf 0x0eaf /* U+313F HANGUL LETTER RIEUL-PHIEUPH */
+#define XK_Hangul_RieulHieuh 0x0eb0 /* U+3140 HANGUL LETTER RIEUL-HIEUH */
+#define XK_Hangul_Mieum 0x0eb1 /* U+3141 HANGUL LETTER MIEUM */
+#define XK_Hangul_Pieub 0x0eb2 /* U+3142 HANGUL LETTER PIEUP */
+#define XK_Hangul_SsangPieub 0x0eb3 /* U+3143 HANGUL LETTER SSANGPIEUP */
+#define XK_Hangul_PieubSios 0x0eb4 /* U+3144 HANGUL LETTER PIEUP-SIOS */
+#define XK_Hangul_Sios 0x0eb5 /* U+3145 HANGUL LETTER SIOS */
+#define XK_Hangul_SsangSios 0x0eb6 /* U+3146 HANGUL LETTER SSANGSIOS */
+#define XK_Hangul_Ieung 0x0eb7 /* U+3147 HANGUL LETTER IEUNG */
+#define XK_Hangul_Jieuj 0x0eb8 /* U+3148 HANGUL LETTER CIEUC */
+#define XK_Hangul_SsangJieuj 0x0eb9 /* U+3149 HANGUL LETTER SSANGCIEUC */
+#define XK_Hangul_Cieuc 0x0eba /* U+314A HANGUL LETTER CHIEUCH */
+#define XK_Hangul_Khieuq 0x0ebb /* U+314B HANGUL LETTER KHIEUKH */
+#define XK_Hangul_Tieut 0x0ebc /* U+314C HANGUL LETTER THIEUTH */
+#define XK_Hangul_Phieuf 0x0ebd /* U+314D HANGUL LETTER PHIEUPH */
+#define XK_Hangul_Hieuh 0x0ebe /* U+314E HANGUL LETTER HIEUH */
+
+/* Hangul Vowel Characters */
+#define XK_Hangul_A 0x0ebf /* U+314F HANGUL LETTER A */
+#define XK_Hangul_AE 0x0ec0 /* U+3150 HANGUL LETTER AE */
+#define XK_Hangul_YA 0x0ec1 /* U+3151 HANGUL LETTER YA */
+#define XK_Hangul_YAE 0x0ec2 /* U+3152 HANGUL LETTER YAE */
+#define XK_Hangul_EO 0x0ec3 /* U+3153 HANGUL LETTER EO */
+#define XK_Hangul_E 0x0ec4 /* U+3154 HANGUL LETTER E */
+#define XK_Hangul_YEO 0x0ec5 /* U+3155 HANGUL LETTER YEO */
+#define XK_Hangul_YE 0x0ec6 /* U+3156 HANGUL LETTER YE */
+#define XK_Hangul_O 0x0ec7 /* U+3157 HANGUL LETTER O */
+#define XK_Hangul_WA 0x0ec8 /* U+3158 HANGUL LETTER WA */
+#define XK_Hangul_WAE 0x0ec9 /* U+3159 HANGUL LETTER WAE */
+#define XK_Hangul_OE 0x0eca /* U+315A HANGUL LETTER OE */
+#define XK_Hangul_YO 0x0ecb /* U+315B HANGUL LETTER YO */
+#define XK_Hangul_U 0x0ecc /* U+315C HANGUL LETTER U */
+#define XK_Hangul_WEO 0x0ecd /* U+315D HANGUL LETTER WEO */
+#define XK_Hangul_WE 0x0ece /* U+315E HANGUL LETTER WE */
+#define XK_Hangul_WI 0x0ecf /* U+315F HANGUL LETTER WI */
+#define XK_Hangul_YU 0x0ed0 /* U+3160 HANGUL LETTER YU */
+#define XK_Hangul_EU 0x0ed1 /* U+3161 HANGUL LETTER EU */
+#define XK_Hangul_YI 0x0ed2 /* U+3162 HANGUL LETTER YI */
+#define XK_Hangul_I 0x0ed3 /* U+3163 HANGUL LETTER I */
+
+/* Hangul syllable-final (JongSeong) Characters */
+#define XK_Hangul_J_Kiyeog 0x0ed4 /* U+11A8 HANGUL JONGSEONG KIYEOK */
+#define XK_Hangul_J_SsangKiyeog 0x0ed5 /* U+11A9 HANGUL JONGSEONG SSANGKIYEOK */
+#define XK_Hangul_J_KiyeogSios 0x0ed6 /* U+11AA HANGUL JONGSEONG KIYEOK-SIOS */
+#define XK_Hangul_J_Nieun 0x0ed7 /* U+11AB HANGUL JONGSEONG NIEUN */
+#define XK_Hangul_J_NieunJieuj 0x0ed8 /* U+11AC HANGUL JONGSEONG NIEUN-CIEUC */
+#define XK_Hangul_J_NieunHieuh 0x0ed9 /* U+11AD HANGUL JONGSEONG NIEUN-HIEUH */
+#define XK_Hangul_J_Dikeud 0x0eda /* U+11AE HANGUL JONGSEONG TIKEUT */
+#define XK_Hangul_J_Rieul 0x0edb /* U+11AF HANGUL JONGSEONG RIEUL */
+#define XK_Hangul_J_RieulKiyeog 0x0edc /* U+11B0 HANGUL JONGSEONG RIEUL-KIYEOK */
+#define XK_Hangul_J_RieulMieum 0x0edd /* U+11B1 HANGUL JONGSEONG RIEUL-MIEUM */
+#define XK_Hangul_J_RieulPieub 0x0ede /* U+11B2 HANGUL JONGSEONG RIEUL-PIEUP */
+#define XK_Hangul_J_RieulSios 0x0edf /* U+11B3 HANGUL JONGSEONG RIEUL-SIOS */
+#define XK_Hangul_J_RieulTieut 0x0ee0 /* U+11B4 HANGUL JONGSEONG RIEUL-THIEUTH */
+#define XK_Hangul_J_RieulPhieuf 0x0ee1 /* U+11B5 HANGUL JONGSEONG RIEUL-PHIEUPH */
+#define XK_Hangul_J_RieulHieuh 0x0ee2 /* U+11B6 HANGUL JONGSEONG RIEUL-HIEUH */
+#define XK_Hangul_J_Mieum 0x0ee3 /* U+11B7 HANGUL JONGSEONG MIEUM */
+#define XK_Hangul_J_Pieub 0x0ee4 /* U+11B8 HANGUL JONGSEONG PIEUP */
+#define XK_Hangul_J_PieubSios 0x0ee5 /* U+11B9 HANGUL JONGSEONG PIEUP-SIOS */
+#define XK_Hangul_J_Sios 0x0ee6 /* U+11BA HANGUL JONGSEONG SIOS */
+#define XK_Hangul_J_SsangSios 0x0ee7 /* U+11BB HANGUL JONGSEONG SSANGSIOS */
+#define XK_Hangul_J_Ieung 0x0ee8 /* U+11BC HANGUL JONGSEONG IEUNG */
+#define XK_Hangul_J_Jieuj 0x0ee9 /* U+11BD HANGUL JONGSEONG CIEUC */
+#define XK_Hangul_J_Cieuc 0x0eea /* U+11BE HANGUL JONGSEONG CHIEUCH */
+#define XK_Hangul_J_Khieuq 0x0eeb /* U+11BF HANGUL JONGSEONG KHIEUKH */
+#define XK_Hangul_J_Tieut 0x0eec /* U+11C0 HANGUL JONGSEONG THIEUTH */
+#define XK_Hangul_J_Phieuf 0x0eed /* U+11C1 HANGUL JONGSEONG PHIEUPH */
+#define XK_Hangul_J_Hieuh 0x0eee /* U+11C2 HANGUL JONGSEONG HIEUH */
+
+/* Ancient Hangul Consonant Characters */
+#define XK_Hangul_RieulYeorinHieuh 0x0eef /* U+316D HANGUL LETTER RIEUL-YEORINHIEUH */
+#define XK_Hangul_SunkyeongeumMieum 0x0ef0 /* U+3171 HANGUL LETTER KAPYEOUNMIEUM */
+#define XK_Hangul_SunkyeongeumPieub 0x0ef1 /* U+3178 HANGUL LETTER KAPYEOUNPIEUP */
+#define XK_Hangul_PanSios 0x0ef2 /* U+317F HANGUL LETTER PANSIOS */
+#define XK_Hangul_KkogjiDalrinIeung 0x0ef3 /* U+3181 HANGUL LETTER YESIEUNG */
+#define XK_Hangul_SunkyeongeumPhieuf 0x0ef4 /* U+3184 HANGUL LETTER KAPYEOUNPHIEUPH */
+#define XK_Hangul_YeorinHieuh 0x0ef5 /* U+3186 HANGUL LETTER YEORINHIEUH */
+
+/* Ancient Hangul Vowel Characters */
+#define XK_Hangul_AraeA 0x0ef6 /* U+318D HANGUL LETTER ARAEA */
+#define XK_Hangul_AraeAE 0x0ef7 /* U+318E HANGUL LETTER ARAEAE */
+
+/* Ancient Hangul syllable-final (JongSeong) Characters */
+#define XK_Hangul_J_PanSios 0x0ef8 /* U+11EB HANGUL JONGSEONG PANSIOS */
+#define XK_Hangul_J_KkogjiDalrinIeung 0x0ef9 /* U+11F0 HANGUL JONGSEONG YESIEUNG */
+#define XK_Hangul_J_YeorinHieuh 0x0efa /* U+11F9 HANGUL JONGSEONG YEORINHIEUH */
+
+/* Korean currency symbol */
+#define XK_Korean_Won 0x0eff /*(U+20A9 WON SIGN)*/
+
+#endif /* XK_KOREAN */
+
+#ifdef XK_CURRENCY
+#define XK_EuroSign 0x20ac /* U+20AC EURO SIGN */
+#endif /* XK_CURRENCY */
+
+#ifdef XK_BRAILLE
+#define XK_braille_dot_1 0xfff1
+#define XK_braille_dot_2 0xfff2
+#define XK_braille_dot_3 0xfff3
+#define XK_braille_dot_4 0xfff4
+#define XK_braille_dot_5 0xfff5
+#define XK_braille_dot_6 0xfff6
+#define XK_braille_dot_7 0xfff7
+#define XK_braille_dot_8 0xfff8
+#define XK_braille_dot_9 0xfff9
+#define XK_braille_dot_10 0xfffa
+#endif /* XK_BRAILLE */
+
/* Multimedia keys, defined same as on Linux
* /usr/include/pkg/libxkbcommon/xkbcommon/xkbcommon-keysyms.h
*/
diff --git a/xlib/xgc.c b/xlib/xgc.c
index 043e322..786a6fd 100644
--- a/xlib/xgc.c
+++ b/xlib/xgc.c
@@ -110,9 +110,6 @@ XCreateGC(
*/
gp = (GC)ckalloc(sizeof(XGCValuesWithDash));
- if (!gp) {
- return NULL;
- }
#define InitField(name,maskbit,default) \
(gp->name = (mask & (maskbit)) ? values->name : (default))
@@ -128,7 +125,7 @@ XCreateGC(
InitField(cap_style, GCCapStyle, 0);
InitField(join_style, GCJoinStyle, 0);
InitField(fill_style, GCFillStyle, FillSolid);
- InitField(fill_rule, GCFillRule, WindingRule);
+ InitField(fill_rule, GCFillRule, EvenOddRule);
InitField(arc_mode, GCArcMode, ArcPieSlice);
InitField(tile, GCTile, 0);
InitField(stipple, GCStipple, 0);