From 946660a5304fa11d00983930250de71b71771a59 Mon Sep 17 00:00:00 2001 From: culler Date: Wed, 30 Oct 2019 14:31:28 +0000 Subject: Alternative fix to [de579935a9] - just allow weird looking thumbs. --- macosx/tkMacOSXScrlbr.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index a189646..ce7ac58 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -214,12 +214,20 @@ static void drawMacScrollbar( CGContextStrokeLineSegments(context, outer, 2); /* - * Do not display the thumb unless scrolling is possible. + * Do not display the thumb unless scrolling is possible, in accordance + * with macOS behavior. + * + * Native scrollbars and Ttk scrollbars are always 15 pixels wide, but we + * allow Tk scrollbars to have any width, even if it looks bad. To prevent + * sporadic assertion errors when drawing skinny thumbs we must make sure + * the radius is at most half the width. */ if (scrollPtr->firstFraction > 0.0 || scrollPtr->lastFraction < 1.0) { CGRect thumbBounds = {thumbOrigin, thumbSize}; - path = CGPathCreateWithRoundedRect(thumbBounds, 4, 4, NULL); + int width = scrollPtr->vertical ? thumbSize.width : thumbSize.height; + int radius = width >= 8 ? 4 : width >> 1; + path = CGPathCreateWithRoundedRect(thumbBounds, radius, radius, NULL); CGContextBeginPath(context); CGContextAddPath(context, path); if (msPtr->info.trackInfo.scrollbar.pressState != 0) { -- cgit v0.12 From 879c2a77024c6f7599ee7b438d236d2828cf5dc2 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 31 Oct 2019 09:49:31 +0000 Subject: Fix [056f9e85dc]: debian patches Don't define HAVE_STDINT_H in win/makefile.vc: Most (older) Visual Studio versions still don't have stdint.h, and it isn't used by Tk. --- unix/configure | 10 +++++++--- unix/configure.in | 6 +++--- unix/installManPage | 10 +++++++++- unix/tcl.m4 | 5 +++++ win/makefile.vc | 2 +- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/unix/configure b/unix/configure index 15e5a56..acac5f6 100755 --- a/unix/configure +++ b/unix/configure @@ -1432,6 +1432,7 @@ echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" > `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ + `ls -d /usr/lib/tcl8.5 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/local/lib/tcl8.5 2>/dev/null` \ @@ -4746,6 +4747,9 @@ echo "$as_me: WARNING: can't find uname command" >&2;} if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi + if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then + tcl_cv_sys_version=NetBSD-Debian + fi fi fi @@ -10627,8 +10631,8 @@ echo "${ECHO_T}$enable_xft" >&6 XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no" if test "$found_xft" = "no" ; then found_xft=yes - XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no" - XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no" + XFT_CFLAGS=`pkg-config --cflags xft fontconfig 2>/dev/null` || found_xft="no" + XFT_LIBS=`pkg-config --libs xft fontconfig 2>/dev/null` || found_xft="no" fi echo "$as_me:$LINENO: result: $found_xft" >&5 echo "${ECHO_T}$found_xft" >&6 @@ -11479,7 +11483,7 @@ if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then TCL_STUB_FLAGS="-DUSE_TCL_STUBS" fi -TK_LIBRARY='$(prefix)/lib/tk$(VERSION)' +test -z "$TK_LIBRARY" && TK_LIBRARY='$(prefix)/lib/tk$(VERSION)' PRIVATE_INCLUDE_DIR='$(includedir)' HTML_DIR='$(DISTDIR)/html' TK_PKG_DIR='tk$(VERSION)' diff --git a/unix/configure.in b/unix/configure.in index d4a8c28..4b1f992 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -481,8 +481,8 @@ if test $tk_aqua = no; then XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no" if test "$found_xft" = "no" ; then found_xft=yes - XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no" - XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no" + XFT_CFLAGS=`pkg-config --cflags xft fontconfig 2>/dev/null` || found_xft="no" + XFT_LIBS=`pkg-config --libs xft fontconfig 2>/dev/null` || found_xft="no" fi AC_MSG_RESULT([$found_xft]) dnl make sure that compiling against Xft header file doesn't bomb @@ -653,7 +653,7 @@ if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then TCL_STUB_FLAGS="-DUSE_TCL_STUBS" fi -TK_LIBRARY='$(prefix)/lib/tk$(VERSION)' +test -z "$TK_LIBRARY" && TK_LIBRARY='$(prefix)/lib/tk$(VERSION)' PRIVATE_INCLUDE_DIR='$(includedir)' HTML_DIR='$(DISTDIR)/html' TK_PKG_DIR='tk$(VERSION)' diff --git a/unix/installManPage b/unix/installManPage index 6bdccf0..2293a20 100755 --- a/unix/installManPage +++ b/unix/installManPage @@ -91,12 +91,20 @@ case $ManPage in exit 2 ;; esac +Name=`basename $ManPage .$Section` SrcDir=`dirname $ManPage` ######################################################################## ### Process Page to Create Target Pages ### +Specials="FindPhoto FontId MeasureChar" +for n in $Specials; do + if [ "$Name" = "$n" ] ; then + Names="$n $Names" + fi +done + First="" for Target in $Names; do Target=$Target.$Section$Suffix @@ -105,7 +113,7 @@ for Target in $Names; do First=$Target sed -e "/man\.macros/r $SrcDir/man.macros" -e "/man\.macros/d" \ $ManPage > $Dir/$First - chmod 444 $Dir/$First + chmod 644 $Dir/$First $Gzip $Dir/$First else ln $SymOrLoc$First$Gz $Dir/$Target$Gz diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 0c15ac0..95915e8 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -94,6 +94,7 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ + `ls -d /usr/lib/tcl8.5 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/local/lib/tcl8.5 2>/dev/null` \ @@ -227,6 +228,7 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ + `ls -d /usr/lib/tk8.5 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/local/lib/tk8.5 2>/dev/null` \ @@ -965,6 +967,9 @@ AC_DEFUN([SC_CONFIG_SYSTEM], [ if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi + if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then + tcl_cv_sys_version=NetBSD-Debian + fi fi fi ]) diff --git a/win/makefile.vc b/win/makefile.vc index bec8607..3d47f55 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -419,7 +419,7 @@ TK_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)" -I"$(BITMAPDIR)" -I"$(XLIBDIR)" \ CONFIG_DEFS =-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 \ -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 \ - -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 \ + -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 \ -DSUPPORT_CONFIG_EMBEDDED \ !if $(HAVE_UXTHEME_H) -DHAVE_UXTHEME_H=1 \ -- cgit v0.12 From c1921c6eef90ee6e058c465fa2a61c2b9439454e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 31 Oct 2019 10:07:01 +0000 Subject: 8.5 -> 8.6 --- unix/configure | 2 +- unix/tcl.m4 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/unix/configure b/unix/configure index 6bcf65c..a6d053f 100755 --- a/unix/configure +++ b/unix/configure @@ -1431,7 +1431,7 @@ echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" > `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib/tcl8.5 2>/dev/null` \ + `ls -d /usr/lib/tcl8.6 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/local/lib/tcl8.6 2>/dev/null` \ diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 28f3887..0e146e4 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -93,7 +93,7 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib/tcl8.5 2>/dev/null` \ + `ls -d /usr/lib/tcl8.6 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/local/lib/tcl8.6 2>/dev/null` \ @@ -226,7 +226,7 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib/tk8.5 2>/dev/null` \ + `ls -d /usr/lib/tk8.6 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/local/lib/tk8.6 2>/dev/null` \ -- cgit v0.12 From ebd274ca0936d0950eeda871695f3da8aab41a78 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 1 Nov 2019 09:58:24 +0000 Subject: Better fix for [b82bd4872b]: ttk::style configure -compound does not work --- generic/ttk/ttkButton.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index 72e9815..1be7ee6 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -81,8 +81,8 @@ static Tk_OptionSpec BaseOptionSpecs[] = * Compound base/image options */ {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - "none", Tk_Offset(Base,base.compoundObj), -1, - TK_OPTION_DONT_SET_DEFAULT,(ClientData)ttkCompoundStrings, + NULL, Tk_Offset(Base,base.compoundObj), -1, + TK_OPTION_NULL_OK,(ClientData)ttkCompoundStrings, GEOMETRY_CHANGED }, {TK_OPTION_STRING, "-padding", "padding", "Pad", NULL, Tk_Offset(Base,base.paddingObj), -1, -- cgit v0.12 From c5948f27b9d3486c54b9b4e95255251b9f477fb5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 1 Nov 2019 10:19:36 +0000 Subject: Document that ttk::label and ttk::*button now support styling -compound --- doc/ttk_button.n | 2 ++ doc/ttk_checkbutton.n | 2 ++ doc/ttk_label.n | 2 ++ doc/ttk_menubutton.n | 2 ++ doc/ttk_radiobutton.n | 2 ++ 5 files changed, 10 insertions(+) diff --git a/doc/ttk_button.n b/doc/ttk_button.n index cf47a1a..cf42e28 100644 --- a/doc/ttk_button.n +++ b/doc/ttk_button.n @@ -72,6 +72,8 @@ are: .br \fB\-bordercolor\fP \fIcolor\fP .br +\fB\-compound\fP \fIcompound\fP +.br \fB\-darkcolor\fP \fIcolor\fP .br \fB\-foreground\fP \fIcolor\fP diff --git a/doc/ttk_checkbutton.n b/doc/ttk_checkbutton.n index a18a886..c78dc0e 100644 --- a/doc/ttk_checkbutton.n +++ b/doc/ttk_checkbutton.n @@ -80,6 +80,8 @@ are: .PP \fB\-background\fP \fIcolor\fP .br +\fB\-compound\fP \fIcompound\fP +.br \fB\-foreground\fP \fIcolor\fP .br \fB\-indicatorbackground\fP \fIcolor\fP diff --git a/doc/ttk_label.n b/doc/ttk_label.n index 1e30592..871fab7 100644 --- a/doc/ttk_label.n +++ b/doc/ttk_label.n @@ -71,6 +71,8 @@ are: .PP \fB\-background\fP \fIcolor\fP .br +\fB\-compound\fP \fIcompound\fP +.br \fB\-foreground\fP \fIcolor\fP .br \fB\-font\fP \fIfont\fP diff --git a/doc/ttk_menubutton.n b/doc/ttk_menubutton.n index 76d3829..0d80c1e 100644 --- a/doc/ttk_menubutton.n +++ b/doc/ttk_menubutton.n @@ -58,6 +58,8 @@ are: .br \fB\-background\fP \fIcolor\fP .br +\fB\-compound\fP \fIcompound\fP +.br \fB\-foreground\fP \fIcolor\fP .br \fB\-font\fP \fIfont\fP diff --git a/doc/ttk_radiobutton.n b/doc/ttk_radiobutton.n index 1344ae2..2dc84be 100644 --- a/doc/ttk_radiobutton.n +++ b/doc/ttk_radiobutton.n @@ -77,6 +77,8 @@ are: .PP \fB\-background\fP \fIcolor\fP .br +\fB\-compound\fP \fIcompound\fP +.br \fB\-foreground\fP \fIcolor\fP .br \fB\-indicatorbackground\fP \fIcolor\fP -- cgit v0.12 From 993fec89923aed373f173dbeecc3d8e41d5778fe Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 1 Nov 2019 10:23:45 +0000 Subject: Propagate the previous two commits to the tabs of a ttk::notebook, which can now style -compound --- doc/ttk_notebook.n | 2 ++ generic/ttk/ttkNotebook.c | 4 ++-- tests/ttk/notebook.test | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/ttk_notebook.n b/doc/ttk_notebook.n index 19416b5..ae32a44 100644 --- a/doc/ttk_notebook.n +++ b/doc/ttk_notebook.n @@ -242,6 +242,8 @@ are: .br \fB\-bordercolor\fP \fIcolor\fP .br +\fB\-compound\fP \fIcompound\fP +.br \fB\-expand\fP \fIpadding\fP .RS Defines how much the tab grows in size. Usually used with the diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 56439a6..39ed6aa 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -69,8 +69,8 @@ static Tk_OptionSpec TabOptionSpecs[] = {TK_OPTION_STRING, "-image", "image", "Image", NULL/*default*/, Tk_Offset(Tab,imageObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", - "none", Tk_Offset(Tab,compoundObj), -1, - 0,(ClientData)ttkCompoundStrings,GEOMETRY_CHANGED }, + NULL, Tk_Offset(Tab,compoundObj), -1, + TK_OPTION_NULL_OK,(ClientData)ttkCompoundStrings,GEOMETRY_CHANGED }, {TK_OPTION_INT, "-underline", "underline", "Underline", "-1", Tk_Offset(Tab,underlineObj), -1, 0,0,GEOMETRY_CHANGED }, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0 } diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test index 3a2a6ff..ac63088 100644 --- a/tests/ttk/notebook.test +++ b/tests/ttk/notebook.test @@ -69,7 +69,7 @@ test notebook-2.5 "tab - get all options" -body { .nb tab .nb.foo } -result [list \ -padding 0 -sticky nsew \ - -state normal -text "Changed Foo" -image "" -compound none -underline -1] + -state normal -text "Changed Foo" -image "" -compound {} -underline -1] test notebook-4.1 "Test .nb index end" -body { .nb index end -- cgit v0.12 From d6a967c9d8c6cc6dc8d5792070e2c2349f6ce3d8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 1 Nov 2019 11:03:25 +0000 Subject: Somewhat more progress on [a179564826]: Tk 8.6: prevent issues when encountering non-BMP Unicode characters. Increase XMaxTransChars from 4 to 7, at the same time reducing the nbytes field from int to unsigned char. This makes more room to NULL-terminate the trans_chars array in the XEvent, even when it's 4 bytes in length. (fully binary compatible, since the nbytes field is not supposed to be accessed externally) --- macosx/tkMacOSXKeyEvent.c | 6 ++---- macosx/tkMacOSXKeyboard.c | 2 +- unix/tkUnixFont.c | 2 +- unix/tkUnixKey.c | 2 +- win/tkWinFont.c | 2 +- win/tkWinKey.c | 2 +- xlib/X11/Xlib.h | 6 +++--- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 7ce8fc8..677f77e 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -603,17 +603,15 @@ setupXEvent(XEvent *xEvent, NSWindow *w, unsigned int state) memset(xEvent, 0, sizeof(XEvent)); xEvent->xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); - xEvent->xany.send_event = false; xEvent->xany.display = Tk_Display(tkwin); xEvent->xany.window = Tk_WindowId(tkwin); xEvent->xkey.root = XRootWindow(Tk_Display(tkwin), 0); - xEvent->xkey.subwindow = None; xEvent->xkey.time = TkpGetMS(); xEvent->xkey.state = state; xEvent->xkey.same_screen = true; - xEvent->xkey.trans_chars[0] = 0; - xEvent->xkey.nbytes = 0; + /* No need to initialize other fields implicitly here, + * because of the memset() above. */ } #pragma mark - diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c index 78bda9e..b2c78d3 100644 --- a/macosx/tkMacOSXKeyboard.c +++ b/macosx/tkMacOSXKeyboard.c @@ -720,7 +720,7 @@ TkpSetKeycodeAndState( } if (keysym <= LATIN1_MAX) { - int done = Tcl_UniCharToUtf(keysym, eventPtr->xkey.trans_chars); + int done = TkUniCharToUtf(keysym, eventPtr->xkey.trans_chars); eventPtr->xkey.trans_chars[done] = 0; } else { diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index 1e80231..96b6195 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -520,7 +520,7 @@ Ucs2beToUtfProc( * UCS-2BE. We know this is an LE->BE swap. */ - dst += Tcl_UniCharToUtf(htons(*((short *)src)), dst); + dst += TkUniCharToUtf(htons(*((short *)src)), dst); src += 2 /* sizeof(UCS-2) */; } diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index 6d4d0cf..75d5f6c 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -208,7 +208,7 @@ TkpGetString( Tcl_DStringValue(&buf)[len] = '\0'; if (len == 1) { - len = Tcl_UniCharToUtf((unsigned char) Tcl_DStringValue(&buf)[0], + len = TkUniCharToUtf((unsigned char) Tcl_DStringValue(&buf)[0], Tcl_DStringValue(dsPtr)); Tcl_DStringSetLength(dsPtr, len); } else { diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 321ecc4..604a667 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -2225,7 +2225,7 @@ FontMapLoadPage( end = (row + 1) << FONTMAP_SHIFT; for (i = row << FONTMAP_SHIFT; i < end; i++) { if (Tcl_UtfToExternal(NULL, encoding, src, - Tcl_UniCharToUtf(i, src), TCL_ENCODING_STOPONERROR, NULL, + TkUniCharToUtf(i, src), TCL_ENCODING_STOPONERROR, NULL, buf, sizeof(buf), NULL, NULL, NULL) != TCL_OK) { continue; } diff --git a/win/tkWinKey.c b/win/tkWinKey.c index 234a158..4130579 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -122,7 +122,7 @@ TkpGetString( if (((keysym != NoSymbol) && (keysym > 0) && (keysym < 256)) || (keysym == XK_Return) || (keysym == XK_Tab)) { - len = Tcl_UniCharToUtf(keysym & 255, buf); + len = TkUniCharToUtf(keysym & 255, buf); Tcl_DStringAppend(dsPtr, buf, len); } } diff --git a/xlib/X11/Xlib.h b/xlib/X11/Xlib.h index 8d8ec68..e8940d9 100644 --- a/xlib/X11/Xlib.h +++ b/xlib/X11/Xlib.h @@ -530,7 +530,7 @@ typedef struct _XDisplay { #endif #ifndef _XEVENT_ -#define XMaxTransChars 4 +#define XMaxTransChars 7 /* * Definitions of specific events. @@ -549,9 +549,9 @@ typedef struct { unsigned int state; /* key or button mask */ unsigned int keycode; /* detail */ Bool same_screen; /* same screen flag */ - char trans_chars[XMaxTransChars]; + char trans_chars[XMaxTransChars]; /* translated characters */ - int nbytes; + unsigned char nbytes; } XKeyEvent; typedef XKeyEvent XKeyPressedEvent; typedef XKeyEvent XKeyReleasedEvent; -- cgit v0.12 From aa42e365e10d36a627c74dd41c016fa92a1e36b6 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 1 Nov 2019 20:54:55 +0000 Subject: The previous commit [65bb96b4] was wrong: it did not take into account the specifics of -displaycolumns or the fact column #0 (the tree) is special. This introduced a regression in the headings activation: they did not de-activate properly when the mouse left the headings. Fix this and document in the code why catching is (much) easier than writing an explicit proc. --- library/ttk/treeview.tcl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/library/ttk/treeview.tcl b/library/ttk/treeview.tcl index 4158739..df188b7 100644 --- a/library/ttk/treeview.tcl +++ b/library/ttk/treeview.tcl @@ -120,9 +120,18 @@ proc ttk::treeview::ActivateHeading {w heading} { variable State if {$w != $State(activeWidget) || $heading != $State(activeHeading)} { - if {[winfo exists $State(activeWidget)] && $State(activeHeading) != {} - && $State(activeHeading) in [$State(activeWidget) cget -displaycolumns]} { - $State(activeWidget) heading $State(activeHeading) state !active + if {[winfo exists $State(activeWidget)] && $State(activeHeading) != {}} { + # It may happen that $State(activeHeading) no longer corresponds + # to an existing display column. This happens for instance when + # changing -displaycolumns in a bound script when this change + # triggers a event. A proc checking if the display column + # $State(activeHeading) is really still present or not could be + # written but it would need to check several special cases: + # a. -displaycolumns "#all" or being an explicit columns list + # b. column #0 display is not governed by the -displaycolumn + # list but by the value of the -show option + # --> Let's rather catch the following line. + catch {$State(activeWidget) heading $State(activeHeading) state !active} } if {$heading != {}} { $w heading $heading state active -- cgit v0.12 From 26f2d48f04f5a959c2ccb61f0e978c2d96203e6b Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 1 Nov 2019 21:15:07 +0000 Subject: Fix [f002bac209]: 'treeview identify column' returns _display_ columns identifiers whereas the man page tells about data columns identifiers --- doc/ttk_treeview.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n index 125cc78..2deb5b5 100644 --- a/doc/ttk_treeview.n +++ b/doc/ttk_treeview.n @@ -235,7 +235,7 @@ A data cell. Returns the item ID of the item at position \fIy\fR. .TP \fIpathname \fBidentify column \fIx y\fR -Returns the data column identifier of the cell at position \fIx\fR. +Returns the display column identifier of the cell at position \fIx\fR. The tree column has ID \fB#0\fR. .TP \fIpathname \fBidentify element \fIx y\fR -- cgit v0.12