diff options
-rw-r--r-- | doc/ttk_button.n | 2 | ||||
-rw-r--r-- | doc/ttk_checkbutton.n | 2 | ||||
-rw-r--r-- | doc/ttk_label.n | 2 | ||||
-rw-r--r-- | doc/ttk_menubutton.n | 2 | ||||
-rw-r--r-- | doc/ttk_notebook.n | 2 | ||||
-rw-r--r-- | doc/ttk_radiobutton.n | 2 | ||||
-rw-r--r-- | doc/ttk_treeview.n | 2 | ||||
-rw-r--r-- | generic/ttk/ttkButton.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkNotebook.c | 4 | ||||
-rw-r--r-- | library/ttk/treeview.tcl | 15 | ||||
-rw-r--r-- | macosx/tkMacOSXKeyEvent.c | 6 | ||||
-rw-r--r-- | macosx/tkMacOSXKeyboard.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXScrlbr.c | 12 | ||||
-rw-r--r-- | tests/ttk/notebook.test | 2 | ||||
-rwxr-xr-x | unix/configure | 10 | ||||
-rw-r--r-- | unix/configure.in | 6 | ||||
-rwxr-xr-x | unix/installManPage | 10 | ||||
-rw-r--r-- | unix/tcl.m4 | 5 | ||||
-rw-r--r-- | unix/tkUnixFont.c | 2 | ||||
-rw-r--r-- | unix/tkUnixKey.c | 2 | ||||
-rw-r--r-- | win/makefile.vc | 2 | ||||
-rw-r--r-- | win/tkWinFont.c | 2 | ||||
-rw-r--r-- | win/tkWinKey.c | 2 | ||||
-rw-r--r-- | xlib/X11/Xlib.h | 6 |
24 files changed, 75 insertions, 31 deletions
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_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/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 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 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, 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/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 <Leave> 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 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/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) { 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 diff --git a/unix/configure b/unix/configure index 60646f4..fb0f5a3 100755 --- a/unix/configure +++ b/unix/configure @@ -1431,6 +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.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` \ @@ -4293,6 +4294,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 @@ -10005,8 +10009,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 @@ -10930,7 +10934,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 d7bdf6c..fdffbcc 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -470,8 +470,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 @@ -663,7 +663,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 4d615bf..935bbcd 100755 --- a/unix/installManPage +++ b/unix/installManPage @@ -92,12 +92,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 @@ -106,7 +114,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 3150973..0e146e4 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -93,6 +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.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` \ @@ -225,6 +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.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` \ @@ -926,6 +928,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/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/makefile.vc b/win/makefile.vc index 1008751..6371f0f 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -306,7 +306,7 @@ PRJ_INCLUDES = -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 /DUNICODE /D_UNICODE \
!if $(HAVE_UXTHEME_H)
/DHAVE_UXTHEME_H=1 \
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; |