summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2018-09-25 19:16:37 (GMT)
committerfvogel <fvogelnew1@free.fr>2018-09-25 19:16:37 (GMT)
commit1ec5f8b0006457583d55090fa81567395172f48f (patch)
tree82d98b29a6d62e2f0c23c4f9f29fddb868f1b3d1
parent1d75d1e36bbb97c1559ef53ff41acfca8088274a (diff)
parentf63bb1144e5843b991583fa4768e4c6eb67f51d4 (diff)
downloadtk-1ec5f8b0006457583d55090fa81567395172f48f.zip
tk-1ec5f8b0006457583d55090fa81567395172f48f.tar.gz
tk-1ec5f8b0006457583d55090fa81567395172f48f.tar.bz2
Merge bugfix branch bug-f792b457eb (scrollbar-3.26, 3.27, 3.28, 3.35 tests fail on macOS)
-rw-r--r--generic/tkTest.c33
-rw-r--r--tests/scrollbar.test2
2 files changed, 6 insertions, 29 deletions
diff --git a/generic/tkTest.c b/generic/tkTest.c
index 1fa461e..2dbd877 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -168,7 +168,7 @@ static int TestmenubarObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
#endif
-#if defined(_WIN32) || defined(MAC_OSX_TK)
+#if defined(_WIN32)
static int TestmetricsObjCmd(ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj * const objv[]);
@@ -266,17 +266,17 @@ Tktest_Init(
Tcl_CreateObjCommand(interp, "testtext", TkpTesttextCmd,
(ClientData) Tk_MainWindow(interp), NULL);
-#if defined(_WIN32) || defined(MAC_OSX_TK)
+#if defined(_WIN32)
Tcl_CreateObjCommand(interp, "testmetrics", TestmetricsObjCmd,
(ClientData) Tk_MainWindow(interp), NULL);
-#elif !defined(__CYGWIN__)
+#elif !defined(__CYGWIN__) && !defined(MAC_OSX_TK)
Tcl_CreateObjCommand(interp, "testmenubar", TestmenubarObjCmd,
(ClientData) Tk_MainWindow(interp), NULL);
Tcl_CreateObjCommand(interp, "testsend", TkpTestsendCmd,
(ClientData) Tk_MainWindow(interp), NULL);
Tcl_CreateObjCommand(interp, "testwrapper", TestwrapperObjCmd,
(ClientData) Tk_MainWindow(interp), NULL);
-#endif /* _WIN32 || MAC_OSX_TK */
+#endif /* _WIN32 */
/*
* Create test image type.
@@ -1764,7 +1764,7 @@ TestmenubarObjCmd(
*----------------------------------------------------------------------
*/
-#if defined(_WIN32) || defined(MAC_OSX_TK)
+#if defined(_WIN32)
static int
TestmetricsObjCmd(
ClientData clientData, /* Main window for application. */
@@ -1775,38 +1775,15 @@ TestmetricsObjCmd(
char buf[TCL_INTEGER_SPACE];
int val;
-#ifdef _WIN32
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
return TCL_ERROR;
}
-#else
- Tk_Window tkwin = (Tk_Window) clientData;
- TkWindow *winPtr;
-
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "option window");
- return TCL_ERROR;
- }
-
- winPtr = (TkWindow *) Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin);
- if (winPtr == NULL) {
- return TCL_ERROR;
- }
-#endif
if (strcmp(Tcl_GetString(objv[1]), "cyvscroll") == 0) {
-#ifdef _WIN32
val = GetSystemMetrics(SM_CYVSCROLL);
-#else
- val = ((TkScrollbar *) winPtr->instanceData)->width;
-#endif
} else if (strcmp(Tcl_GetString(objv[1]), "cxhscroll") == 0) {
-#ifdef _WIN32
val = GetSystemMetrics(SM_CXHSCROLL);
-#else
- val = ((TkScrollbar *) winPtr->instanceData)->width;
-#endif
} else {
Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]),
"\": must be cxhscroll or cyvscroll", NULL);
diff --git a/tests/scrollbar.test b/tests/scrollbar.test
index e4fdc0e..6f00e78 100644
--- a/tests/scrollbar.test
+++ b/tests/scrollbar.test
@@ -283,7 +283,7 @@ test scrollbar-3.41 {ScrollbarWidgetCmd procedure, "fraction" option} {
if {[testConstraint testmetrics]} {
place configure .t.s -width [expr 2*[testmetrics cxhscroll .t.s]+1]
} else {
- place configure .t.s -width [expr [winfo reqwidth .t.s] - 4]
+ place configure .t.s -width [expr [winfo height .t.s] - 2*([.t.s cget -highlightthickness] + [.t.s cget -bd] + 1)]
}
update
test scrollbar-3.42 {ScrollbarWidgetCmd procedure, "fraction" option} {