From 1b3d4943e38c868a37820064659cd02787e64e36 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 25 Oct 2022 20:33:47 +0000 Subject: Fix [5e4e44a93b]: ttk::panedwindow chokes on drag. --- library/ttk/panedwindow.tcl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 -- cgit v0.12 From 7939e659ff00720ec9b2468dc748a189d9120be5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 27 Oct 2022 16:08:05 +0000 Subject: Tk_GetScrollInfo() -> Tk_GetScrollInfoObj(). Make invalid TK_SCROLL_???? values behave the same as TK_SCROLL_ERROR --- generic/tkCanvas.c | 18 +++++++++--------- generic/tkEntry.c | 8 ++++---- generic/tkListbox.c | 5 ++--- generic/ttk/ttkScroll.c | 4 ++-- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index aa23203..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. @@ -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/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/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; } } -- cgit v0.12 From eadd3b5f08832d7d4ac7be519985b1977f70623b Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 28 Oct 2022 15:15:03 +0000 Subject: Make sure `make distclean` clears away any tkUuid.h file in build area. --- unix/Makefile.in | 2 +- win/Makefile.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 3b3fa69..e98070e 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -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) 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 -- cgit v0.12