summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2019-09-09 02:08:49 (GMT)
committerKevin Walzer <kw@codebykevin.com>2019-09-09 02:08:49 (GMT)
commit78b920a617612a0002c4d1c6bd59f15f496da59b (patch)
treee097006dc7e4d942507d25440bf3d539a1540d63
parent7804721100908ae9c01d95d17d1336dd4fa50fa9 (diff)
downloadtk-78b920a617612a0002c4d1c6bd59f15f496da59b.zip
tk-78b920a617612a0002c4d1c6bd59f15f496da59b.tar.gz
tk-78b920a617612a0002c4d1c6bd59f15f496da59b.tar.bz2
Minor tweaks to tabbing window code on macOS, including to prevent a crash; thanks to Christopher Chavez for the patch
-rw-r--r--macosx/tkMacOSXWm.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index dae6506..d6b571a 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -5501,7 +5501,7 @@ TkMacOSXZoomToplevel(
/*
*----------------------------------------------------------------------
*
- * TkUnsupported1Cmd --
+ * TkUnsupported1ObjCmd --
*
* This procedure is invoked to process the
* "::tk::unsupported::MacWindowStyle" Tcl command. This command allows
@@ -5570,7 +5570,7 @@ TkUnsupported1ObjCmd(
return TCL_ERROR;
}
if ((objc < 3) || (objc > 4)) {
- Tcl_WrongNumArgs(interp, 2, objv, "tabbingid window ?newid?");
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?newid?");
return TCL_ERROR;
}
return WmWinTabbingId(interp, winPtr, objc, objv);
@@ -5595,7 +5595,7 @@ TkUnsupported1ObjCmd(
return WmWinAppearance(interp, winPtr, objc, objv);
case TKMWS_ISDARK:
if ((objc != 3)) {
- Tcl_WrongNumArgs(interp, 2, objv, "isdark window");
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
}
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(TkMacOSXInDarkMode(tkwin)));
@@ -5809,8 +5809,8 @@ WmWinStyle(
* Windows may only be grouped together as tabs if they all have the same
* tabbingIdentifier. In particular, by giving a window a unique
* tabbingIdentifier one can prevent it from becoming a tab in any other
- * window. Note, however, that changing the tabbingIdentifier of a window
- * which is already a tab does not cause it to become a separate window.
+ * window. Changing the tabbingIdentifier of a window which is already
+ * a tab causes it to become a separate window.
*
*----------------------------------------------------------------------
*/
@@ -5831,7 +5831,8 @@ WmWinTabbingId(
result = Tcl_NewStringObj(idString.UTF8String, [idString length]);
}
if (result == NULL) {
- Tcl_Panic("Failed to read tabbing identifier.");
+ NSLog(@"Failed to read tabbing identifier; try calling update before getting/setting the tabbing identifier of the window.");
+ return TCL_OK;
}
Tcl_SetObjResult(interp, result);
if (objc == 3) {
@@ -5931,7 +5932,7 @@ WmWinAppearance(
result = Tcl_NewStringObj(resultString, strlen(resultString));
}
if (result == NULL) {
- NSLog(@"Failed to read appearance name; try calling update before setting the appearance of the window.");
+ NSLog(@"Failed to read appearance name; try calling update before getting/setting the appearance of the window.");
return TCL_OK;
}
if (objc == 4) {